Solutions
Inputs
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
28
29
include "ui.mzn";
include "charts.mzn";
int: n; % The number of queens.
array [1..n] of var 1..n: q;
include "alldifferent.mzn";
constraint alldifferent(q);
constraint alldifferent(i in 1..n)(q[i] + i);
constraint alldifferent(i in 1..n)(q[i] - i);
constraint defineUI([
h4("Solutions"),
perSolution([
h6("Solution"),
barchart("bb")
])
]);
output outputJSON();
output outputUIData([
"bb", barchartData(q)
]);