Craps

In the simplified version of the game Craps, the player repeatedly rolls two die. If he rolls a seven on the first roll, the game ends and he wins. Otherwise, the sum of the die becomes his "point to make." The player rolls again and again until 1) either the sum of the die equals the point, and the player wins; 2) or the sum of the die is seven and the player loses. The next roll after a game ends becomes the first roll of a new game.

Create a JSP page called craps.jsp. Assume a random generator in stored in the implicit application object. If this isn't true, create one and store it there. Use the generator to generate two random integers between 1 and 6. Display these numbers in HTML and compute their sum. Call the sum roll.

Assume an Integer named point is stored in the implicit session object. If this isn't true, it means this is the start of a new game. If roll is seven, congratulate the player, otherwise store roll as the point.

If point is defined, then if roll is seven, give your condolences to the player and remove point from the session object. This will signify the start of a new game. If point is equal to roll, congratulate the player and start a new game. Otherwise, tell the player to roll again.

The bottom of craps.jsp should contain a form containing a single submit button titled "Roll".