Sparc
40 Points
Submit Via Easel
Rules for one game of Sparc:
A player rolls two dice.
Each die has six faces. These
faces contain 1, 2, 3, 4, 5 and 6 spots.
After the dice have come to rest, the sum of the spots on the two upward
faces is calculated. If the sum is 7 or
11 on the first throw, the player wins.
If the sum is 2, 3 or 12 on the first throw, the player loses. If the sum is 4, 5, 6, 8, 9 or 10 on the
first throw, then that sum becomes the player’s “point.” To win, you must continue rolling the dice
until you “make your point.” The player
loses by rolling a 7 before making the point.
Your program should:
- Ask
the user how much money they are starting with.
- Ask
for an initial wager. Be sure it is
between 1 and the amount of money the user has.
- Play
one game of sparc. Follow the above rules.
- If the
player wins increment the user’s balance by the wager and print the new
balance.
- If the
player loses, decrease the balance by the wager.
- If the
users balance becomes zero print the message “Sorry, you busted!”
- Allow
the user to wager a new amount if the balance is greater than zero, then
play another game. (back to step 3)
Grading criteria:
- Game
works according to instructions
- Good
user interface, the user can easily tell how to play the game. Use descriptive but brief prompts for
the user to follow.
- Variable
naming
- Use of
constants
- Your
name should be in comments at the top of the file
- Submit
it on Easel before class time on its due date.