[ List Earliest Comments Only For Pages | Games | Rated Pages | Rated Games | Subjects of Discussion ]
Check out Janggi (Korean Chess), our featured variant for December, 2024.
Check out Janggi (Korean Chess), our featured variant for December, 2024.
This code works perfectly with correctly defined zones:
(define push-n (n (while on-board? (if empty? add (verify false))(if (in-zone? board-edge-n) add (verify false)) cascade n))) (define push-e (e (while on-board? (if empty? add (verify false))(if (in-zone? board-edge-e) add (verify false)) cascade e))) (define push-s (s (while on-board? (if empty? add (verify false))(if (in-zone? board-edge-s) add (verify false)) cascade s))) (define push-w (w (while on-board? (if empty? add (verify false))(if (in-zone? board-edge-w) add (verify false)) cascade w)))
The (verify false)'s are essential to stop move generation when the final square is found, otherwise, Zillions crashes. I decided to use rook-wise pushes to complement the piece's bishop-like move.