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

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.
'''