; *** Chess ; *** Copyright 1998-2002 Zillions Development ; v.2.0 ; You need to purchase Zillions of Games to load this rules file ; Visit the Zillions web site at http://www.zillions-of-games.com (version "2.0") (define leap1 ($1 (verify not-friend?) add) ) (define leap2 ($1 $2 (verify not-friend?) add) ) (define slide ($1 (while empty? add $1) (verify not-friend?) add)) (define Pawn-add ; (if (in-zone? promotion-zone) (add Knight Bishop Rook ;Queen) else add) add ) (define Pawn-move ( n (verify empty?) (Pawn-add) (verify (in-zone? third-rank)) 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 ) ) (define Board-Definitions (image "images\Chess\SHaag\Chess8x8.bmp" "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 "Pawns and Knights") (description "Object: Bring a Pawn to the enemy side to win.") (history "Game to teach beginners how Knights and Pawns move..\we could add in a next version a loss-condition when all Pawns are dead\Inventor: Stephane Burkhart 2014") (strategy "to be defined.") (option "prevent flipping" 2) (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) (board (Board-Definitions)) (board-setup (White (Pawn a2 b2 c2 d2 e2 f2 g2 h2) (Knight b1 g1) ) (Black (Pawn a7 b7 c7 d7 e7 f7 g7 h7) (Knight b8 g8) ) ) (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. 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.") (image White "images\Chess\SHaag\wpawn.bmp" "images\Chess\wpawn.bmp" Black "images\Chess\SHaag\bpawn.bmp" "images\Chess\bpawn.bmp") (moves (Pawn-capture nw) (Pawn-capture ne) (Pawn-move) (En-Passant e) (En-Passant w) ) ) (piece (name 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.") (image White "images\Chess\SHaag\wknight.bmp" "images\Chess\wknight.bmp" Black "images\Chess\SHaag\bknight.bmp" "images\Chess\bknight.bmp") (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) ) ) (win-condition (White Black) (absolute-config Pawn (promotion-zone)) ) ) ; VARIANT B&R (variant (define slide ($1 (while empty? add $1) (verify not-friend?) add)) (define rook-slide ( $1 (while empty? (set-attribute never-moved? false) add $1) (verify not-friend?) (set-attribute never-moved? false) add )) (title "Bishops and Rooks") (description "Object: capture any Bishop or Rook to win") (history "Game to teach beginners how to move Bishops and Rooks.\we think of a new version where the objective would be to bring both one Bishop and one Rook to the opposite side. But this time with no capture, just impeding the ennemy to go ahead by forbiding to cross control lines on the ennemy side of a piece (a cone region for Bishops, a square region for Rooks). But difficult to developp !\Inventor: Stephane Burkhart 2014") (strategy "try to pin the enemy, by double threat.") (option "prevent flipping" 2) (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) (board (Board-Definitions)) (board-setup (White (Bishop c1 f1) (Rook b1 g1) ) (Black (Bishop c8 f8) (Rook a8 h8) ) ) (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\SHaag\wbishop.bmp" "images\Chess\wbishop.bmp" Black "images\Chess\SHaag\bbishop.bmp" "images\Chess\bbishop.bmp") (moves (slide ne) (slide nw) (slide se) (slide 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\SHaag\wrook.bmp" "images\Chess\wrook.bmp" Black "images\Chess\SHaag\brook.bmp" "images\Chess\brook.bmp") (attribute never-moved? true) (moves (rook-slide n) (rook-slide e) (rook-slide s) (rook-slide w) ) ) (loss-condition (White Black) (captured Rook Bishop) ) ) ; VARIANT K&Q (variant (define king-shift ($1 (verify not-friend?) (set-attribute never-moved? false) add) ) (define slide ($1 (while empty? add $1) (verify not-friend?) add) ) (title "Queen and King") (description "Object: Bring your King to the opposite side or checkmate the opponent King.") (history "The idea comes from teaching beginners how basic pieces move, here Kings and Queens\Inventor: Stephane Burkhart 2014") (strategy "still to discover") (option "prevent flipping" 2) (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) (board (Board-Definitions)) (board-setup (White (Queen c1) (King d1) ) (Black (Queen e8) (King f8) ) ) (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\SHaag\wqueen.bmp" "images\Chess\wqueen.bmp" Black "images\Chess\SHaag\bqueen.bmp" "images\Chess\bqueen.bmp") (moves (slide n) (slide e) (slide s) (slide w) (slide ne) (slide nw) (slide se) (slide sw) ) ) (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.") (image White "images\Chess\SHaag\wking.bmp" "images\Chess\wking.bmp" Black "images\Chess\SHaag\bking.bmp" "images\Chess\bking.bmp") (attribute never-moved? true) (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) ) ) (win-condition (White Black) (absolute-config King (promotion-zone)) ) (loss-condition (White Black) (checkmated King)) )