Craps
Craps is a popular Las
Vegas game of dice in which a designated player rolls
two die one or more times. After each roll the sum of the die is computed. If
the sum is 2, 3, or 12, the game ends and the player loses. If the sum is 7 or
11 on the first roll, the game is over and the player wins. However, if 7 or 11
comes up on a subsequent roll, the game is over and the player loses. If the
sum of the first roll is 4, 5, 6, 8, 9, or 10, then this number is called the
point. If the player rolls the point on a subsequent roll, then the game ends
and the player wins. In other words, the goal of craps is to roll the point
before losing.
Implement a computer craps game:
class TestCrapsGame {
public static void main(String[] args)
{
CrapsGame game = new CrapsGame();
game.play();
}
}