(game "Monty Hall Problem" (players 1) (equipment { (board (rectangle 1 3)) (piece "Car" Shared) (piece "Goat" Shared) }) (rules (start { (place Random {"Car"}) (place Random {"Goat"} count:2) (set Hidden What (sites Board) to:P1) }) phases:{ (phase "Opening" (play (move Select (from (sites Board)) (then (set Hidden What (sites Random (forEach (sites Board) if:(and (!= (site) (last To)) (!= (id "Car" Shared) (what at:(site))) ) ) num:1 ) False to:P1 ) ) ) ) (nextPhase "FinalChoice") ) (phase "FinalChoice" (play (move Select (from (sites Board)) (then (set Hidden What (sites Board) False to:P1) ) ) ) (end { (if ("IsPieceAt" "Car" Shared (last To)) (result P1 Win) ) (if ("IsPieceAt" "Goat" Shared (last To)) (result P1 Loss) ) }) ) } ) ) //------------------------------------------------------------------------------ (metadata (info { (description "The Monty Hall problem is a brain teaser, in the form of a probability puzzle, loosely based on the American television game show Let's Make a Deal and named after its original host, Monty Hall.") (rules "Monty Hall asks to choose one of three doors. One of the doors hides a car and the other two doors have a goat. You select which door you pick, but you don’t open it right away. The game opens one of the other two doors, and there is no prize behind it. At this moment, there are two closed doors. You can keep the same choice or selecting the other door. If you get the car you win if not you loss.") (id "1155") (source "Wikipedia") (version "1.3.14") (classification "puzzle/planning") (author "Steve Selvin") (credit "Eric Piette") (date "1975") } ) (graphics { (no Board) (player Colour Shared (colour Brown)) (hiddenImage "door") }) )