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

id = 109
number = 16
visible = True
facts = None

solution = '''\
max([X], X).
max([H|T], Max):-
  max(T, Max1),
  ( H > Max1, Max is H
    ;
    H =< Max1, Max is Max1 ).
'''