Reference no: EM132162986
Use two web pages (php) to allow the user to play simple craps (dice). The first page should represent the first roll using functions to roll each dice (2).
The first page reports on whether the player wins, loses or rolls again. Use a session cookie to record the roll value for the second page.
On the second page, the user rolls again and you should report the win, loss or "roll again", until the user wins or loses. If the user wins or loses, report the result and close the page.
Allow the user to keep rolling until the user wins or loses. Then allow the user to "reset" for a new game.
Your site should use functions and session cookies.
Simplified Rules of Casino Craps
1. To begin, the Shooter (one of the players) must bet at least the table minimum on either the Pass Line or the Don't Pass Line (sometimes called 'win' or 'right' bets and 'don't win' or 'wrong' bets).
2. The game is played in rounds, with the right to roll the dice by each player moving clockwise around the craps table at the end of each round. A player may choose not to roll but can continue to bet.
3. Each round has two phases: Come Out and Point. To start a round, the shooter makes one or more Come Out rolls.
A Come Out roll of 2, 3 or 12 (called Craps, the shooter is said to 'crap out') ends the round with players losing their Pass Line bets. A Come Out roll of 7 or 11 (a Natural) results in a win for Pass Line bets. The shooter continues to make Come Out rolls until he rolls 4, 5, 6, 8, 9, or 10, which number becomes the Point.
The dealer then moves an On button to the point number signifying the second phase of the round. If the shooter rolls the point number, the result is a win for bets on the Pass Line. If the shooter rolls a seven (a Seven-out), the pass line loses and the round ends.