brian scotts

Greenhorn
+ Follow
since May 10, 2018
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by brian scotts

The Random subroutine takes in a single argument in the %rax register. Use 6 in %rax to produce 6 different values.

The following is the basic algorithm:

* Starts with $100 balance default and loops until player is out of money then exits.
1. Print to screen "Welcome to Dice"
2. Money > 0
true: continue to number 3
false: output "You lost all your money. Game over" Go to number 11
3. Print to screen "Enter your bet"
4. Scan in bet
5. Random calculate player roll (random(6)
6. Random calculate house roll (random(6)
7. Output "You rolled a (value) player"
8. Output "House rolled a (valuie) house"
9. Check player > house
true: money = money+bet output "You win!"
false: money = money-bet output "You lose!"
10. Go back to (loop) number 2.
11. End program
5 years ago