aboutsummaryrefslogtreecommitdiff
path: root/day04/part1.mzn
blob: eccd08ae93e5728abefd0672b497d506a7703025 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
include "globals.mzn";

par set of int: range;

array[0..5] of var 0..9: digits;
var range: code;

constraint
  code =
    digits[0] * 100000 +
    digits[1] * 10000 +
    digits[2] * 1000 +
    digits[3] * 100 +
    digits[4] * 10 +
    digits[5];

constraint
  exists (i in 0..4) (
    digits[i] == digits[i+1]
  );

constraint
  increasing(digits);

output [show(code)];

solve satisfy;