Question: Dungeon Treasure Map In this assignment you will create a treasure hunt board game. Players will play on a board which resembles a grid like
Dungeon Treasure Map In this assignment you will create a treasure hunt board game. Players will play on a board which resembles a grid like thisSee picture:
The exact dimensions of the grid will be determined by the player. Each square of the grid will either have an O representing an open square, a T representing treasure, or an X representing treasure that has been collected.
Steps:
Prompt the user for the size of the grid width and height
Create a list called board, each cell will represent a row of the grid. In the first cell of the board list, youll place a list.
a Pick a random number between and If the number is greater than or equal to youll add a Treasure T to the next cell of the list. If the number is less than youll add an open O to the next cell of the list.
b Keep track of how many treasures you are adding to the board in a separate variable called numberOfUndiscoveredTreasures.
c Repeat step a until you have a list that is the height the user asked for in step
Repeat step until the board is the width the user asked for in step
Tell the user how many treasures you have hidden.
Next youll ask the user to guess coordinates, youll check if they found treasure or not:
a Ask the user to enter in a row number to the width of the board
b Ask the user to enter in a column number to the height of the board
c Check that location to see if it is a TTreasure or an OOpen
~i If its a treasure tell the user they got treasure, change that cell of the board to an X to indicate that it was already discovered. Lower the number of undiscovered treasures by one.
~ii If its not a treasure, tell the user to try again.
~iii. Keep asking the user to guess locations until the user has discovered all the Treasures, then print out the whole board, and end the game.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
