(define "MoveStack" (move (from (forEach (sites Occupied by:Mover) if:(all Groups Cell Orthogonal of:(and (not (is Empty (to))) (!= (to) (site))) if:(= (count Sites in:(sites)) (- (count Sites in:(sites Occupied by:All)) 1)) ) ) ) (to (intersection (sites Around (from)) (sites Occupied by:Next)) if:(<= (+ (size Stack at:(to)) (size Stack at:(from))) 3) ) stack:True (then (and ("ComputeScore" P1 P2) ("ComputeScore" P2 P1) ) ) ) ) (define "MoveAdd" (move Add (to (sites Empty) if:(> (count Sites in:(intersection (sites Around (to)) (sites Occupied by:All)) ) 0 ) ) (then (and ("ComputeScore" P1 P2) ("ComputeScore" P2 P1) ) ) ) ) (define "CountStacks" (count Sites in:(forEach (sites Occupied by:#1) if:(and (>= (count Sites in:(intersection (sites Around (site)) (sites Occupied by:#2) ) ) 1 ) (= (size Stack at:(site)) #3) ) ) ) ) (define "ComputeScore" (set Score #1 (+ { (* ("CountStacks" #1 #2 1) 1) (* ("CountStacks" #1 #2 2) 2) (* ("CountStacks" #1 #2 3) 3) }) ) ) //------------------------------------------------------------------------- (game "Abande" (players 2) (equipment { (board (hex 4)) (piece "Disc" Each) }) (rules (play (if (= (count Moves) 0) (move Add (to (sites Empty)) (then (and ("ComputeScore" P1 P2) ("ComputeScore" P2 P1) ) ) ) (if (< (count Pieces Mover) 18) (or { ("MoveAdd") ("MoveStack") }) (or { (move Pass) ("MoveStack") }) ) ) ) (end { (if (all Passed) (byScore)) }) ) ) //------------------------------------------------------------------------- (metadata (info { (description "Abande is either player on a 7x7 square board or on a hexagonal board of side 4.") (rules "Abande is a two-player game played on a hexagonal board with 37 spaces. Each player has 18 pieces in either white or black. The game begins with the white player placing a piece on the board, and players take turns making either an initiative move (placing a new piece) or a regular move (moving a piece or stack on top of an adjacent opponent piece or stack). All pieces on the board must be connected in a single band. Pieces or stacks move one space in any of the six directions and capture by moving on top of an opponent piece or stack. Stacks cannot grow larger than 3 pieces high and cannot be split. Passing a turn is allowed only if a player has no more pieces in hand. The game ends when both players pass their turn in sequence. Before scoring, pieces or stacks with no connection to an opponent piece are removed. Players earn points for single pieces, double stacks, and triple stacks, with the player with the higher score winning the game. If both players have the same score, the game is a draw.") (id "4256") (source "The World of Abstract Games") (version "1.3.14") (classification "board/space/group") (author "Dieter Stein") (credit "Achille Morenville") (date "2005") } ) )