QuestionQuestion

Transcribed TextTranscribed Text

The Game Overview Like the classic Oregon Trail (created in 1971), your game is going to create a simple simulation based on resource management. In this style of game, you attempt to maximize your score by using your resources and obtaining assets. In your case, you will be creating a (very simple) game based on the life of Forty-Niner. The game takes place over a 20-week period. You will start with $100 (not bad for 1849). Your goal is to make as much money as possible. Each week, you gain and lose a random number amount of money (resource). You can spend your money (resource) to protect your assests. These, in turn, can help you acquire more money. Each week can be broken into four logical sections: Part 1: Sunday Even though people from all over the World to California, the Forty-Niners, as a whole, took Sunday off. Some Forty-Niners rested, some did repairs, and others spent the day up to no good. So, each Sunday, you get to decide: · Do nothing. It doesn't cost anything but doesn't help either. · Repair the sluice – which brings it back up to 100%. It will cost you $100 to do so. · Go into town (Auburn or Placerville) to enjoy yourself. Your endurance will go up from 5% to 50% (it might have been a great day!). However, it will cost you between $50 and $200 to do so. Part 2: Profits · You can earn between $0 and $100 automatically by panning for gold. · Your sluice can earn you between $0 and $1000. However, if its durability is at 0%, then it is broke and doesn't produce any gold. Part 3: Costs · Food costs between $30 and $50. Part 4: Wear and Tear · Your endurance (the willpower to keep going) wears down from 10% to 25% each week. · The durability of your sluice, which handles a heavy workload, wears down from 20% to 50% each week. · Your gold pan doesn't wear down (it's made of tin and quite durable). Tips 1. Write you program in parts DON'T attempt to write the entire program at one time. If you do, you won't be able to debug it. Experienced programmers use incremental design. Make a basic program and, very slowly, add the features you need. So, first get the main loop working… then, bit by bit, add the rest of the functionality. If you get stuck in an infinite loop, you can press Control+C to exit any UNIX program. 2. Random Numbers The library has a built-in subroutine called "Random" that you must use to make your project work. Please read the documentation on how to use it. 1. Print the title of your program. (5 points) 2. Print the game rules. Let the player know how the game works! (5 points) 3. Loop for 20 weeks. If you change the project theme, please feel free to change this value (e.g. 12 for months) (10 points) 4. Part 1: Decision Input the player's choice. There needs to be at least 3 choices. The program must do different things based on the input. (15 points) 5. Part 2: Profits Your program must calculate how much they earned automatically (panning) and how much they earned for each asset (sluices). (15 points) 6. Part 3: Costs (15 points) 7. Part 4: Damage Decrease both the endurance and the sluice. (15 points) 8. Comment your code! (10 points) 9. Proper formatting: Labels are never indented. Instructions are always indented the same number of spaces. Add blank lines for readability. (10 points Extra Credit 1. Color – 5 points Make use of color to enhance your game. The color must be meaningful – don't just set the color at the beginning of the program. 2. ASCII Art – 5 points Use ASCII-art to make your program exciting. The ASCII-art must be meaningful and not something overly simple like: ==========:) It's a happy worm! 3. At least 2 more decisions – 10 points There is more to do than go to town and repair sluices. Give the program more decisions that can help or hinder the game. 4. Another resource – 10 points Right now, there is only three resources – money, endurance, and the sluice. What else can be considered? Food? Happiness? Whiskey? 5. Random events – 5 each for a max of 15. What other types of events, good and bad, can occur. The more you add, the more you can capture the feeling of the Gold Rush.

Solution PreviewSolution Preview

These solutions may offer step-by-step problem-solving explanations or good writing examples that include modern styles of formatting and construction of bibliographies out of text citations and references. Students may use these solutions for personal skill-building and practice. Unethical use is strictly forbidden.

.data

# string messages
welcome:
.ascii "    /$$$$$$   /$$$$$$ /$$       /$$$$$$ /$$$$$$$$ /$$$$$$ /$$$$$$$ /$$   /$$ /$$$$$$ /$$$$$$ \n"
.ascii "   /$$__ $$ /$$__ $$| $$      |_ $$_/| $$_____//$$__ $$| $$__ $$| $$$ | $$|_ $$_/ /$$__ $$ \n"
.ascii " | $$ \\__/| $$ \\ $$| $$       | $$ | $$    | $$ \\ $$| $$ \\ $$| $$$$| $$ | $$ | $$ \\ $$ \n"
.ascii " | $$      | $$$$$$$$| $$       | $$ | $$$$$ | $$ | $$| $$$$$$$/| $$ $$ $$ | $$ | $$$$$$$$ \n"
.ascii " | $$      | $$__ $$| $$       | $$ | $$__/ | $$ | $$| $$__ $$| $$ $$$$ | $$ | $$__ $$ \n"
.ascii " | $$    $$| $$ | $$| $$       | $$ | $$    | $$ | $$| $$ \\ $$| $$\\ $$$ | $$ | $$ | $$ \n"
.ascii " | $$$$$$/| $$ | $$| $$$$$$$$ /$$$$$$| $$    | $$$$$$/| $$ | $$| $$ \\ $$ /$$$$$$| $$ | $$ \n"
.ascii "   \\______/ |__/ |__/|________/|______/|__/      \\______/ |__/ |__/|__/ \\__/|______/|__/ |__/ \n\n"
.ascii "       /$$$$$$   /$$$$$$ /$$       /$$$$$$$            /$$$$$$$ /$$   /$$ /$$$$$$ /$$   /$$ \n"
.ascii "      /$$__ $$ /$$__ $$| $$      | $$__ $$          | $$__ $$| $$ | $$ /$$__ $$| $$ | $$ \n"
.ascii "    | $$ \\__/| $$ \\ $$| $$      | $$ \\ $$          | $$ \\ $$| $$ | $$| $$ \\__/| $$ | $$ \n"
.ascii "    | $$ /$$$$| $$ | $$| $$      | $$ | $$          | $$$$$$$/| $$ | $$| $$$$$$ | $$$$$$$$ \n"
.ascii "    | $$|_ $$| $$ | $$| $$      | $$ | $$          | $$__ $$| $$ | $$ \\____ $$| $$__ $$ \n"
.ascii "    | $$ \\ $$| $$ | $$| $$      | $$ | $$          | $$ \\ $$| $$ | $$ /$$ \\ $$| $$ | $$ \n"
.ascii "    | $$$$$$/| $$$$$$/| $$$$$$$$| $$$$$$$/          | $$ | $$| $$$$$$/| $$$$$$/| $$ | $$ \n"
.asciz "      \\______/ \\______/ |________/|_______/          |__/ |__/ \\______/ \\______/ |__/ |__/ \n\n"
rules:
.ascii "Rules:\n"
.ascii "1. 20 weeks (5 months)\n"
.ascii "2. Your endurance drops 10-25% each week. If it reaches 0% and your friends can't help you, the game ends.\n"
.ascii "3. Going to town improves your endurance 5-50%, but costs 50-200 dollars.\n"
.ascii "4. Panning for gold yields 0-25 dollars.\n"
.ascii "5. A sluice yields 0-1000 dollars (durability drops 20-50% each week)\n"
.ascii "6. Hanging out with people yields 5-10 new friends, but costs $20-30 (you have to buy some drinks)\n"
.ascii "7. Not hanging out with people drops 1-3 friends each week.\n"
.ascii "8. Having friends reduces chances of robbery.\n"
.ascii "9. If you have more than 10 friends, they might help you once your endurance reaches 0%\n"
.ascii "10. Food costs 30-50 dollars a week.\n"
.ascii "11. Renting a garden costs 10 dollars and reduces weekly food expenses for 80-100%\n"
.ascii "12. However, working in a garden takes time, so income from panning is reduced 5-10%.\n"
.ascii "13. Weather conditions might influence your yield.\n"
.ascii "14. Robberies can be quite common if you don't have many friends in the area!\n"
.asciz "15. Beware! If someone slanders you, you might lose some friends.\n"

menu:
.ascii "It's Sunday! What do you want to do?\n"
.ascii "1. Do nothing\n"
.ascii "2. Repair sluice (-$100)\n"
.ascii "3. Hang out with people\n"
.ascii "4. Rent a garden (-$10)\n"
.asciz "5. Go to town\n"

week_str:
.asciz "WEEK "
money_str1:
.asciz "You have $"
endur_str1:
.asciz "Your endurance is at "
endur_str2:
.asciz "%\n"
sluice_str1:
.asciz "Sluice is at "
sluice_str2:
.asciz "%\n"
friend_str1:
.asciz "You have "
friend_str2:
.asciz "You made "
friend_str3:
.asciz "You lost "
friend_str4:
.asciz " friends this week.\n"
friend_str5:
.asciz " friends for not hanging out this week.\n"
friend_str6:
.asciz " friends.\n"
pan_str:
.asciz "Panning for gold yielded $"
sluice_str3:
.asciz "\nThe sluice yielded $"
food_str1:
.asciz "\nYou ate $"
food_str2:
.asciz " in food\n"
sluice_str4:
.asciz "\nYou repaired the sluice to 100%.\n"
sluice_str5:
.asciz "\nYou don't have enough money to repair the sluice.\n"
hang_str1:
.asciz "\nHanging out with people cost you $"
hang_str2:
.asciz "\nYou don't have enough money to hang out.\n"
town_str1:
.asciz "\nGoing to town cost you $"
town_str2:
.asciz "\nYou regained "
town_str3:
.asciz "% endurance.\n"
town_str4:
.asciz "\nYou don't have enough money to go to town.\n"
game_over_str:
.ascii "\n"
.ascii "    /$$$$$$   /$$$$$$ /$$      /$$ /$$$$$$$$       /$$$$$$ /$$    /$$ /$$$$$$$$ /$$$$$$$ \n"
.ascii "   /$$__ $$ /$$__ $$| $$$    /$$$| $$_____/       /$$__ $$| $$   | $$| $$_____/| $$__ $$\n"
.ascii " | $$ \\__/| $$ \\ $$| $$$$ /$$$$| $$            | $$ \\ $$| $$   | $$| $$      | $$ \\ $$\n"
.ascii " | $$ /$$$$| $$$$$$$$| $$ $$/$$ $$| $$$$$         | $$ | $$| $$ / $$/| $$$$$   | $$$$$$$/\n"
.ascii " | $$|_ $$| $$__ $$| $$ $$$| $$| $$__/         | $$ | $$ \\ $$ $$/ | $$__/   | $$__ $$\n"
.ascii " | $$ \\ $$| $$ | $$| $$\\ $ | $$| $$            | $$ | $$ \\ $$$/ | $$      | $$ \\ $$\n"
.ascii " | $$$$$$/| $$ | $$| $$ \\/ | $$| $$$$$$$$      | $$$$$$/   \\ $/   | $$$$$$$$| $$ | $$\n"
.asciz "   \\______/ |__/ |__/|__/    |__/|________/       \\______/    \\_/    |________/|__/ |__/\n"
money_str2:
.asciz "\nYou ended the game with $"
endur_str3:
.asciz "\nYour endurance was "
endur_str4:
.asciz "%\n"
endur_str5:
.asciz "Bad luck. Friends could not help you :(\n"
endur_str6:
.asciz "You are lucky! Friends helped you regain your endurance :)\n"
weather_str1:
.asciz "\nWhat a beautiful day! Your earned extra $"
weather_str2:
.asciz " on panning.\n"
weather_str3:
.asciz "\nUh-oh! Storm and thunders will make you earn $"
weather_str4:
.asciz " less on panning today.\n"
rob_str1:
.asciz "Unfortunately, robbers found their way to your savings. You have been robbed of $"
sland_str1:
.asciz "Someone has been spreading bad rumors about you! Due to this you lost "
sland_str2:
.asciz " friends this week.\n"
garden_str1:
.asciz "\nYou rented a garden for $10.\n"
garden_str2:
.asciz "\nYou don't have enough money to rent a garden.\n"
garden_str3:
.asciz "Your food expenses will be lower by "
garden_str4:
.asciz "Your panning efficiency will be lower by "
garden_str5:
.asciz "% this week.\n"
sunny_day:
.ascii "                         .    |    .    \n"
.ascii "                         \\   |    /      \n"
.ascii "                      `.   \\ '   /   .' \n"
.ascii "                        `. .-*\"\"*-. .'    \n"
.ascii "                   \"*-._ /.*\" \"*.\\ _.-*\"\n"
.ascii "                         : <o> <o> ; ____\n"
.ascii "                   \"\"\"\"':    ..    ;    \n"
.ascii "                   _.-*\" \\ `.__.' / \"*-._\n"
.ascii "                        .' `-.__.-' `.    \n"
.ascii "                      .'   /   . \\   `. \n"
.ascii "                         /    |   \\      \n"
.asciz "                         '    |    `    \n"
rainy_day:
.ascii "       _, .--.\n"
.ascii "      ( / ( '-.\n"
.ascii "      .-=-.    ) -.\n"
.ascii "    /   ( .' .   \\ \n"
.ascii "    \\ ( ' ,_) ) \\_/ \n"
.ascii "      (_ , /\\ ,_/\n"
.ascii "    | '--\\ `\\--`\n"
.ascii "       | _\\ _\\ |\n"
.ascii "    | |   `\\ \\ |\n"
.ascii "      | | _\\_\\ | |\n"
.ascii "    | |   `\\\\ |\n"
.ascii "       | |   \\\\   |\n"
.asciz "          -.'.`\\.'.-\n"

# constants and limits
max_weeks:      .quad 20
min_pan:       .quad 0
max_pan:       .quad 100
min_sluice:    .quad 0
max_sluice:    .quad 1000
min_food:       .quad 30
max_food:       .quad 50
min_endr_down: .quad 10
max_endr_down: .quad 25...

By purchasing this solution you'll be able to access the following files:
gold_rush.s.

$83.00
for this solution

or FREE if you
register a new account!

PayPal, G Pay, ApplePay, Amazon Pay, and all major credit cards accepted.

Find A Tutor

View available Assembly Language Programming Tutors

Get College Homework Help.

Are you sure you don't want to upload any files?

Fast tutor response requires as much info as possible.

Decision:
Upload a file
Continue without uploading

SUBMIT YOUR HOMEWORK
We couldn't find that subject.
Please select the best match from the list below.

We'll send you an email right away. If it's not in your inbox, check your spam folder.

  • 1
  • 2
  • 3
Live Chats