Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (define "IsFriendlyWorkerAt"
- (and
- (is Friend (who at:#1 #2))
- ("IsPieceAt" "Soldier" Mover #1)
- )
- )
- (define "IsFriendlyBaseAt"
- (and
- (is Friend (who at:#1 #2))
- ("IsPieceAt" "Base" Mover #1)
- )
- )
- (define "Produce"
- (and
- (custodial
- (from (last To))
- (between
- (max 1)
- if:(is Empty (between))
- (apply (add (piece (id "Base" Mover)) (to (between))))
- )
- (to if:("IsFriendlyWorkerAt" (to)))
- )
- (custodial
- (from (last To))
- (between
- (max 1)
- if:(is Empty (between))
- (apply (add (piece (id "Soldier" Mover)) (to (between))))
- )
- (to if:("IsFriendlyBaseAt" (to)))
- )
- )
- )
- (define "AheadSite" (ahead (from) #1 (directions Vertex from:(from) to:(to))))
- (define "AheadSiteList1" { ("AheadSite" steps:1) } )
- (define "AheadSiteList2" { ("AheadSite" steps:1) ("AheadSite" steps:2) } )
- (define "AheadSiteList3" { ("AheadSite" steps:1) ("AheadSite" steps:2) ("AheadSite" steps:3) } )
- (define "AheadSiteList4" { ("AheadSite" steps:1) ("AheadSite" steps:2) ("AheadSite" steps:3) ("AheadSite" steps:4) } )
- (game "Workers and Soldiers"
- (players {(player N) (player S)})
- (equipment {
- (board (square 6))
- (piece "Soldier" Each
- (or {
- (move Hop
- All
- (between
- (max (count Rows))
- if:(or {
- (is Empty (between))
- ("IsPieceAt" "Soldier" Mover (between))
- ("IsPieceAt" "Shooter" Mover (between))
- } )
- )
- (to
- if:(is Empty (to))
- )
- (then "Produce")
- )
- (forEach Direction
- All
- (if (and (>= (count Pieces Mover in:"AheadSiteList1") 1) (= (count Pieces Next in:"AheadSiteList1") 0)) (move (from (from)) (to if:(is Empty (to)) ("AheadSite" 2))))
- )
- } )
- )
- (piece "Shooter" Each
- (move Slide
- (to
- if:(is Enemy (who at:(to)))
- (apply (remove (to)))
- )
- )
- )
- (piece "Base" Each)
- (hand Each size:2)
- })
- (rules
- (start {
- (place "Soldier" "Hand" count:2)
- })
- (play
- (or
- (forEach Piece)
- (move
- (from (sites Occupied by:Mover container:"Hand"))
- (to (sites Empty))
- (then "Produce")
- )
- (then
- (if (is Even (count Moves))
- (moveAgain)
- )
- )
- )
- )
- (end {
- (if (no Moves P1) (result P2 Win))
- (if (no Moves P2) (result P1 Win))
- })
- )
- )
- //------------------------------------------------------------------------------
- (metadata
- (info
- {
- (description "Ultimately originates from Indian Chaturanga, arrived in Western Europe during the Middle Ages as Shatranj. Over several centuries, after seeming experimentation with movement, the adoption of the modern movement of the queen and bishop made chess what it is today. Modern Chess appeared sometimes during the fourteenth or fifteenth Century, when the vizier piece was replaced by the queen. It since has become perhaps the most popular game in the world, with massive international competitions.")
- (aliases {"Mad Queen's Chess" "Queen's Chess" "�checs" "Schach" "Ajedrez" "Xadrez" "Scacchi"})
- (rules "Played on an 8x8 board with pieces with specialized moves: Pawns (8): can move one space forward; Rooks (2): can move any number of spaces orthogonally; Bishops (2): can move any number of spaces diagonally; Knight (2): moves in any direction, one space orthogonally with one space forward diagonally; Queens (1): can move any number of spaces orthogonally or diagonally; Kings (1): can move one space orthogonally or diagonally. Players capture pieces by moving onto a space occupied by an opponent's piece. Player wins when they capture the other player's king.")
- (source "<a href=\"https://en.wikipedia.org/wiki/Rules_of_chess\" target=\"_blank\" class=\"style1\" style=\"color: #0000EE\" />Wikipedia</a>")
- (version "1.3.0")
- (classification "board/war/replacement/checkmate/chess")
- (credit "Eric Piette")
- (origin "This game was played in Europe, around 1512.")
- }
- )
- (graphics {
- (piece Families {"Defined" "Microsoft" "Pragmata" "Symbola"})
- (board Style Chess)
- })
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement