(define "IsUnpromoted" ("IsPieceAt" "Counter" Mover (last To))) //------------------------------------------------------------------------------ (game "Brazilian Draughts" (players 2) ("DraughtsEquipment" (square 8)) (rules ("BlackCellsSetup" 3) (play (if "SameTurn" (if "IsUnpromoted" (max Moves ("HopInternationalDraughtsStyle" (from (last To)) (then ("ReplayIfCanMove" ("HopInternationalDraughtsStyle" (from (last To))) ("PromoteIfReach" (sites Next) "DoubleCounter") ) ) ) ) (max Moves ("HopDiagonalSequenceCaptureAgain" before:(count Rows) after:(count Rows) at:EndOfTurn)) ) (priority { (max Moves (or (forEach Piece "Counter" ("HopInternationalDraughtsStyle" (from) (then ("ReplayIfCanMove" ("HopInternationalDraughtsStyle" (from (last To))) ("PromoteIfReach" (sites Next) "DoubleCounter") ) ) ) ) (forEach Piece "DoubleCounter" ("HopDiagonalSequenceCapture" before:(count Rows) after:(count Rows) at:EndOfTurn)) ) ) (or (forEach Piece "Counter" ("StepToEmpty" (directions {FR FL})) (then ("PromoteIfReach" (sites Next) "DoubleCounter")) ) (forEach Piece "DoubleCounter" (move Slide Diagonal)) ) }) ) ) (end ("BlockWin")) ) ) //------------------------------------------------------------------------------ (metadata (info { (description "Brazilian Draughts is played in Brazil, and seems to have been invented and popularised in the late nineteenth or early twentieth century there, though its exact origins are not well documented.") (rules "Played on an 8x8 board with 12 pieces per side. Pieces move one space diagonally. Capturing occurs when an opponent's piece is adjacent to a player's piece and there is an open space on the other side of the opponent and the player's piece jumps the opponent's. Capturing can happen either forwards or backwards. Capturing must happen if it is possible. Multiple jumps can be made in a turn, and the maximum number of jumps must be made. Pieces become kings when they reach the opposite side of the board from which they started at the end of its turn. Kings can move multiple spaces in one direction.") (source "Wikipedia") (id "53") (version "1.3.14") (classification "board/war/leaping/diagonal") (credit "Eric Piette") } ) (graphics { (board Style Chess) (piece Families {"Defined" "Isometric"}) }) (ai "Brazilian Draughts_ai" ) )