I need to do some symulations about knight path and Hamilton cycle on chesseboard, but i wondering what if i exclude some fields from chesseboard
xchessboard(1..8).
ychessboard(1..8).
time(1..8*8+1).
xypos(X,Y) :- xchessboard(X), ychessboard(Y).
fromTO(X1,Y1,X2,Y2) :- xypos(X1,Y1), xypos(X2,Y2),
|X1-X2| = 1, |Y1-Y2| = 2.
fromTO(X1,Y1,X2,Y2) :- xypos(X1,Y1), xypos(X2,Y2),
|X1-X2| = 2, |Y1-Y2| = 1.
1 { position(I,X,Y) : xypos(X,Y) } 1 :- time(I).
:- time(I), time(I+1), xypos(X1,Y1), xypos(X2,Y2),
position(I,X1,Y1), position(I+1,X2,Y2), not
fromTO(X1,Y1,X2,Y2).
:- time(I1-1), time(I2), I1 < I2, xypos(X,Y),
position(I1,X,Y), position(I2,X,Y).
:- position(1,X,Y), X+Y>2.
:- position(8*8+1,X,Y), X+Y>2
above is code in clingo, and i need to remove some fileds like a1 from this chesseboard but i dont have any idea how to do that, can someone help me? Thanks
Besides that you do not have a "a1" on your chessboard but a (1,1), just do not defer the xypos/2 facts for the positions you want to remove: