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

id = 151
number = 60
visible = True
facts = None

solution = '''\
magic(L):-
  L = [A1,A2,A3,B1,B2,B3,C1,C2,C3],
  L ins 1..9,
  all_different(L),
  A1+A2+A3 #= B1+B2+B3,
  A1+A2+A3 #= C1+C2+C3,
  A1+B1+C1 #= A2+B2+C2,
  A1+B1+C1 #= A3+B3+C3,
  A1+B2+C3 #= A3+B2+C1,
  labeling([], L).'''