Ok, so I have this puzzle that is called the CuFrog, that consists in filling a 3x3x3 cube with a number in each position but leaping over a position when going from one to the other. For instance, considering a flattened cube, the valid position to the right of (1,1) on side 1 would be (3,1) on side 1.
So I'm using Constraints in Prolog to do this and I've given the domain of each variable (1 to 54), I've said they must all be different and that, for each position, one of the positions in the set right-left-down-up has to be the current value of such position + 1.
Also, I've given an entry point to the puzzle, which means I placed the number 1 already on the first position.
Thing is, SICStus is not finding me an answer when I'm labelling the variables. :( It seems I must be missing a restriction somewhere or maybe I'm doing something wrong. Can anyone help?
Thanks.
asserta(clpfd:full_answer))
. And then enter the query without labeling! You have definitely not missed a restriction, it is rather the opposite: You are restricting too much! – falselength(Vars,54), domain(Vars,1,54), restriction_predicate(), asserta(clpfd:full_answer). %labelling([min],Vars) -- This is what I was doing.
– Sidner| ?-
prompt – false