将棋のZRF

※以下は「Shogi.zrf」の「Shogi」バリアントのみを抽出してあります。
 これをテキストエディタにコピー&ペーストして、名前を「Shogi.txt」から「Shogi.zrf」へ拡張子変更すれば、ZoGでチェスだけプレイできます。
 (全角スペースは認識されないため、「置換」処理で半角スペースへ変更しておく必要があります)

; *** Shogi
; *** 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")

; Possible additions:
; Graphics: red for promoted pieces
; Narrower screen for small screens

(define first-empty
 to-prison
 (while not-empty? next-prison)
)
(define convert-prisoner
 change-owner
 (if (flag? bSilver) (change-type Silver))
 (if (flag? bPawn) (change-type Pawn))
 (if (flag? bBishop) (change-type Bishop))
 (if (flag? bRook) (change-type Rook))
 (if (flag? bLance) (change-type Lance))
 (if (flag? bKnight) (change-type Knight))
)
(define prisoner-check
 (if enemy?
  (set-flag bSilver (piece? Promoted-Silver))
  (set-flag bPawn (piece? Tokin))
  (set-flag bBishop (piece? Promoted-Bishop))
  (set-flag bRook (piece? Promoted-Rook))
  (set-flag bKnight (piece? Promoted-Knight))
  (set-flag bLance (piece? Promoted-Lance))
  cascade
  mark
  (first-empty)
  to
  (convert-prisoner)
  back
 )
)
(define shift (
 (verify (in-zone? play-zone))
 $1
 (verify not-friend?)
 (prisoner-check)
 add
))
(define shiftP (
 (verify (in-zone? play-zone))
 (set-flag came-from-zone (in-zone? promotion-zone))
 $1
 (verify not-friend?)
 (prisoner-check)
 (if (in-zone? $3) add)
 (verify (or (flag? came-from-zone) (in-zone? promotion-zone)))
 (if enemy?
  (change-type $2)
  (if (in-zone? $3) (first-empty) (convert-prisoner))
  add
  else
  (add $2)
  )
))
(define shift2P (
 (verify (in-zone? play-zone))
 (set-flag came-from-zone (in-zone? promotion-zone))
 $1
 $2
 (verify not-friend?)
 (prisoner-check)
 (if (in-zone? $4) add)
 (verify (or (flag? came-from-zone) (in-zone? promotion-zone)))
 (if enemy?
  (change-type $3)
  (if (in-zone? $4) (first-empty) (convert-prisoner))
   add
  else
   (add $3)
  )
))
(define slide (
 (verify (in-zone? play-zone))
 $1 (while empty? add $1)
 (verify not-friend?)
 (prisoner-check)
 add
))
(define slideP (
 (verify (in-zone? play-zone))
 (set-flag came-from-zone (in-zone? promotion-zone))
 $1
 (while empty?
  (if (in-zone? promotion-zone) (set-flag came-from-zone true))
  (if (in-zone? $3) add)
  (if (flag? came-from-zone) (add $2))
  $1
 )
 (verify not-friend?)
 (prisoner-check)
 (if (in-zone? $3) add)
 (verify (or (flag? came-from-zone) (in-zone? promotion-zone)))
 (if enemy?
  (change-type $2)
  (if (in-zone? $3) (first-empty) (convert-prisoner))
  add
 else
  (add $2)
 )
))
(define drop-for-rank
 (while (on-board? e)
  (if empty? add)
  e
 )
 (if empty? add)
)
(define drop ( ; $1 = drop zone
 (verify (not-in-zone? play-zone))
 to-board
 (while (not-in-zone? $1) s)
 (while (on-board? s)
  mark
  (drop-for-rank)
  back
  s
 )
 (drop-for-rank)
))
(define check-dir
 (if (and (not-flag? bSafe)
  (on-board? $1)
  (not-enemy? $1)
  (not-defended? $1)
 )
 (set-flag bSafe true)
 )
)
(define drop-pawn-for-file
 (set-flag friendly-pawn false)
 mark
 (if (and friend? (piece? Pawn)) (set-flag friendly-pawn true))
 (while (and (not-flag? friendly-pawn) (on-board? s))
  s
  (if (and friend? (piece? Pawn)) (set-flag friendly-pawn true))
 )
 back
 (if (not-flag? friendly-pawn)
  mark
  (while (on-board? s)
   s
   (if empty?
   ; Check and disallow if it attacks a King with mate
    (if (and (enemy? n) (piece? King n))
    ; Can undefended Pawn be taken by King or can protected Pawn be taken?
     (set-flag bSafe (or not-defended? (attacked? no-king)))
     ; Check if King can make a move in any other direction
     n
     (check-dir e)
     (check-dir w)
     (check-dir n)
     (check-dir ne)
     (check-dir nw)
     (check-dir se)
     (check-dir sw)
     s
     (if (flag? bSafe) add)
    else
     add
    )
   )
  )
  back
 )
)
(define drop-pawn (
 (verify (not-in-zone? play-zone))
 to-board
 (drop-pawn-for-file)
 (while (on-board? e)
  e
  (drop-pawn-for-file)
 )
))
; *********************************************************************
; SHOGI
; *********************************************************************
(define ranki 9i 8i 7i 6i 5i 4i 3i 2i 1i)
(define rankii 9ii 8ii 7ii 6ii 5ii 4ii 3ii 2ii 1ii)
(define rankiii 9iii 8iii 7iii 6iii 5iii 4iii 3iii 2iii 1iii)
(define rankiv-vi 9iv 8iv 7iv 6iv 5iv 4iv 3iv 2iv 1iv
             9v 8v 7v 6v 5v 4v 3v 2v 1v
             9vi 8vi 7vi 6vi 5vi 4vi 3vi 2vi 1vi)
