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

id = 179
group = 'old_exams'
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.
'''