1
0
This repository has been archived on 2025-03-06. You can view files and clone it, but cannot push or open issues or pull requests.
language-mzn/sample.mzn

20 lines
318 B
MiniZinc

% Model of the queens problem
include "globals.mzn";
% parameters
int: n=8;
% variables
array[1..n] of var 1..n: R;
% constraints
constraint all_different(R);
constraint all_different([R[i] + i | i in 1..n]);
constraint all_different([R[i] + i | i in 1..n]);
% objective
solve satisfy;
% output
output [show(R)];