summaryrefslogtreecommitdiff
path: root/prolog/problems/sorting/pivoting_4/common.py
blob: dd1a1a9ade57a84d59f1071f76d5dec4bcda7371 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# coding=utf-8

id = 124
number = 31
visible = True
facts = None

solution = '''\
pivoting(_, [], [], []).
pivoting(P, [H|T], [H|S], G) :-
  H =< P,
  pivoting(P, T, S, G).
pivoting(P, [H|T], S, [H|G]) :-
  H > P,
  pivoting(P, T, S, G).
'''