>>>It is generally recommended for newcomers to Zillions programming to begin with a simpler game.<<<
I know, but I cannot limit my imagination. :-)
>>>I suppose, the simplest way to solve this is to introduce yet another move-type which has the highest priority of all.<<<
I think it is enough just two type of move: normal and "tasty". In the tasty moves, with higher priority, you verify (KING-NOT-IN-CHECK AND IT-IS-POSSIBLE-TO-CAPTURE-A-PAWN).
>>>So you must loop through the board squares until you find the friendly king, and verify that it is threatened.<<<
The idea behind is: a scan all the board and if any king is in check it is moved a marker in the dummy square named "king-check". I use "capture king-check" to clean the dummy square. (Assume I already defined all the links with "next", starting from the dummy square START.)
The problem is this piece of code doesn't work. What am I doing wrong?
>>>It is generally recommended for newcomers to Zillions programming to begin with a simpler game.<<<
I know, but I cannot limit my imagination. :-)
>>>I suppose, the simplest way to solve this is to introduce yet another move-type which has the highest priority of all.<<<
I think it is enough just two type of move: normal and "tasty". In the tasty moves, with higher priority, you verify (KING-NOT-IN-CHECK AND IT-IS-POSSIBLE-TO-CAPTURE-A-PAWN).
>>>So you must loop through the board squares until you find the friendly king, and verify that it is threatened.<<<
I'm having big trouble here. I wrote:
(piece
(name Controller)
(dummy)
(moves
(
capture king-check
START next
(while on-board?
(if (and attacked? (piece? King))
(create Marker king-check) )
next
)
add
)
)
)
The idea behind is: a scan all the board and if any king is in check it is moved a marker in the dummy square named "king-check". I use "capture king-check" to clean the dummy square. (Assume I already defined all the links with "next", starting from the dummy square START.)
The problem is this piece of code doesn't work. What am I doing wrong?