Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In x 8 6 assembly language, Write a program that asks the user to guess the next color that the wheel pointer lands on after

In x86 assembly language, Write a program that asks the user to guess the next color that the wheel pointer lands on after spinning. Each guess costs $2. If they guess correctly, they get $ 10.00. The player will start out with a $15.00 bank. Each time he (or she) guesses incorrectly you will subtract $3.00 from their bank. Each time they guess correct, you add $10.00 to their bank. Print the bank total at the end of the game. You can simulate the spin of the wheel using the RandomRange function (Don't forget to Randomize). It is important that you seed the random number generator only once at the top of the file. Seeding the random number generator in a loop does not have the effect that you might think it does.
Hint: To be simple, assign numbers to colors. For example, assign 0 to black and 1 to red. For this game the random number generator needs to output just two numbers, 0 or 1.
Requirement: After the spin, you have to display the color the wheel landed on, black or red. Do not display 0 or 1.
Your program should look something like this:
Welcome to the Spinning the Wheel game. it costs $2.00 to play.
If you are correct, I will pay you $10.00. If you loose, you will pay me $3.00.
Would you like to continue? (y/n)
y
I took $2.00 from your bank.
Please enter your guess for the next spin. Enter 0 for black or 1 for red.
If you are correct, I will pay you $10.00. If you loose, you will pay me $3.00.
1
Winner! The color is red.
Your bank is now $23
Would you like to continue? (y/n)
y
I took $2.00 from your bank.
Please enter your guess for the next spin. Enter 0 for black or 1 for red.
If you are correct, I will pay you $10.00. If you loose, you will pay me $3.00.
0
Sorry you lose. The color is red.
Your bank is now $18
Would you like to continue? (y/n)
y
I took $2.00 from your bank.
Please enter your guess for the next spin. Enter 0 for black or 1 for red.
If you are correct, I will pay you $10.00. If you loose, you will pay me $3.00.
1
Sorry you lose. The color is black.
Your bank is now $13
Would you like to continue? (y/n)
n
Thanks for Playing
Your bank is now $13
Press any key to close this window ...
You are to rewrite this program using higher-level language constructs in this assignment.
High-level language constructs
For this assignment, you are to use one .WHILE loop and high-level decision statements .IF and .ELSE. Your main game loop MUST use a .WHILE statement. A .WHILE statement is not a .REPEAT .UNTIL. For this assignment REPEAT/UNTIL loops are not to be used and will result in a 50% reduction of your score.
Priming the .WHILE loop
You are required to prime your while loop correctly. The use of things like
.WHILE true
.WHILE 1
are not allowed and will result in a 40% reduction in your score.
In addition, making up a value to satisfy the loop condition is not how you prime a loop properly.
Not priming the loop properly will result in a 40% reduction in your score.
Other things you are not to do
In this assignment, you should not have any jmp or jcond statements. You are using high-level language constructs, and if used properly, there is no need for any kind of jump in your code.
You should only have one exit statement in your code at the bottom of your program. Using an exit statement to get out of a loop will result in a 40% reduction in your score.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Processing

Authors: David M. Kroenke

12th Edition International Edition

1292023422, 978-1292023427

More Books

Students also viewed these Databases questions

Question

LO6 List the components of job descriptions.

Answered: 1 week ago