Question: This is assembly programming using Kip Irvine. Please help. Purpose: To use CMP and conditional jumps Overview of Craps The game of craps uses two
This is assembly programming using Kip Irvine. Please help.
Purpose: To use CMP and conditional jumps
Overview of Craps
The game of craps uses two 6-sided dice, where each die contains a number between 1 and 6. The total of the two sides that face up is the total for a roll of the dice.
The first roll that a player throws in Craps has three possible outcomes: they can win, they can lose, or they will continue to roll.
On the first roll, if the player gets a 7 or 11 that is a win.
On the first roll, if the player gets a 2, 3, or 12 that is a loss.
On the first roll, if the player gets anything else (4,5,6,8,9,10) then that is their mark(point) and they need to continue to roll trying to get that mark(point).
Lab 5
Simulate a first roll of two dice in Craps. For each first roll determine if the roll is a Win, a Loss, or a Mark.
Tally the occurrence of each possibility. After the loop, display the counts for each possibility.
Do this for the number of rolls the user wants. (you can assume for this lab they will not enter a number <= 0)
See the Sample Runs next page
Grading Rubric
Prompting user for number of rolls (10 points)
Looping on number of rolls (10 points)
Inside loop:
"rolling" 2 dice (10 points)
Showing the dice and category (Win/Lose/Mark) (10 points)
Incrementing proper counters (15 points)
After loop:
Displaying tallies (10 points)
Comments for: your name up top, comments for each data declaration, and each command (or logical grouping) in main (20 points)
"meaningful variable names" (8 points)
Neat Indenting (body of main neatly indented) (7 points)
Submitting the Lab
Post the source file as a .txt with sample runs (more than 1) commented afterwards to blackboard.
Sample Run:
How many rolls would you like to see: 1
3 + 6 = 9 Mark
Wins: 0
Losses: 0
Marks: 1
Press any key to continue . . .
Another Sample Run:
How many rolls would you like to see: 5
5 + 4 = 9 Mark
6 + 6 = 12 Loss
2 + 5 = 7 Win
3 + 1 = 4 Mark
1 + 3 = 4 Mark
Wins: 1
Losses: 1
Marks: 3
Press any key to continue . . .
Another Sample Run:
How many rolls would you like to see: 15
5 + 3 = 8 Mark
6 + 1 = 7 Win
6 + 5 = 11 Win
4 + 3 = 7 Win
1 + 1 = 2 Loss
3 + 3 = 6 Mark
1 + 6 = 7 Win
2 + 4 = 6 Mark
1 + 6 = 7 Win
5 + 3 = 8 Mark
4 + 2 = 6 Mark
5 + 4 = 9 Mark
5 + 3 = 8 Mark
4 + 3 = 7 Win
5 + 3 = 8 Mark
Wins: 6
Losses: 1
Marks: 8
Press any key to continue . . .
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