(define rankvii 9vii 8vii 7vii 6vii 5vii 4vii 3vii 2vii 1vii)
(define rankviii 9viii 8viii 7viii 6viii 5viii 4viii 3viii 2viii 1viii)
(define rankix 9ix 8ix 7ix 6ix 5ix 4ix 3ix 2ix 1ix)
(define wprison
 pw3i pw2i pw1i
 pw3ii pw2ii pw1ii
 pw3iii pw2iii pw1iii
 pw3iv pw2iv pw1iv
 pw3v pw2v pw1v
 pw3vi pw2vi pw1vi
 pw3vii pw2vii pw1vii
 pw3viii pw2viii pw1viii
 pw3ix pw2ix pw1ix
)
(define bprison
 pb1i pb2i pb3i
 pb1ii pb2ii pb3ii
 pb1iii pb2iii pb3iii
 pb1iv pb2iv pb3iv
 pb1v pb2v pb3v
 pb1vi pb2vi pb3vi
 pb1vii pb2vii pb3vii
 pb1viii pb2viii pb3viii
 pb1ix pb2ix pb3ix
)
(game
 (title "Shogi")
 (description
  "Object: Checkmate your opponent's King (just like Western Chess)\\
  Right-click on the pieces to see how they move. Most of the pieces
  can optionally promote when they reach the last 3 ranks. A piece
  can also promote if it moves within or from the last 3 ranks.\\
  When a piece is captured it is added to the capturer's `reserve`, an
  army of pieces which can be reintroduced into play on the capturer's
  side (pieces in reserve are also said to be `in hand`). Pieces are
  all the same color, and the direction a piece is pointing from indicates
  which player it belongs to. On any subsequent turn, the capturer may
  `drop` any captured piece (in its unpromoted state) onto a vacant square
  on the board, subject to a few rules:\\
  * A Pawn may not be placed on a file that already contains a Pawn\
  * A Pawn may not be dropped with mate\
  * A Pawn, Knight, or Lance may not be placed on a square from which it
  will never be able to move."
 )
 (strategy
  "Keep the squares in your camp protected to keep your opponent
  from dropping his pieces there. In particular the squares around
  your King must be well guarded. Middle game play is heavily influenced
  by play (and threats to play) from the reserves. Watch for squares
  (on both sides) vulnerable to drops. A good way to defend against
  a drop on a particular square is to move or drop a piece to that
  square yourself. In Shogi, unlike Western Chess, material isn't so
  important once the Kings are attacked. What is important is initiative
  or `sente`; many games end in `races` to see which player can mate the
  opposing king more quickly.\\
  The relative values of the initial pieces may be: Rook - Bishop -
  Gold/Silver - Lance/Knight - Pawn. Golds are slightly better than
  Silvers, especially for defense. Lances and Knights are only useful
  for offense; since they are weak, they want to push forward and promote
  when possible. Pawns are not worth very much until they approach the
  promotion zone, but a pawn in hand (i.e. part of the reserve of captured
  pieces) can be very useful.\\
  The game is widely covered in Japanese books, magazines, and newspapers.
  Some detailed books and magazines in English on shogi strategy
  can be found at http://www.zillions-of-games.com/shogi.html."
 )
 (history
  "Growing slowly in popularity outside of Japan, Shogi, the Japanese
  form of Chess, is perhaps the most popular board game in Japan, with
  perhaps a million active players. Some early form of chess was imported
  into Japan (perhaps from Korea or Thailand), probably between the 10th
  and 12th centuries. In the 16th century a rule was added (perhaps
  inspired by the changeable loyalties of mercenaries), allowing captured
  pieces to be re-used by the capturer, which sets shogi apart from all
  other chesslike games. Other larger forms of the game have been recorded
  (up to the inconceivable 25x25 Tai Shogi), but these have largely died
  out, except for the 12x12 Chu (Middle) Shogi. The Nihon Shogi Remmei
  (Japan Shogi Federation), formed in 1927, regulates play, conducts
  tournaments, and maintains player rankings."
 )
 (option "prevent flipping" true)
 (opening-sound "Audio\\Japan1.wav")
 (win-sound "Audio\\Japan2.wav")
 (loss-sound "Audio\\Japan2.wav")
 (release-sound "Audio\\BongPercussive.wav")
 (move-sound "Audio\\Bong5th.wav")
 (capture-sound "Audio\\WoodBells.wav")
 (players Black White)
 (turn-order Black White)
 (board
  (image "images\Shogi\SHaag\ShogiBrd.bmp" "images\Shogi\IntlSHaag\ShogiBrd.bmp" "images\Shogi\ShogiBrd.bmp")
  (grid
   (start-rectangle 15 15 55 60) ; 22 25 62 70)
   (dimensions ;17x9
   ; za = zb = "no mans land" area between board and prisons
   ; pb1-3 = black's prison table
   ; pw1-3 = white's prison table
    ("pw3/pw2/pw1/za/9/8/7/6/5/4/3/2/1/zb/pb1/pb2/pb3" (41 0))
    ("i/ii/iii/iv/v/vi/vii/viii/ix" (0 46))
   )
   (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)
   )
  )
  ; delete "no mans land"
  (kill-positions
   zai zaii zaiii zaiv zav zavi zavii zaviii zaix
   zbi zbii zbiii zbiv zbv zbvi zbvii zbviii zbix
  )
  (unlink (wprison) (bprison))
  ; setup prisoners chains (is there a better way to specify a general many to one link?)
  (links to-prison
   (9i pb1ix) (8i pb1ix) (7i pb1ix) (6i pb1ix) (5i pb1ix) (4i pb1ix) (3i pb1ix) (2i pb1ix) (1i pb1ix)
   (9ii pb1ix) (8ii pb1ix) (7ii pb1ix) (6ii pb1ix) (5ii pb1ix) (4ii pb1ix) (3ii pb1ix) (2ii pb1ix) (1ii pb1ix)
   (9iii pb1ix) (8iii pb1ix) (7iii pb1ix) (6iii pb1ix) (5iii pb1ix) (4iii pb1ix) (3iii pb1ix) (2iii pb1ix) (1iii pb1ix)
   (9iv pb1ix) (8iv pb1ix) (7iv pb1ix) (6iv pb1ix) (5iv pb1ix) (4iv pb1ix) (3iv pb1ix) (2iv pb1ix) (1iv pb1ix)
   (9v pb1ix) (8v pb1ix) (7v pb1ix) (6v pb1ix) (5v pb1ix) (4v pb1ix) (3v pb1ix) (2v pb1ix) (1v pb1ix)
   (9vi pb1ix) (8vi pb1ix) (7vi pb1ix) (6vi pb1ix) (5vi pb1ix) (4vi pb1ix) (3vi pb1ix) (2vi pb1ix) (1vi pb1ix)
   (9vii pb1ix) (8vii pb1ix) (7vii pb1ix) (6vii pb1ix) (5vii pb1ix) (4vii pb1ix) (3vii pb1ix) (2vii pb1ix) (1vii pb1ix)
   (9viii pb1ix) (8viii pb1ix) (7viii pb1ix) (6viii pb1ix) (5viii pb1ix) (4viii pb1ix) (3viii pb1ix) (2viii pb1ix) (1viii pb1ix)
   (9ix pb1ix) (8ix pb1ix) (7ix pb1ix) (6ix pb1ix) (5ix pb1ix) (4ix pb1ix) (3ix pb1ix) (2ix pb1ix) (1ix pb1ix)
  )

  (links to-white-prison
  ; associated with to-prison through symmetry
   (9i pw1i) (8i pw1i) (7i pw1i) (6i pw1i) (5i pw1i) (4i pw1i) (3i pw1i) (2i pw1i) (1i pw1i)
   (9ii pw1i) (8ii pw1i) (7ii pw1i) (6ii pw1i) (5ii pw1i) (4ii pw1i) (3ii pw1i) (2ii pw1i) (1ii pw1i)
   (9iii pw1i) (8iii pw1i) (7iii pw1i) (6iii pw1i) (5iii pw1i) (4iii pw1i) (3iii pw1i) (2iii pw1i) (1iii pw1i)
   (9iv pw1i) (8iv pw1i) (7iv pw1i) (6iv pw1i) (5iv pw1i) (4iv pw1i) (3iv pw1i) (2iv pw1i) (1iv pw1i)
   (9v pw1i) (8v pw1i) (7v pw1i) (6v pw1i) (5v pw1i) (4v pw1i) (3v pw1i) (2v pw1i) (1v pw1i)
   (9vi pw1i) (8vi pw1i) (7vi pw1i) (6vi pw1i) (5vi pw1i) (4vi pw1i) (3vi pw1i) (2vi pw1i) (1vi pw1i)
   (9vii pw1i) (8vii pw1i) (7vii pw1i) (6vii pw1i) (5vii pw1i) (4vii pw1i) (3vii pw1i) (2vii pw1i) (1vii pw1i)
   (9viii pw1i) (8viii pw1i) (7viii pw1i) (6viii pw1i) (5viii pw1i) (4viii pw1i) (3viii pw1i) (2viii pw1i) (1viii pw1i)
   (9ix pw1i) (8ix pw1i) (7ix pw1i) (6ix pw1i) (5ix pw1i) (4ix pw1i) (3ix pw1i) (2ix pw1i) (1ix pw1i)
  )
  (links next-prison
   (pb1ix pb2ix) (pb2ix pb3ix) (pb3ix pb1viii)
   (pb1viii pb2viii) (pb2viii pb3viii) (pb3viii pb1vii)
   (pb1vii pb2vii) (pb2vii pb3vii) (pb3vii pb1vi)
   (pb1vi pb2vi) (pb2vi pb3vi) (pb3vi pb1v)
   (pb1v pb2v) (pb2v pb3v) (pb3v pb1iv)
   (pb1iv pb2iv) (pb2iv pb3iv) (pb3iv pb1iii)
   (pb1iii pb2iii) (pb2iii pb3iii) (pb3iii pb1ii)
   (pb1ii pb2ii) (pb2ii pb3ii) (pb3ii pb1i)
   (pb1i pb2i) (pb2i pb3i)

   (pw1i pw2i) (pw2i pw3i) (pw3i pw1ii)
   (pw1ii pw2ii) (pw2ii pw3ii) (pw3ii pw1iii)
   (pw1iii pw2iii) (pw2iii pw3iii) (pw3iii pw1iv)
   (pw1iv pw2iv) (pw2iv pw3iv) (pw3iv pw1v)
   (pw1v pw2v) (pw2v pw3v) (pw3v pw1vi)
   (pw1vi pw2vi) (pw2vi pw3vi) (pw3vi pw1vii)
   (pw1vii pw2vii) (pw2vii pw3vii) (pw3vii pw1viii)
   (pw1viii pw2viii) (pw2viii pw3viii) (pw3viii pw1ix)
   (pw1ix pw2ix) (pw2ix pw3ix)
 )
 (links to-board
   (pw3i 9ix) (pw2i 9ix) (pw1i 9ix)
   (pw3ii 9ix) (pw2ii 9ix) (pw1ii 9ix)
   (pw3iii 9ix) (pw2iii 9ix) (pw1iii 9ix)
   (pw3iv 9ix) (pw2iv 9ix) (pw1iv 9ix)
   (pw3v 9ix) (pw2v 9ix) (pw1v 9ix)
   (pw3vi 9ix) (pw2vi 9ix) (pw1vi 9ix)
   (pw3vii 9ix) (pw2vii 9ix) (pw1vii 9ix)
   (pw3viii 9ix) (pw2viii 9ix) (pw1viii 9ix)
   (pw3ix 9ix) (pw2ix 9ix) (pw1ix 9ix)

   (pb1i 9i) (pb2i 9i) (pb3i 9i)
   (pb1ii 9i) (pb2ii 9i) (pb3ii 9i)
   (pb1iii 9i) (pb2iii 9i) (pb3iii 9i)
   (pb1iv 9i) (pb2iv 9i) (pb3iv 9i)
   (pb1v 9i) (pb2v 9i) (pb3v 9i)
   (pb1vi 9i) (pb2vi 9i) (pb3vi 9i)
   (pb1vii 9i) (pb2vii 9i) (pb3vii 9i)
   (pb1viii 9i) (pb2viii 9i) (pb3viii 9i)
   (pb1ix 9i) (pb2ix 9i) (pb3ix 9i)
  )
  (symmetry White (to-prison to-white-prison))
  (symmetry White (n s)(s n) (nw sw)(sw nw) (ne se)(se ne))
  (zone
   (name play-zone)
   (players White Black)
   (positions (ranki) (rankii) (rankiii) (rankiv-vi) (rankvii) (rankviii) (rankix))
  )
  (zone
   (name promotion-zone)
   (players Black)
   (positions (ranki) (rankii) (rankiii))
  )
  (zone
   (name promotion-zone)
   (players White)
   (positions (rankvii) (rankviii) (rankix))
  )
  (zone
   (name prison-zone)
   (players Black)
   (positions (bprison))
  )
  (zone
   (name prison-zone)
   (players White)
   (positions (wprison))
  )
  (zone
   (name drop-pawn-zone) ; lance also
   (players Black)
   (positions (rankii) (rankiii) (rankiv-vi) (rankvii) (rankviii) (rankix))
  )
  (zone
   (name drop-pawn-zone) ; lance also
   (players White)
   (positions (ranki) (rankii) (rankiii) (rankiv-vi) (rankvii) (rankviii))
  )
  (zone
   (name drop-knight-zone)
   (players Black)
   (positions (rankiii) (rankiv-vi) (rankvii) (rankviii) (rankix))
  )
  (zone
   (name drop-knight-zone)
   (players White)
   (positions (ranki) (rankii) (rankiii) (rankiv-vi) (rankvii))
  )
 )
 (board-setup
  (White (Pawn (rankiii))
   (Lance 9i 1i)
   (Knight 8i 2i)
   (Silver 7i 3i)
   (Gold 6i 4i)
   (Bishop 2ii)
   (Rook 8ii)
   (King 5i)
  )
  (Black (Pawn (rankvii))
   (Lance 9ix 1ix)
   (Knight 8ix 2ix)
   (Silver 7ix 3ix)
   (Gold 6ix 4ix)
   (Bishop 8viii)
   (Rook 2viii)
   (King 5ix)
  )
 )
 (piece
  (name Pawn)
  (image
   White "images\Shogi\SHaag\PawnFlip.bmp" "images\Shogi\IntlSHaag\PawnFlip.bmp" "images\Shogi\PawnFlip.bmp"
   Black "images\Shogi\SHaag\Pawn.bmp" "images\Shogi\IntlSHaag\Pawn.bmp" "images\Shogi\Pawn.bmp" )
  (help "Pawn (Fuhyo): steps 1 square straight ahead")
  (description
   "Pawn (Fuhyo)\A Pawn moves a single square forward at a time.
   It captures forward, just like it moves. When it promotes it moves like a Gold General."
  )
  (moves
   (move-type with-king)
   (shiftP n Tokin drop-pawn-zone)
   (drop-pawn)
  )
 )
 (piece
  (name Tokin)
  (image
   White "images\Shogi\SHaag\PawnPFlip.bmp" "images\Shogi\IntlSHaag\PawnPFlip.bmp" "images\Shogi\PawnPFlip.bmp"
   Black "images\Shogi\SHaag\PawnP.bmp" "images\Shogi\IntlSHaag\PawnP.bmp" "images\Shogi\PawnP.bmp")
  (help "Tokin: steps 1 square in any direction except diagonally backwards")
  (description
   "Promoted Pawn (Tokin)\
   A Tokin moves in the same way a Gold General does,
   i.e. a single step in any direction except diagonally backwards."
  )
  (moves ; like a Gold General
   (move-type no-king)
   (shift nw)
   (shift n)
   (shift ne)
   (shift e)
   (shift w)
   (shift s)
   (drop-pawn)
  )
 )
 (piece
  (name Lance)
  (image
    White "images\Shogi\SHaag\LanceFlip.bmp" "images\Shogi\IntlSHaag\LanceFlip.bmp" "images\Shogi\LanceFlip.bmp"
    Black "images\Shogi\SHaag\Lance.bmp" "images\Shogi\IntlSHaag\Lance.bmp" "images\Shogi\Lance.bmp")
  (help "Lance (Kyosha): slides straight ahead any number of squares")
  (description
   "Lance (Kyosha)\
    A Lance moves any number of squares, but only directly forward.
    When it promotes it moves like a Gold General."
  )
  (moves
   (move-type no-king)
   (slideP n Promoted-Lance drop-pawn-zone)
   (drop drop-pawn-zone)
  )
 )
 (piece
  (name Promoted-Lance)
  (image
   White "images\Shogi\SHaag\LancePFlip.bmp" "images\Shogi\IntlSHaag\LancePFlip.bmp" "images\Shogi\LancePFlip.bmp"
    Black "images\Shogi\SHaag\LanceP.bmp" "images\Shogi\IntlSHaag\LanceP.bmp" "images\Shogi\LanceP.bmp")
  (help "Promoted Lance (Nari-Kyo): steps 1 square in any direction except diagonally backwards")
  (description
   "Promoted Lance (Nari-Kyo)\
   A promoted Lance moves in the same way a Gold General does,
   i.e. a single step in any direction except diagonally backwards."
  )
  (moves ; like a Gold General
   (move-type no-king)
   (shift nw)
   (shift n)
   (shift ne)
   (shift e)
   (shift w)
   (shift s)
   (drop play-zone)
  )
 )
 (piece
  (name Knight)
  (image
    White "images\Shogi\SHaag\KnightFlip.bmp" "images\Shogi\IntlSHaag\KnightFlip.bmp" "images\Shogi\KnightFlip.bmp"
    Black "images\Shogi\SHaag\Knight.bmp" "images\Shogi\IntlSHaag\Knight.bmp" "images\Shogi\Knight.bmp")
  (help "Knight (Keima): hops ahead 2 squares and either left or right 1 square")
  (description
   "Knight (Keima)\
   A Shogi Knight hops over pieces as in Western Chess, but it is limited to forward motion:
   it leaps forward two squares and over one square to the left or right.
   When it promotes it moves like a Gold General."
  )
  (moves
   (move-type no-king)
   (shift2P n nw Promoted-Knight drop-knight-zone)
   (shift2P n ne Promoted-Knight drop-knight-zone)
   (drop drop-knight-zone)
  )
 )
 (piece
  (name Promoted-Knight)
  (image
   White "images\Shogi\SHaag\KnightPFlip.bmp" "images\Shogi\IntlSHaag\KnightPFlip.bmp" "images\Shogi\KnightPFlip.bmp"
    Black "images\Shogi\SHaag\KnightP.bmp" "images\Shogi\IntlSHaag\KnightP.bmp" "images\Shogi\KnightP.bmp")
  (help "Promoted Knight (Nari-Kei): steps 1 square in any direction except diagonally backwards")
  (description
   "Promoted Knight (Nari-Kei)\
   A promoted Knight moves in the same way a Gold General does,
   i.e. a single step in any direction except diagonally backwards."
  )
  (moves ; like a Gold General
   (move-type no-king)
   (shift nw)
   (shift n)
   (shift ne)
   (shift e)
   (shift w)
   (shift s)
   (drop drop-knight-zone)
  )
 )
 (piece
  (name Silver)
  (image
    White "images\Shogi\SHaag\SilverFlip.bmp" "images\Shogi\IntlSHaag\SilverFlip.bmp" "images\Shogi\SilverFlip.bmp"
   Black "images\Shogi\SHaag\Silver.bmp" "images\Shogi\IntlSHaag\Silver.bmp" "images\Shogi\Silver.bmp")
  (help "Silver General (Ginsho): steps 1 square diagonally or straight ahead")
  (description
   "Silver General (Ginsho or `Gin` for short)\
   A Silver General moves a single step straight ahead or diagonally.
   When it promotes it moves like a Gold General."
  )
  (moves
   (move-type no-king)
   (shiftP nw Promoted-Silver play-zone)
   (shiftP n Promoted-Silver play-zone)
   (shiftP ne Promoted-Silver play-zone)
   (shiftP sw Promoted-Silver play-zone)
   (shiftP se Promoted-Silver play-zone)
   (drop play-zone)
  )
 )
 (piece
  (name Promoted-Silver)
  (image
   White "images\Shogi\SHaag\SilverPFlip.bmp" "images\Shogi\IntlSHaag\SilverPFlip.bmp" "images\Shogi\SilverPFlip.bmp"
   Black "images\Shogi\SHaag\SilverP.bmp" "images\Shogi\IntlSHaag\SilverP.bmp" "images\Shogi\SilverP.bmp")
  (help "Promoted Silver (Nari-Gin): steps 1 square in any direction except diagonally backwards")
  (description
   "Promoted Silver General(Nari-Gin)\
   A promoted Silver General moves in the same way a Gold General does,
   i.e. a single step in any direction except diagonally backwards."
  )
  (moves
   (move-type no-king)
   (shift nw)
   (shift n)
   (shift ne)
   (shift e)
   (shift w)
   (shift s)
   (drop play-zone)
  )
 )
 (piece
  (name Gold)
  (image
   White "images\Shogi\SHaag\GoldFlip.bmp" "images\Shogi\IntlSHaag\GoldFlip.bmp" "images\Shogi\GoldFlip.bmp"
   Black "images\Shogi\SHaag\Gold.bmp" "images\Shogi\IntlSHaag\Gold.bmp" "images\Shogi\Gold.bmp")
  (help "Gold General (Kinsho): steps 1 square in any direction except diagonally backwards")
  (description
   "Gold General (Kinsho)\
   A Gold General moves a single step in any direction except diagonally backwards.
   It does not promote."
  )
  (moves
   (move-type no-king)
   (shift nw)
   (shift n)
   (shift ne)
   (shift e)
   (shift w)
   (shift s)
   (drop play-zone)
  )
 )
 (piece
  (name Bishop)
  (image
    White "images\Shogi\SHaag\BishopFlip.bmp" "images\Shogi\IntlSHaag\BishopFlip.bmp" "images\Shogi\BishopFlip.bmp"
    Black "images\Shogi\SHaag\Bishop.bmp" "images\Shogi\IntlSHaag\Bishop.bmp" "images\Shogi\Bishop.bmp")
  (help "Bishop (Kakugyo): slides diagonally any number of squares")
  (description
   "Bishop (Kakugyo or `Kaku` for short)\
   A Shogi Bishop moves exactly as in chess,
   i.e. any number of squares on a diagonal. It may not leap over other pieces.
   When it promotes it gains a single step up, down, left, or right."
  )
  (moves
   (move-type no-king)
   (slideP ne Promoted-Bishop play-zone)
   (slideP nw Promoted-Bishop play-zone)
   (slideP se Promoted-Bishop play-zone)
   (slideP sw Promoted-Bishop play-zone)
   (drop play-zone)
  )
 )
 (piece
  (name Promoted-Bishop)
  (image
    White "images\Shogi\SHaag\BishopPFlip.bmp" "images\Shogi\IntlSHaag\BishopPFlip.bmp" "images\Shogi\BishopPFlip.bmp"
    Black "images\Shogi\SHaag\BishopP.bmp" "images\Shogi\IntlSHaag\BishopP.bmp" "images\Shogi\BishopP.bmp")
  (help "Promoted Bishop (Ryuma): makes a Bishop move or steps 1 square orthoganolly.")
  (description
   "Promoted Bishop (Ryuma or `Dragon Horse`)\
   Moves any number of squares diagonally,
   or makes a single step orthogonally along a rank or file.
   It may not leap over other pieces."
  )
  (moves
   (move-type no-king)
   (slide ne)
   (slide nw)
   (slide se)
   (slide sw)
   (shift n)
   (shift s)
   (shift e)
   (shift w)
   (drop play-zone)
  )
 )
 (piece
  (name Rook)
  (image
    White "images\Shogi\SHaag\RookFlip.bmp" "images\Shogi\IntlSHaag\RookFlip.bmp" "images\Shogi\RookFlip.bmp"
    Black "images\Shogi\SHaag\Rook.bmp" "images\Shogi\IntlSHaag\Rook.bmp" "images\Shogi\Rook.bmp")
  (help "Rook (Hisha): slides any number of squares along the row or column.")
  (description
   "Rook (Hisha)\
   A Shogi Rook moves exactly as in chess,
   i.e. any number of squares on a rank or a file.
   It may not leap over other pieces.
   When it promotes it gains a single step diagonally."
  )
  (moves
   (move-type no-king)
   (slideP n Promoted-Rook play-zone)
   (slideP s Promoted-Rook play-zone)
   (slideP e Promoted-Rook play-zone)
   (slideP w Promoted-Rook play-zone)
   (drop play-zone)
  )
 )
 (piece
  (name Promoted-Rook)
  (image
    White "images\Shogi\SHaag\RookPFlip.bmp" "images\Shogi\IntlSHaag\RookPFlip.bmp" "images\Shogi\RookPFlip.bmp"
    Black "images\Shogi\SHaag\RookP.bmp" "images\Shogi\IntlSHaag\RookP.bmp" "images\Shogi\RookP.bmp")
  (help "Promoted Rook (Ryu-O): makes a Rook move or steps 1 square diagonally.")
  (description
   "Promoted Rook (Ryu-O or `Dragon King`)\
   Moves any number of squares orthogonally on a rank or a file,
   or makes a single step diagonally to an adjacent square.
   It may not leap over other pieces."
  )
  (moves
   (move-type no-king)
   (slide n)
   (slide s)
   (slide e)
   (slide w)
   (shift nw)
   (shift ne)
   (shift sw)
   (shift se)
   (drop play-zone)
  )
 )
 (piece
  (name King)
  (image
   White "images\Shogi\SHaag\KingFlip.bmp" "images\Shogi\IntlSHaag\KingFlip.bmp" "images\Shogi\KingFlip.bmp"
   Black "images\Shogi\SHaag\King.bmp" "images\Shogi\IntlSHaag\King.bmp" "images\Shogi\King.bmp")
  (help "King (Gyokusho): steps 1 square in any direction to a safe square")
  (description
   "King (Gyokusho)\
   A Shogi King can take a single step in any direction, just as in Western Chess.
   It does not promote.
   The King may not allow itself to move where it can be taken by the opponent.
   The object of Shogi is to checkmate the enemy King."
  )
  (moves
   (move-type with-king)
   (shift nw)
   (shift n)
   (shift ne)
   (shift e)
   (shift w)
   (shift sw)
   (shift se)
   (shift s)
  )
 )
 (loss-condition (White Black) (checkmated King) )
)

最終更新:2019年02月09日 12:38