(define "IfEnemyBlotIt" ("HittingCapture" (mapEntry (next))))
(define "BarEmpty" (is Empty "Bar"))
(define "NextSiteFrom" ("NextSiteOnTrack" (pips) from:#1))
(define "Bar" (mapEntry (mover)))
(define "AllPieceInHome" ("AllOwnedPiecesIn" (sites Mover)))
(define "RemoveAPiece" (move Remove (site)))
(define "DieNotUsedAndNoEscapeAndNotOffTheTrack"
(and {
("DieNotUsed")
("IsNotOffBoard" ("NextSiteFrom" (from)))
("IsNotEndTrack" ("NextSiteFrom" (from)))
})
)
(define "MoveAPiece"
(move
(from #1)
(to
("NextSiteFrom" #1)
if:("NoEnemyOrOnlyOne" (to))
("IfEnemyBlotIt")
)
)
)
(define "MoveAPieceIf"
(forEach Die
replayDouble:True
if:#1
("MoveAPiece" #2)
)
)
(define "AllPieceEscaped" (no Pieces Mover))
(define "NumPiece" (size Stack in:(sites Occupied by:#1)))
(define "CanEscape" ("IsEndTrack" ("NextSiteFrom" (site))))
(define "NotEmptyAndNotOffTheBoard"
(and
(is Occupied (site))
("IsNotOffBoard" ("NextSiteFrom" (site)))
)
)
(define "SetScoreOf"
(set Score
#1
(if (is Mover #1)
(if
(= ("NumPiece" #2) 15)
2
1
)
0
)
)
)
(define "HaveAPieceAndCanEscape"
(and
("IsFriendAt" (site))
(< ("NextSiteOnTrack" (pips) from:(site)) 0)
)
)
//-----------------------------------------------------------------------------
(game "Frangieh"
(players 2)
(equipment {
("BackgammonBoard" ("BackgammonTracksWithBar" End))
(dice num:2)
(regions P1 { 20..25 }) // P1 Home
(regions P2 { 7..12 }) // P2 Home
(map {(pair 1 6) (pair 2 19)}) // Bar
(piece "Disc" Each ("MoveAPieceIf" "DieNotUsedAndNoEscapeAndNotOffTheTrack" (from)))
})
(rules
(start {
(place Stack "Disc1" 0 count:5) (place Stack "Disc1" 12 count:2)
(place Stack "Disc1" 17 count:3) (place Stack "Disc1" 20 count:5)
(place Stack "Disc2" 4 count:3) (place Stack "Disc2" 7 count:5)
(place Stack "Disc2" 13 count:5) (place Stack "Disc2" 25 count:2)
})
(play
("RollEachNewTurnMove"
(if "AllPieceInHome"
(forEach Die
replayDouble:True
if:("DieNotUsed")
(forEach Site
(sites Occupied by:Mover)
(if ("NotEmptyAndNotOffTheBoard")
(if ("CanEscape")
("RemoveAPiece")
("MoveAPiece" (site))
)
)
noMoveYet:(firstMoveOnTrack "Track" Mover
(if "HaveAPieceAndCanEscape"
"RemoveAPiece"
)
)
(then ("ReplayNotAllDiceUsed"))
)
)
(if "BarEmpty"
(forEach Piece top:True)
("MoveAPieceIf" ("DieNotUsed") ("Bar"))
(then
(if (not (all DiceUsed))
(if (can Move
(if "BarEmpty"
(forEach Piece top:True)
("MoveAPieceIf" ("DieNotUsed") ("Bar"))
)
)
(moveAgain)
)
)
)
)
)
)
)
(end
(if ("AllPieceEscaped")
(result Mover Win)
)
)
)
)
//-------------------------------------------------------------------------
(metadata
(info
{
(description "Frangieh (\"foreign\") is a race game played in Southwest Asia, which is one of a types of games referred to as Tawulat ul-Zahr, which are similar to European Tables and Persian Nard games. This game, which is similar to Backgammon, is considered to be one of the easier versions, and is not favored by experienced players.")
(rules "The game is played on a board with twelve points on either side. The points form a continuous track in a horseshoe shape; each player progresses in opposite directions (one from their bottom right to the top right, the other from their bottom left to their top left. Each player has 15 pieces. The starting position is as such, numbering the points from the origin of each player's track: Point six: five pieces. Point 8: three pieces. Point 13: five pieces. Point 24: two pieces. Play begins by each player rolling one die; the player who rolls the highest plays first, and then rolls again to begin play. Players move according to the number on each die by moving one piece the number on one die and another the number on the other die, or by moving one piece twice (once for each die). If doubles are rolled, the player must play the number on each die twice. Players cannot end their move on a point with multiple opposing pieces. If a player ends the turn on a point with one opposing piece, that piece is placed in the middle of the board (not on a point) and must reenter the board according the the next die roll, counting the origin point as a move of one. They cannot reenter on a point with two or more pieces. No other pieces can move until all of the pieces belonging to that player are removed from the center. When all of a player's pieces are on their final six points, they may start removing pieces from the board. They can do so by rolling a 6 to move from the 6th point, and so on down to 1. Players must use all available moves presented by the dice. The first player to remove all of their pieces wins.
")
(source "Barakat 1974: 12-16.")
(id "1060")
(version "1.3.12")
(classification "board/race/escape")
(credit "Eric Piette")
(origin "This game was played in Southwest Asia, around 1974.")
}
)
(graphics {
(board Style backgammon)
(stackType Backgammon)
})
)