解説:relative-config

 特定の駒が特定の配置になっている場合、ゲームを終了します。
 絶対的な駒の場所を目標とする場合→解説:absolute-config

  • (relative-config <check-occupant1>...<check-occupantN>)

 「win-condition」または「draw-condition」または「loss-condition」内で使用します。

①<check-occupant>の内容

  • <direction>
 ある駒が方向<direction>にいる場合

  • <piece-type>
 自分の駒<piece-type>がある方向にいる場合

  • (not <piece-type>)
 自分の駒<piece-type>以外がある方向にいる場合

  • (opponent <piece-type>)
 敵の駒<piece-type>がある方向にいる場合

  • (not (opponent <piece-type>))
 敵の駒<piece-type>以外がある方向にいる場合

  • (any-owner <piece-type>)
 自分または敵の駒<piece-type>がある方向にいる場合

  • (not (any-owner <piece-type>))
 自分または敵の駒<piece-type>以外がある方向にいる場合

  • (win-condition (<player1>...<playerN>) (relative-config X-piece n X-piece n X-piece))

※自分の駒Xの1マス上に自分の駒X、その1マス上に自分の駒Xが並んだプレイヤーは、勝ちになります。
(自分のX-pieceが縦に3個並んだプレイヤーは、勝ちです)

  • (draw-condition (<player1>...<playerN>) (relative-config (any-owner O-piece) ne ne (any-owner O-piece)))

※自分または敵の駒Oの2マス右上に自分または敵の駒Oが並ぶと、引き分けになります。
(自分または敵のO-pieceが1マス空けて右上斜めに2個並ぶと、引き分けです)

  • (loss-condition (<player1>...<playerN>) (relative-config (not King) e (opponent King) e (not King))

※自分のキング以外の駒の1マス右に敵のキング、その1マス右に自分のキング以外の駒が並ぶと、負けになります。
(自分のキング以外の駒で敵のキングを横に挟んだプレイヤーは、負けです)


最終更新:2020年08月20日 15:24