Mats, you are right, I didn't consider that case. So now I have 3 type of move (from higher priority to lower): check-type, tasty-type, normal-type.
Your proposed solution, I guess, it is very cpu consuming, because for each move we have to scan all the board. In my last post I was talking about a neutral player that check if the king is in check before each player (and move a dummy-piece if it is so). What do you thing about it?
Anyhow, I have tried to implement your solution but I had a parse error. I defined the move in this way:
Your proposed solution, I guess, it is very cpu consuming, because for each move we have to scan all the board. In my last post I was talking about a neutral player that check if the king is in check before each player (and move a dummy-piece if it is so). What do you thing about it?
Anyhow, I have tried to implement your solution but I had a parse error. I defined the move in this way:
(define shift1-check (
START
(while (on-board? next) (if (and (piece? King) friend?) (verify attacked?) (set-flag found? true))
next
)
(verify found?)
$1
(verify not-friend?)
(set-flag found? false)
add
))
Where is the error?