; *** Chosen Chess, Game of Gianni Cottogni, 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 ;; Chosing macros (define can-leap2 (if (not-flag? have-move?) (if (on-board? $1) mark $1 (if (on-board? $2) $2 (set-flag have-move? not-friend?) ) back ) ) ) (define can-move (if (not-flag? have-move?) (if (on-board? $1) (set-flag have-move? (not-friend? $1)) ) ) ) (define can-move-nc (if (not-flag? have-move?) (if (on-board? $1) (set-flag have-move? (empty? $1)) ) ) ) (define can-move-capture (if (not-flag? have-move?) (if (on-board? $1) (set-flag have-move? (enemy? $1)) ) ) ) (define choose-pawn ( (verify not-last-to?) (set-flag have-move? false) (can-move-nc n) (can-move-capture ne) (can-move-capture nw) (verify (flag? have-move?)) (add Chosen-Pawn) )) (define choose-knight ( (verify not-last-to?) (set-flag have-move? false) (can-leap2 n ne) (can-leap2 n nw) (can-leap2 s se) (can-leap2 s sw) (can-leap2 e ne) (can-leap2 e se) (can-leap2 w nw) (can-leap2 w sw) (verify (flag? have-move?)) (add Chosen-Knight) )) (define choose-bishop ( (verify not-last-to?) (set-flag have-move? false) (can-move ne) (can-move nw) (can-move se) (can-move sw) (verify (flag? have-move?)) (add Chosen-Bishop) )) (define choose-rook ( (verify not-last-to?) (set-flag have-move? false) (can-move n) (can-move w) (can-move e) (can-move s) (verify (flag? have-move?)) (add Chosen-Rook) )) (define choose-queen ( (verify not-last-to?) (set-flag have-move? false) (can-move n) (can-move w) (can-move e) (can-move s) (can-move ne) (can-move nw) (can-move se) (can-move sw) (verify (flag? have-move?)) (add Chosen-Queen) )) (define choose-king ( (verify not-last-to?) (set-flag have-move? false) (can-move n) (can-move w) (can-move e) (can-move s) (can-move ne) (can-move nw) (can-move se) (can-move sw) (verify (flag? have-move?)) (add Chosen-King) )) ;; Regular movement macros (define knight-leap ( $1 $2 (verify not-friend?) (add Unchosen-Knight) )) (define king-shift ( $1 (verify not-friend?) (set-attribute never-moved? false) (add Unchosen-King) )) (define bishop-slide ( $1 (while empty? (add Unchosen-Bishop) $1) (verify not-friend?) (add Unchosen-Bishop) )) (define rook-slide ( $1 (while empty? (set-attribute never-moved? false) (add Unchosen-Rook) $1) (verify not-friend?) (set-attribute never-moved? false) (add Unchosen-Rook) )) (define queen-slide ( $1 (while empty? (add Unchosen-Queen) $1) (verify not-friend?) (add Unchosen-Queen) )) (define Pawn-add (if (in-zone? promotion-zone) (add Unchosen-Knight Unchosen-Bishop Unchosen-Rook Unchosen-Queen) else (set-attribute can-ep-e false) (set-attribute can-ep-w false) (add Unchosen-Pawn) ) ) (define Pawn-move ( n (verify empty?) (Pawn-add) (verify (in-zone? third-rank)) n (verify empty?) (if (on-board? e) e (if (and enemy? (piece? Chosen-Pawn)) (set-attribute can-ep-w true) ) w ) (if (on-board? w) w (if (and enemy? (piece? Chosen-Pawn)) (set-attribute can-ep-e true) ) e ) (Pawn-add) )) (define Pawn-capture ( $1 (verify enemy?) (Pawn-add) )) (define En-Passant ( (verify can-ep-$1) $1 capture n (Pawn-add) )) (define O-O ( (verify never-moved?) e ; KB1 (verify empty?) e ; KN1 (verify empty?) (change-type Unchosen-King) cascade e ; KR1 (verify never-moved?) from back ; K1 e ; KB1 to (set-attribute never-moved? false) e ; KN1 (set-attribute never-moved? false) add )) (define O-O-O ( (verify never-moved?) w ; Q1 (verify empty?) w ; QB1 (verify empty?) (change-type Unchosen-King) cascade w ; QN1 (verify empty?) w ; QR1 (verify never-moved?) from back ; K1 w ; Q1 to (set-attribute never-moved? false) w ; QB1 (set-attribute never-moved? false) add )) (define Board-Definitions (image "images\Chess\Chess8x8.bmp") (grid (start-rectangle 5 5 53 53) (dimensions ("a/b/c/d/e/f/g/h" (49 0)) ; files ("8/7/6/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 sw)(sw nw) (ne se)(se ne)) (zone (name promotion-zone) (players White) (positions a8 b8 c8 d8 e8 f8 g8 h8) ) (zone (name promotion-zone) (players Black) (positions a1 b1 c1 d1 e1 f1 g1 h1) ) (zone (name third-rank) (players White) (positions a3 b3 c3 d3 e3 f3 g3 h3) ) (zone (name third-rank) (players Black) (positions a6 b6 c6 d6 e6 f6 g6 h6) ) ) (game (title "Chosen Chess") (description "Chosen Chess is a variant of FIDE Chess where each turn you move a piece you `chose` last turn, and then select the piece you will move the next turn. There is no check or checkmate, and the object of the game is to either capture your opponent's King, or to stalemate them. Stalemate can occur as the result of the capture of the opponent's chosen piece, the blocking of the opponent's chosen piece (if a Pawn) or as the result of the opponent being reduced to a lone King, and thus having no piece to choose after moving the King. \\ Each turn except the first, you move your chosen piece, and then choose a new one (it may not be the piece you just moved). One the first turn you only choose a piece. The chosen piece turns upside-down as an indicator. You may only chose a piece that has a legal move. \\ To see a description of how a piece moves right-click on it to bring up its properties dialog.") (history "Game of Gianni Cottogni, ZRF by Peter Aronson. \\ ZRF Revision 1.0, May 3rd, 2001.") (strategy "Be very careful when choosing a piece -- if it is captured before you move, you lose.") (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 choice-move) (Black choice-move) repeat (White actual-move) (White choice-move) (Black actual-move) (Black choice-move) ) (pass-turn false) (loss-condition (White Black) (captured Chosen-King Unchosen-King)) (loss-condition (White Black) stalemated) (board (Board-Definitions)) (board-setup (White (Unchosen-Pawn a2 b2 c2 d2 e2 f2 g2 h2) (Unchosen-Knight b1 g1) (Unchosen-Bishop c1 f1) (Unchosen-Rook a1 h1) (Unchosen-Queen d1) (Unchosen-King e1) ) (Black (Unchosen-Pawn a7 b7 c7 d7 e7 f7 g7 h7) (Unchosen-Knight b8 g8) (Unchosen-Bishop c8 f8) (Unchosen-Rook a8 h8) (Unchosen-Queen d8) (Unchosen-King e8) ) ) (piece (name Unchosen-Pawn) (help "Pawn: moves forward, captures diagonally, can promote on 8th row") (description "Pawn\A Pawn can move straight ahead one square, or two squares from its starting position. A Pawn captures by moving one square ahead and diagonally. If a Pawn reaches the far rank it promotes, changing into a Knight, Bishop, Rook, or Queen. On rare occasions Pawns can also execute a move called `En Passant`, or `in passing`. This allows a Pawn to take an enemy Pawn that has just moved two squares. This Pawn is unchosen -- it may not move until the turn after it is chosen.") (image White "images\Chess\wpawn.bmp" Black "images\Chess\bpawn.bmp") (attribute never-moved? false) (attribute can-ep-e false) (attribute can-ep-w false) (moves (move-type choice-move) (choose-pawn) ) ) (piece (name Chosen-Pawn) (help "Pawn: moves forward, captures diagonally, can promote on 8th row") (description "Pawn\A Pawn can move straight ahead one square, or two squares from its starting position. A Pawn captures by moving one square ahead and diagonally. If a Pawn reaches the far rank it promotes, changing into a Knight, Bishop, Rook, or Queen. On rare occasions Pawns can also execute a move called `En Passant`, or `in passing`. This allows a Pawn to take an enemy Pawn that has just moved two squares. This Pawn has been chosen and must be moved.") (image White "images\Chess\wdownpawn.bmp" Black "images\Chess\bdownpawn.bmp") (attribute never-moved? false) (attribute can-ep-e false) (attribute can-ep-w false) (moves (move-type actual-move) (Pawn-capture nw) (Pawn-capture ne) (Pawn-move) (En-Passant e) (En-Passant w) ) ) (piece (name Unchosen-Knight) (help "Knight: moves like an `L`, 2 squares 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. This Knight is unchosen -- it will not move until the turn after it is chosen.") (image White "images\Chess\wknight.bmp" Black "images\Chess\bknight.bmp") (attribute never-moved? false) (moves (move-type choice-move) (choose-knight) ) ) (piece (name Chosen-Knight) (help "Knight: moves like an `L`, 2 squares 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. This Knight has been chosen and must be moved.") (image White "images\Chess\wdownknight.bmp" Black "images\Chess\bdownknight.bmp") (attribute never-moved? false) (moves (move-type actual-move) (knight-leap n ne) (knight-leap n nw) (knight-leap s se) (knight-leap s sw) (knight-leap e ne) (knight-leap e se) (knight-leap w nw) (knight-leap w sw) ) ) (piece (name Unchosen-Bishop) (help "Bishop: slides diagonally any number of squares") (description "Bishop\A Bishop moves any number of squares on a diagonal. It may not leap over other pieces. This Bishop is unchosen -- it will not move until the turn after it is chosen.") (image White "images\Chess\wbishop.bmp" Black "images\Chess\bbishop.bmp") (attribute never-moved? false) (moves (move-type choice-move) (choose-bishop) ) ) (piece (name Chosen-Bishop) (help "Bishop: slides diagonally any number of squares") (description "Bishop\A Bishop moves any number of squares on a diagonal. It may not leap over other pieces. This Bishop has been chosen and must be moved.") (image White "images\Chess\wdownbishop.bmp" Black "images\Chess\bdownbishop.bmp") (attribute never-moved? false) (moves (move-type actual-move) (bishop-slide ne) (bishop-slide nw) (bishop-slide se) (bishop-slide sw) ) ) (piece (name Unchosen-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. This Bishop is unchosen -- it will not move until the turn after it is chosen.") (image White "images\Chess\wrook.bmp" Black "images\Chess\brook.bmp") (attribute never-moved? true) (moves (move-type choice-move) (choose-rook) ) ) (piece (name Chosen-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. This Rook has been chosen and must be moved.") (image White "images\Chess\wdownrook.bmp" Black "images\Chess\bdownrook.bmp") (attribute never-moved? true) (moves (move-type actual-move) (rook-slide n) (rook-slide e) (rook-slide s) (rook-slide w) ) ) (piece (name Unchosen-Queen) (help "Queen: can slide 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. This Queen is unchosen -- it will not move until the turn after it is chosen.") (image White "images\Chess\wqueen.bmp" Black "images\Chess\bqueen.bmp") (attribute never-moved? false) (moves (move-type choice-move) (choose-queen) ) ) (piece (name Chosen-Queen) (help "Queen: can slide 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. This Queen has been chosen and must be moved.") (image White "images\Chess\wdownqueen.bmp" Black "images\Chess\bdownqueen.bmp") (attribute never-moved? false) (moves (move-type actual-move) (queen-slide n) (queen-slide e) (queen-slide s) (queen-slide w) (queen-slide ne) (queen-slide nw) (queen-slide se) (queen-slide sw) ) ) (piece (name Unchosen-King) (help "King: steps 1 square in any direction") (description "King\A King can move to any adjacent square; if it is captured, you lose the game. It may also `castle` with the Rook, if neither the Rook nor King has moved yet and there is nothing in between them. In castling the King moves two squares nearer the Rook and the Rook leaps to the far side of the King. You may not castle if the King or Rook involved has previously moved. This King is unchosen -- it will not move until the turn after it is chosen.") (image White "images\Chess\wking.bmp" Black "images\Chess\bking.bmp") (attribute never-moved? true) (moves (move-type choice-move) (choose-king) ) ) (piece (name Chosen-King) (help "King: steps 1 square in any direction") (description "King\A King can move to any adjacent square; if it is captured, you lose the game. It may also `castle` with the Rook, if neither the Rook nor King has moved yet and there is nothing in between them. In castling the King moves two squares nearer the Rook and the Rook leaps to the far side of the King. You may not castle if the King or Rook involved has previously moved. This King has been chosen and must be moved.") (image White "images\Chess\wdownking.bmp" Black "images\Chess\bdownking.bmp") (attribute never-moved? true) (moves (move-type actual-move) (king-shift n) (king-shift e) (king-shift s) (king-shift w) (king-shift ne) (king-shift nw) (king-shift se) (king-shift sw) (O-O) (O-O-O) ) ) )