; *** Toystore Chess ; *** Game of Richard Stack, ZRF by Peter Aronson ; v.1.0 Original Coding ; You need to purchase Zillions of Games to load this rules file ; Visit the Zillions web site at http://www.zillions-of-games.com ; Movement Macros ;; Normal Moves (define shift ($1 (verify not-friend?) add) ) (define shift2 ($1 $2 (verify not-friend?) add) ) (define slide ($1 (while empty? add $1) (verify not-friend?) add) ) ;; King capturing only moves -- these moves are used to make sure that ;; the King is not placed where it may be attacked. They make special ;; moves that can only capture Kings. (define shift-cking ($1 (verify (and (piece? King) not-friend?)) add)) (define shift2-cking ($1 $2 (verify (and (piece? King) not-friend?)) add)) (define slide-cking ($1 (while empty? $1) (verify (and (piece? King) not-friend?)) add)) ; Board Macros (define board-5x5 (board (image "images\Chess\Chess5x5.bmp") (grid (start-rectangle 5 5 53 53) (dimensions ("a/b/c/d/e" (49 0)) ; files ("5/4/3/2/1" (0 49)) ; ranks ) (directions (n 0 -1) (e 1 0) (s 0 1) (w -1 0) (ne 1 -1) (nw -1 -1) (se 1 1) (sw -1 1) ) ) (symmetry Black (n s)(s n) (nw se)(sw ne) (ne sw)(se nw) (e w)(w e)) ; Reverse e-w for Baby Chess castling (zone (name promotion-zone) (players White) (positions a5 b5 c5 d5 e5) ) (zone (name promotion-zone) (players Black) (positions a1 b1 c1 d1 e1) ) (zone (name third-rank) (players White Black) (positions a3 b3 c3 d3 e3) ) ) ) ; Games ; ************************************************************************ (game (title "Toystore Chess") (description "Play by normal chess rules except that each side has only one King, one Queen, one Rook, one Bishop and one Knight which start off of the board, and must be placed before regular movement may start, the King being placed last. \\ Right-click on pieces to see how they move.") (history "Game of Richard Stack, ZRF by Peter Aronson. \\ ZRF Revision 1.0, July 30th, 2001.") (strategy "This game plays rather like a Chess problem. Placement is critial.") (win-sound "Audio\\Orchestra_CF.wav") (loss-sound "Audio\\Orchestra_FC.wav") (click-sound "Audio\\Pickup.wav") (release-sound "Audio\\WoodThunk.wav") (players White Black) (turn-order White Black) (move-priorities put-on-board-move put-king-on-board-move) (pass-turn false) (board-5x5) (board-setup (White (Knight off 1) (Bishop off 1) (Rook off 1) (Queen off 1) (King off 1)) (Black (Knight off 1) (Bishop off 1) (Rook off 1) (Queen off 1) (King off 1)) ) (piece (name Knight) (help "Knight: jumps in an `L`, two one way and one the other") (description "Knight\A Knight moves like an `L`, two squares vertically plus one horizontally, or two squares horizontally plus one vertically. It hops over any pieces on the way.") (image White "images\Chess\wknight.bmp" Black "images\Chess\bknight.bmp") (drops (move-type put-on-board-move) ((verify empty?) add) ) (moves (move-type normal-move) (shift2 n ne) (shift2 n nw) (shift2 s se) (shift2 s sw) (shift2 e ne) (shift2 e se) (shift2 w nw) (shift2 w sw) (move-type put-on-board-move) (shift2-cking n ne) (shift2-cking n nw) (shift2-cking s se) (shift2-cking s sw) (shift2-cking e ne) (shift2-cking e se) (shift2-cking w nw) (shift2-cking w sw) ) ) (piece (name Bishop) (help "Bishop: slides any number of squares diagonally") (description "Bishop\A Bishop moves any number of squares on a diagonal. It may not leap over other pieces.") (image White "images\Chess\wbishop.bmp" Black "images\Chess\bbishop.bmp") (drops (move-type put-on-board-move) ((verify empty?) add) ) (moves (move-type normal-move) (slide ne) (slide nw) (slide se) (slide sw) (move-type put-on-board-move) (slide-cking ne) (slide-cking nw) (slide-cking se) (slide-cking sw) ) ) (piece (name Rook) (help "Rook: slides any number of squares along the row or column.") (description "Rook\A Rook moves any number of squares orthogonally on a rank or a file. It may not leap over other pieces.") (image White "images\Chess\wrook.bmp" Black "images\Chess\brook.bmp") (attribute never-moved? true) (drops (move-type put-on-board-move) ((verify empty?) add) ) (moves (move-type normal-move) (slide n) (slide e) (slide s) (slide w) (move-type put-on-board-move) (slide-cking n) (slide-cking e) (slide-cking s) (slide-cking w) ) ) (piece (name Queen) (help "Queen: slides any number of squares in any direction") (description "Queen\A Queen moves any number of squares in a straight line. It may not leap over other pieces.") (image White "images\Chess\wqueen.bmp" Black "images\Chess\bqueen.bmp") (drops (move-type put-on-board-move) ((verify empty?) add) ) (moves (move-type normal-move) (slide n) (slide e) (slide s) (slide w) (slide ne) (slide nw) (slide se) (slide sw) (move-type put-on-board-move) (slide-cking n) (slide-cking e) (slide-cking s) (slide-cking w) (slide-cking ne) (slide-cking nw) (slide-cking se) (slide-cking sw) ) ) (piece (name King) (help "King: can move 1 square in any safe direction (no castling)") (description "King\A King can move to any adjacent square, but never to a square where it can be captured.\\In this game, the King may not castle.") (image White "images\Chess\wking.bmp" Black "images\Chess\bking.bmp") (drops (move-type put-king-on-board-move) ((verify empty?) (verify not-attacked?) add) ) (moves (move-type normal-move) (shift n) (shift e) (shift s) (shift w) (shift ne) (shift nw) (shift se) (shift sw) (move-type put-on-board-move) (shift-cking n) (shift-cking e) (shift-cking s) (shift-cking w) (shift-cking ne) (shift-cking nw) (shift-cking se) (shift-cking sw) ) ) (loss-condition (White Black) (checkmated King) ) )