(define "ThrowValue" (mapEntry "Throw" (count Pips))) (define "SpecialThrows" (is In ("ThrowValue") (sites {4 5}))) (define "NextSiteFrom" ("NextSiteOnTrack" #3 from:#1 #2)) (define "Move" (or (forEach Piece top:True) (forEach Piece container:(mover) top:True)) ) (define "MoveOnTrack" (if (is In (from) (sites Track #2 #1)) (forEach Value (values Remembered "Throws") (or (if ("IsOffBoard" ("NextSiteFrom" (from) #1 (value))) (do (forget Value "Throws" (value)) next:(move Remove (from) level:(level)) ) ) (move (from (from) level:(level)) (to ("NextSiteFrom" (from) #1 (value)) if:("NoEnemyOrOnlyOne" (to)) (apply (and (if ("IsEnemyAt" (to)) (fromTo (from (to)) (to (handSite (who at:(to)))) ) ) (forget Value "Throws" (value)) ) ) ) (then (if (and (!= (last From) (handSite Mover)) (is Occupied (last From))) (forEach Level (last From) FromTop (fromTo (from (last From) level:(level)) (to (last To)) ) ) ) ) ) (then (if (!= 0 (size Array (values Remembered "Throws"))) (moveAgain))) ) ) ) ) //------------------------------------------------------------------------------ (game "Nyout" (players ) (equipment { (board (concentric {1 -4 -4 20}) { (track "HorizontalTrack" {13 5 1 0 3 7 23..28} directed:True) (track "VerticalTrack" {18 6 2 0 4 8 28} directed:True) } use:Vertex ) (piece "Counter" Each (or { ("MoveOnTrack" "Track" Mover) ("MoveOnTrack" "HorizontalTrack") ("MoveOnTrack" "VerticalTrack") }) ) (dice d:2 from:0 num:4) (hand Each) (map "Throw" {(pair 0 4) (pair 1 3) (pair 2 2) (pair 3 1) (pair 4 5)}) }) (rules (start { }) phases:{ (phase "Throwing" (play ("RollMove" (move Pass (then (remember Value "Throws" ("ThrowValue")))) (then (moveAgain)) ) ) (nextPhase Mover (not ("SpecialThrows")) "Moving") ) (phase "Moving" (play (if (can Move ("Move")) ("Move") (move Pass (then (forget Value "Throws" All))) ) ) (nextPhase Mover (= 0 (size Array (values Remembered "Throws"))) "Throwing") ) } (end ("EscapeTeamWin")) ) ) //------------------------------------------------------------------------------ (option "Players" args:{ } { (item "2 (one piece)" <2> < (track "Track1" {29 9..28} P1 directed:True) (track "Track2" {30 9..28} P2 directed:True) > < (set Team 1 {P1}) (set Team 2 {P2}) (place Stack "Counter1" (handSite P1) count:1) (place Stack "Counter2" (handSite P2) count:1) > "2 players involved with one piece per player.") (item "2 (four pieces)" <2> < (track "Track1" {29 9..28} P1 directed:True) (track "Track2" {30 9..28} P2 directed:True) > < (set Team 1 {P1}) (set Team 2 {P2}) (place Stack "Counter1" (handSite P1) count:4) (place Stack "Counter2" (handSite P2) count:4) > "2 players involved with four pieces per player.")* (item "3" <3> < (track "Track1" {29 9..28} P1 directed:True) (track "Track2" {30 9..28} P2 directed:True) (track "Track3" {31 9..28} P3 directed:True) > < (set Team 1 {P1}) (set Team 2 {P2}) (set Team 3 {P3}) (place Stack "Counter1" (handSite P1) count:3) (place Stack "Counter2" (handSite P2) count:3) (place Stack "Counter3" (handSite P3) count:3) > "3 players involved.") (item "4" <4> < (track "Track1" {29 9..28} P1 directed:True) (track "Track2" {30 9..28} P2 directed:True) (track "Track3" {31 9..28} P3 directed:True) (track "Track4" {32 9..28} P4 directed:True) > < (set Team 1 {P1 P3}) (set Team 2 {P2 P4}) (place Stack "Counter1" (handSite P1) count:4) (place Stack "Counter2" (handSite P2) count:4) (place Stack "Counter3" (handSite P3) count:4) (place Stack "Counter4" (handSite P4) count:4) > "4 players involved.") }) //------------------------------------------------------------------------------ (rulesets { (ruleset "Ruleset/Nyout (Described)" { "Players/2 (four pieces)" } variations:{"Players/2 (one piece)"} )* (ruleset "Ruleset/Four players. (Described)" { "Players/3" }) (ruleset "Ruleset/Three players (Described)" { "Players/4" }) }) //------------------------------------------------------------------------------ (metadata (info { (description "Nyout is a race game played in Korea in the nineteenth century. It was described as the most popular game in Korean at the time by Culin, and is played by two to four players.") (aliases {"Nyout-Nol-Ki"}) (useFor "Ruleset/Nyout (Described)" (rules "Twenty small circles arranged in a large circle, with a cross of nine more circles in the center of the large circle. The central circle and the circles where the crosses meet the larger circle are larger than the others. Two players play with either one or four pieces each. Four stick dice with a white and a black side, with the following values for the throws: four white sides up = 4; four black sides up = 5; three white sides up = 3, two white sides up = 2, one white side up = 1. Throws of 4 and 5 allow the player another throw, pieces being moved after all of the player's throws. Pieces enter the board on the spot to the left of the topmost position of the circle, and proceed around the circle in an anti-clockwise direction. If a piece lands on one of the spaces where the central cross meets the circle, the piece may proceed along the cross to the opposite side on the next turn. A piece may not turn and move along a cross if it does not land on the end of the cross at the end of a throw. Pieces proceed to the topmost space, and move off the board by throwing one or more than required to land on this space. When a player lands on the same spot as one of their own pieces, these may be moved together as one piece. When a player lands on an opponent's piece, the opponent's piece is sent back to the start. The first player to remove all of their pieces from the board wins.")) (useFor "Ruleset/Nyout (Described)" (source "Culin 1895: 66-70.")) (useFor "Ruleset/Nyout (Described)" (id "203")) (useFor "Ruleset/Three players (Described)" (rules "Three players. Three pieces per player.")) (useFor "Ruleset/Three players (Described)" (source "Culin 1895: 68.")) (useFor "Ruleset/Three players (Described)" (id "675")) (useFor "Ruleset/Four players. (Described)" (rules "Four players, on two teams. Four pieces per player.")) (useFor "Ruleset/Four players. (Described)" (source "Cu;in 1895: 68.")) (useFor "Ruleset/Four players. (Described)" (id "677")) (source "Murray 1951: 142") (id "203") (version "1.3.12") (classification "board/race/escape") (credit "Eric Piette") (origin "This game was played in Korea, around 1895.") } ) (graphics { (show Edges Hidden) (show Symbol "disc" Vertex (difference (sites Board) (union {(sites Centre) (sites Top) (sites Bottom) (sites Left) (sites Right)})) fillColour:(colour White) edgeColour:(colour Black) scale:0.5) (show Symbol "disc" Vertex (union {(sites Centre) (sites Top) (sites Bottom) (sites Left) (sites Right)}) fillColour:(colour White) edgeColour:(colour Black) scale:0.8) (piece Colour "Die" state:1 fillColour:(colour Black)) (stackType Count) }) )