(define "HopMan" (move Hop (from #1) (between if:(and (not (is In (between) (sites ToClear))) ("IsEnemyAt" (between))) (apply (remove (between) at:EndOfTurn)) ) (to if:(is Empty (to))) #2 ) ) (define "IsUnpromoted" ("IsPieceAt" "Counter" Mover (last To))) //------------------------------------------------------------------------------ (game "HexDame" (players 2) (equipment { (board (rotate 90 (hex 5))) (piece "Counter" P1 N) (piece "Counter" P2 S) (piece "DoubleCounter" Each) (regions P1 (union (sites Side SW) (sites Side SE))) (regions P2 (union (sites Side NW) (sites Side NE))) }) (rules (start { (place "Counter1" (expand (sites Bottom) steps:3)) (place "Counter2" (expand (sites Top) steps:3)) }) (play (if "SameTurn" (if "IsUnpromoted" (max Moves ("HopMan" (last To) (then ("ReplayIfCanMove" ("HopMan" (last To)) ("PromoteIfReach" (sites Next) "DoubleCounter") ) ) ) ) (max Moves ("HopSequenceCaptureAgain" before:10 after:10 at:EndOfTurn)) ) (priority { (max Moves (or (forEach Piece "Counter" ("HopMan" (from) (then ("ReplayIfCanMove" ("HopMan" (last To)) ("PromoteIfReach" (sites Next) "DoubleCounter") ) ) ) ) (forEach Piece "DoubleCounter" ("HopSequenceCapture" before:10 after:10 at:EndOfTurn)) ) ) (or (forEach Piece "Counter" ("StepToEmpty" (directions {Forward FL FR})) (then ("PromoteIfReach" (sites Next) "DoubleCounter")) ) (forEach Piece "DoubleCounter" (move Slide)) ) }) ) ) (end ("BlockWin")) ) ) //------------------------------------------------------------------------------ (metadata (info { (description "HexDame is a Draughts game played on a Hex board invented by Christian Freeling in 1979.") (rules "Pieces move one step forward. Otherwise, the rules are the same as International Draughts: Pieces can jump an opponent's adjacent player to capture it. Pieces can move forward or backwards. When a piece reaches the opposite edge of the board from its starting position, it becomes a king and can may move and jump over any number of spaces diagonally. Captures are compulsory and the maximum number of jumps must be made. Winning is achieved by capturing all the opponent's pieces or by blocking them from moving.") (source "Wikipedia") (id "443") (version "1.3.12") (classification "board/war/leaping/orthogonal") (author "Christian Freeling") (credit "Eric Piette") (date "1979") } ) (graphics { (player Colour P2 (colour Red)) (piece Families {"Defined" "Isometric"}) }) (ai "HexDame_ai" ) )