summaryrefslogtreecommitdiff
path: root/prolog/problems/old_exams/pascal_3/common.py
blob: af00400340341af8542ff24eecac69498ef72db1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
id = 179
number = 86
visible = False
facts = None

solution = '''\
pascal(_, 0, 1) :- !.
pascal(I, I, 1) :- !.
pascal(I, J, N) :-
  I1 is I - 1,
  J1 is J - 1,
  pascal(I1, J, N1),
  pascal(I1, J1, N2),
  N is N1 + N2.
'''