; *** Warp Point Chess ; *** Game of Jason Shields, ZRF by Peter Aronson. ; ; This ZRF has only been tested on Zillions 1.3.1, and very well may not work ; on earlier releases. ; You need to purchase Zillions of Games to load this rules file ; Visit the Zillions web site at (version "1.2") ;; Low-level macros (define rook-add (set-attribute never-moved? false) add) ;; Through-the-Warp-Point macros (define slide-capture (if (and friend? (piece? Warp-Point)) (set-position-flag here? true) END next (while (not-position? END) mark (if (and (piece? Warp-Point) friend? (not-position-flag? here?)) (WP-slide $1) END else back next ) ) else (verify (and not-friend? (not-piece? Warp-Point))) add ) ) (define rook-slide-capture (if (and friend? (piece? Warp-Point)) (set-position-flag here? true) END next (while (not-position? END) mark (if (and (piece? Warp-Point) friend? (not-position-flag? here?)) (WP-rook-slide $1) END else back next ) ) else (verify (and not-friend? (not-piece? Warp-Point))) (rook-add) ) ) (define pawn-shift-add (if (and friend? (piece? Warp-Point)) (set-position-flag here? true) END next (while (not-position? END) mark (if (and (piece? Warp-Point) friend? (not-position-flag? here?)) (WP-pawn-shift) END else back next ) ) else (verify empty?) (Pawn-add) ) ) (define pawn-capture-add (if (and friend? (piece? Warp-Point)) (set-position-flag here? true) END next (while (not-position? END) mark (if (and (piece? Warp-Point) friend? (not-position-flag? here?)) (WP-pawn-capture $1) END else back next ) ) else (verify (and enemy? (not-piece? Warp-Point))) (Pawn-add) ) ) ;; General Movement macros (define Warp-Point-leap2 ( $1 $2 (if (and friend? (piece? Warp-Point)) $1 $2) (verify empty?) add )) (define king-shift ( $1 (if (and friend? (piece? Warp-Point)) (set-position-flag here? true) END next (while (not-position? END) mark (if (and (piece? Warp-Point) friend? (not-position-flag? here?)) $1 (if (position-flag? started-here?) (set-attribute toggle (not toggle)) add ) (verify not-friend?) (verify (not-piece? Warp-Point)) (set-attribute never-moved? false) add END else back next ) ) else (verify not-friend?) (verify (not-piece? Warp-Point)) (set-attribute never-moved? false) add ) )) (define slide ( (set-position-flag started-here? true) $1 (while empty? add $1) (slide-capture $1))) (define rook-slide ((set-position-flag started-here? true) $1 (while empty? (rook-add) $1) (rook-slide-capture $1) )) (define WP-slide $1 (while empty? add $1) (if (position-flag? started-here?) (set-attribute toggle (not toggle)) add ) (verify not-friend?) (verify (not-piece? Warp-Point)) add ) (define WP-rook-slide $1 (while empty? (rook-add) $1) (if (position-flag? started-here?) (set-attribute toggle (not toggle)) add ) (verify not-friend?) (verify (not-piece? Warp-Point)) (rook-add) ) (define O-O ( (verify never-moved?) e ; KB1 (verify empty?) e ; KN1 (verify empty?) cascade e ; KR1 (verify (and friend? (piece? Rook) never-moved?) ) from back ; K1 ; Save expensive not-attacked?s for last (verify not-attacked?) e ; KB1 (verify not-attacked?) to (set-attribute never-moved? 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 never-moved? false) add ) ) (define O-O-O ( (verify never-moved?) w ; Q1 (verify empty?) w ; QB1 (verify empty?) cascade w ; QN1 (verify empty?) w ; QR1 (verify (and friend? (piece? Rook) never-moved?) ) from back ; K1 ; Save expensive not-attacked?s for last (verify not-attacked?) w ; Q1 (verify not-attacked?) to (set-attribute never-moved? 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 never-moved? false) add ) ) (define Pawn-add (if (in-zone? promotion-zone) (add Bishop Rook Queen) else add) ) (define Pawn-move ( (set-position-flag started-here? true) n (set-flag third-rank? (in-zone? third-rank)) (pawn-shift-add) (verify (flag? third-rank?)) n (set-flag third-rank? false) (pawn-shift-add) ) ) (define Pawn-capture ( (set-position-flag started-here? true) $1 (pawn-capture-add $1) ) ) (define WP-pawn-shift n (if (position-flag? started-here?) (set-attribute toggle (not toggle)) add ) (verify empty?) (Pawn-add) (verify (flag? third-rank?)) n (if (position-flag? started-here?) (set-attribute toggle (not toggle)) add ) (verify empty?) add ) (define WP-pawn-capture $1 (verify enemy?) (verify (not-piece? Warp-Point)) (Pawn-add) ) (define En-Passant ( $1 (en-passant-slide $1) ) ) (define en-passant ( $1 (if (and friend? (piece? Warp-Point)) (set-position-flag here? true) END next (while (not-position? END) mark (if (and (piece? Warp-Point) friend? (not-position-flag? here?)) $1 to END else next ) ) (go to) ) (verify empty?) (verify (or (and (enemy? n) (piece? Warp-Point n)) (last-from? n))) (verify (or (and (enemy? s) (piece? Warp-Point s)) (last-to? s))) (verify (or (not-enemy? n) (not-enemy? s) (not-piece? Warp-Point n) (not-piece? Warp-Point s))) to (go last-to) (verify enemy?) (verify (piece? Pawn)) capture add )) (define R-moves (slide n) (slide s) (slide e) (slide w) ) (define B-moves (slide ne) (slide se) (slide sw) (slide nw) ) (define N-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) ) (define W-moves (Warp-Point-leap2 n ne) (Warp-Point-leap2 n nw) (Warp-Point-leap2 s se) (Warp-Point-leap2 s sw) (Warp-Point-leap2 e ne) (Warp-Point-leap2 e se) (Warp-Point-leap2 w nw) (Warp-Point-leap2 w sw) ) (game (title "Warp Point Chess") (description "Warp Point Chess is played like usual Western Chess, except that each side's Knights are replaced by Warp Points. \\ A Warp-Point leaps like a Knight (one step left, right, up or down, then one step diagonally outward), passing over any pieces, to land in an empty square. Warp-Points are immune to capture. A friendly piece may move through one Warp-Point, and emerge from the other of its side as if squares adjacent to the first warp point were also adjacent to the second Warp-Point. A Warp-Point that could move to square of the other friendly Warp-Point can make a double-Knight's move in that direction, `bouncing` through the Warp-Point. \\ If you have a move into a Warp-Point that can land you back on your starting square, you have can make a null move. To make the null move, click on the looping piece. \\ Pawns may promote to Bishops, Rooks or Queens.") (history "Game of Jason Shields, ZRF by Peter Aronson \\ ZRF Revision 1.0, April 29th, 2002.") (strategy "Watch out for Warp-Points! They can not be captured, so a enemy Warp-Point can penetrate your position, and if there are pieces poised to go through, it can wreck havock.") (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) (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) (next 1 0) ) ) (links next (END a1) (h1 a2) (h2 a3) (h3 a4) (h4 a5) (h5 a6) (h6 a7) (h7 a8) (h8 END)) (dummy END) (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) ) ) (board-setup (White (Pawn a2 b2 c2 d2 e2 f2 g2 h2) (Warp-Point b1 g1) (Bishop c1 f1) (Rook a1 h1) (Queen d1) (King e1) ) (Black (Pawn a7 b7 c7 d7 e7 f7 g7 h7) (Warp-Point b8 g8) (Bishop c8 f8) (Rook a8 h8) (Queen d8) (King e8) ) ) (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 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 on the first square of the move..") (attribute toggle false) (image White "images\Chess\wpawn.bmp" Black "images\Chess\bpawn.bmp") (moves (Pawn-capture nw) (Pawn-capture ne) (Pawn-move) (en-passant ne) (en-passant nw) ) ) (piece (name Bishop) (help "Bishop: slides diagonally any number of squares") (description "Bishop\A Bishop moves any number of squares on a diagonal=2E It may not leap over other pieces.") (image White "images\Chess\wbishop.bmp" Black "images\Chess\bbishop.bmp") (attribute toggle false) (moves (B-moves) ) ) (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) (attribute toggle false) (moves (rook-slide n) (rook-slide e) (rook-slide s) (rook-slide w) ) ) (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 toggle false) (moves (R-moves) (B-moves) ) ) (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. \\ The King 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 out of or through check, or if the King or Rook has previously moved.") (image White "images\Chess\wking.bmp" Black "images\Chess\bking.bmp") (attribute never-moved? true) (attribute toggle false) (moves (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) ) ) (piece (name Warp-Point) (help "Warp-Point: leaps like a Knight, but without capturing") (description "Warp-Point\A Warp-Point leaps like a Knight (one step left, right, up or down, then one step diagonally outward), passing over any pieces, to land in an empty square. Warp-Points are immune to capture. A friendly piece may move through one Warp-Point, and emerge from the other of its side as if squares adjacent to the first warp point were also adjacent to the second Warp-Point. A Warp-Point that could move to square of the other friendly Warp-Point can make a double-Knight's move in that direction, `bouncing` through the Warp-Point.") (image White "images\Chess\wdownknight.bmp" Black "images\Chess\bdownknight.bmp") (moves (W-moves) ) ) (loss-condition (White Black) (checkmated King)) )