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

id = 124
group = 'sorting'
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).
'''