to be magic sequence14

question be1 to1 - - - - - - - to1 - - -

MiniZinc model

include "globals.mzn";
int: n =  14;
array[0..10] of string: str = array1d(0..10, 
   ["-","to1", "be1", "or", "not", "to2", "be2", "that", "is ","the", "question"]);
array[0..n-1] of var 0..n-1: s;
solve satisfy;
constraint global_cardinality(s,set2array(index_set(s)), s);
output [ show(str[fix(s[i])]) ++ " " | i in 0..n-1 ];

Back to Constrained-based constraint poetry
Created by Hakan Kjellerstrand hakank@gmail.com