; *** Knight Scattering Chess ; *** Game of Sergey Sirotkin, 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 ;; Regular movement macros (define add-and-flag (set-attribute can-castle? false) (verify (or (not-piece? Knight) (empty? Iron))) add ) (define add-and-flag2 (set-attribute can-castle? false) (if (and (flag? Is-Pawn?) (in-zone? opposing-promotion-zone)) (add Queen) else add ) ) (define step1 ( $1 (verify not-friend?) (add-and-flag) )) (define leap2 ( $1 $2 (verify empty?) (verify not-last-from?) (add-and-flag) )) (define slide ( $1 (while empty? (add-and-flag) $1) (verify not-friend?) (add-and-flag) )) (define O-O ( (verify can-castle?) e ; KB1 (verify empty?) e ; KN1 (verify empty?) cascade e ; KR1 (verify (and friend? can-castle?) ) from back ; K1 ; Save expensive not-attacked?s for last (verify not-attacked?) e ; KB1 (verify not-attacked?) to (set-attribute can-castle? false) ; We could check if KN1 is attacked too, but this isn't ; really necessary since Zillions doesn't allow any moves ; into check e ; KN1 (set-attribute can-castle? false) add ) ) (define O-O-O ( (verify can-castle?) w ; Q1 (verify empty?) w ; QB1 (verify empty?) cascade w ; QN1 (verify empty?) w ; QR1 (verify (and friend? can-castle?)) from back ; K1 ; Save expensive not-attacked?s for last (verify not-attacked?) w ; Q1 (verify not-attacked?) to (set-attribute can-castle? false) ; We could check if KN1 is attacked too, but this isn't ; really necessary since Zillions doesn't allow any moves ; into check w ; QB1 (set-attribute can-castle? false) add ) ) (define Pawn-add (verify (not-piece? Knight)) (if (in-zone? promotion-zone) (add Rook Bishop Queen Knight) else add) ) (define Pawn-move ( n (verify empty?) (Pawn-add) (verify (in-zone? double-move-ranks)) n (verify empty?) add ) ) (define Pawn-capture ( $1 (verify enemy?) (Pawn-add) ) ) (define En-Passant ( $1 (verify enemy?) (verify last-to?) (verify (piece? Pawn)) capture n to n (verify last-from?) add ) ) ;; Relay macros (define relay-move (if (on-board? $1) $1 (if (and (or (not-piece? Knight) (empty? Iron)) (or (not-piece? King) not-friend?) (or not-empty? not-last-from?)) (add-and-flag2) ) (go from) ) ) (define N-relay ( $1 $2 (verify enemy?) (set-flag Is-Pawn? (piece? Pawn)) from (relay-move nne) (relay-move nnw) (relay-move sse) (relay-move ssw) (relay-move ene) (relay-move ese) (relay-move wnw) (relay-move wsw) )) (game (title "Knight Scattering Chess") (description "Knight Scattering Chess is played like the usual Chess with the following differences: \\ Knights may neither capture, nor (normally) be captured. \\ An opposing piece a Knight's move away from a Knight may be moved by a player in a Knight's move instead of moving one of their own pieces. Such pieces may capture pieces of -either- side. \\ Pawns returned to the first or second rank may move two squares forward, possibly being captured en-passant. Pawns moved to the eighth rank should promote to the piece of the Pawn's owner's choice, but currently only promote to Queens.") (history "Game by Sergey Sirotkin, ZRF by Peter Aronson. \\ ZRF Revision 1.0, July 15th, 2002.") (strategy "You will find that all the basic principles of Chess still apply: maximize the activity of your pieces, gain space, and keep your King safe!") (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) (pass-turn false) (recycle-promotions true) ; This allows us to control what pawns promote to ; by ; what is specified in off clauses in ; board-setup block. (loss-condition (White Black) (checkmated King)) (board (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) (nne 1 -2) (nnw -1 -2) (sse 1 2) (ssw -1 2) (ene 2 -1) (ese 2 1) (wnw -2 -1) (wsw -2 1) ) ) (symmetry Black (n s)(s n) (nw sw)(sw nw) (ne se)(se ne) (nne ssw)(ssw nne) (nnw sse)(sse nnw) (ene wsw)(wsw ene) (ese wnw)(wnw ese) ) (dummy Iron) (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 opposing-promotion-zone) (players White) (positions a1 b1 c1 d1 e1 f1 g1 h1) ) (zone (name opposing-promotion-zone) (players Black) (positions a8 b8 c8 d8 e8 f8 g8 h8) ) (zone (name double-move-ranks) (players White) (positions a2 b2 c2 d2 e2 f2 g2 h2 a3 b3 c3 d3 e3 f3 g3 h3) ) (zone (name double-move-ranks) (players Black) (positions a6 b6 c6 d6 e6 f6 g6 h6 a7 b7 c7 d7 e7 f7 g7 h7) ) ) (board-setup (White (Pawn a2 b2 c2 d2 e2 f2 g2 h2) (Knight b1 g1 off 8) (Bishop c1 f1 off 8) (Rook a1 h1 off 8) (Queen d1 off 8) (King e1) ) (Black (Pawn a7 b7 c7 d7 e7 f7 g7 h7 Iron) (Knight b8 g8 off 8) (Bishop c8 f8 off 8) (Rook a8 h8 off 8) (Queen d8 off 8) (King e8) ) ) ; Pawns (piece (name 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 the first or second rank. 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. \\ The Pawn 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.") (image White "images\chess\wpawn.bmp" Black "images\chess\bpawn.bmp") (attribute can-castle? false) (moves (Pawn-capture nw) (Pawn-capture ne) (Pawn-move) (En-Passant e) (En-Passant w) ) ) ; Knight equivalents (piece (name Knight) (help "Knight: moves like an `L`, 2 squares one way and one the other, can't capture or be captured, moves enemy pieces") (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. A Knight can neither capture nor be captured. An opposing piece a Knight's move away from a Knight may be moved a Knight's move, possibly capturing a piece on your side or the opposing side. An opposing Knight may not be moved back to the square it just vacated.") (image White "images\chess\wdownknight.bmp" Black "images\chess\bdownknight.bmp") (attribute can-castle? false) (moves (leap2 n ne) (leap2 n nw) (leap2 s se) (leap2 s sw) (leap2 e ne) (leap2 e se) (leap2 w nw) (leap2 w sw) (N-relay n ne) (N-relay n nw) (N-relay s se) (N-relay s sw) (N-relay e ne) (N-relay e se) (N-relay w nw) (N-relay w sw) ) ) ; Bishop Equivalents (piece (name 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.") (image White "images\chess\wbishop.bmp" Black "images\chess\bbishop.bmp") (attribute can-castle? false) (moves (slide ne) (slide nw) (slide se) (slide sw) ) ) ; Rook equivalents (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 can-castle? true) (moves (slide n) (slide e) (slide s) (slide w) ) ) ; Queen equivalents (piece (name 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.") (image White "images\chess\wqueen.bmp" Black "images\chess\bqueen.bmp") (attribute can-castle? false) (moves (slide n) (slide e) (slide s) (slide w) (slide ne) (slide nw) (slide se) (slide sw) ) ) ; Royal pieces (piece (name King) (help "King: steps 1 square in any direction to a safe square") (description "King\A King can move to any adjacent square, but never to a square where it can be captured. \\ It may also `castle` a 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 out of or through check, or if the King or Rook involved has previously moved.") (image White "images\chess\wking.bmp" Black "images\chess\bking.bmp") (attribute can-castle? true) (moves (step1 n) (step1 e) (step1 s) (step1 w) (step1 ne) (step1 nw) (step1 se) (step1 sw) (O-O) (O-O-O) ) ) ) (variant (title "Knight-Scattering Chess with Capturable Knights") (description "Just like regular Knight-Scattering Chess except that Knights may be captured.") (board-setup (White (Pawn a2 b2 c2 d2 e2 f2 g2 h2) (Knight b1 g1 off 8) (Bishop c1 f1 off 8) (Rook a1 h1 off 8) (Queen d1 off 8) (King e1) ) (Black (Pawn a7 b7 c7 d7 e7 f7 g7 h7) (Knight b8 g8 off 8) (Bishop c8 f8 off 8) (Rook a8 h8 off 8) (Queen d8 off 8) (King e8) ) ) )