The game of Pig is a very simple dice game in which two players race to reach 50 or 100 points (depends on setting). Each turn, a player repeatedly rolls a die until either a 1 is rolled or the player holds and scores the sum of the rolls (eg. the turn total).
Open-source code by Janis Chan