Question: Question 3. (20 marks) Write a game called Cursed Gold. The object of the game is to make your opponent select the last gold coin

 Question 3. (20 marks) Write a game called Cursed Gold. The

Question 3. (20 marks) Write a game called Cursed Gold. The object of the game is to make your opponent select the last gold coin from the pile. There are initially 16 gold coins in the pile and you and your opponent take turns selecting 1,2 or 3 pieces of gold. The person who has to take the last piece from the pile loses. I want you to figure out how to use functions to make this program easier to read and program. Some of your marks will be dedicated to "good use of functions". Don't stress too much about this, just try to figure out how to break the game up Use the discussion forum to talk about different approaches and to brainstorm. Your game should be able to play two human players. A few hints from my solution (take them or leave them) -Consider functions for getting the input from the user and checking that they haven't tried to take a wrong number of coins, for decrementing the coins from the pile, for checking to see if there is a winner, etc. Output from the two computer players playing (no user input): Nelcome to Cursed Gold!. Here be the rules: -Ye can only take 1, 2 or 3 gold coins on yer turn -The poor soul that takes the last coin walks the plank (loses) Be playarr 1 human?: (y)n Be playarr 2 human?: (y)n Arrr I be stacking up a pile of coins 16 high Player 1:Taking 1 gold coin (s) Thar be 15 gold left matey Player 2:Taking 1 gold coin (s) Thar be 14 gold left matey Player 1:Taking 3 gold coin (s) Thar be 11 gold left matey Player 2:Taking 1 gold coin (s) Thar be 10 gold left matey Player 1:Taking 3 gold coin (s) Thar be 7 gold left matey Player 2:Taking 1 gold coin (s) Thar be 6 gold left matey Player 1:Taking 1 gold coin (s) Thar be gold left matey Player 2:Taking 1 gold coin (s) Thar be 4 gold left matey Player 1:Taking 3 gold coin (s) Thar be 1 gold left matey Winner is player 1 (5 marks) Write a function for a simple computer player so that the game can play either human vs. computer or computer vs. computer. Warning: This is few marks for a bunch of work. For that reason I'll make these marks bonus on the whole assignment that means you can get full marks without doing this bonus part but doing this bonus will protect you from mistakes in earlier questions

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!