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 this(See 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:
(1.) Prompt the user for the size of the grid (width and height)
(2.) Create a list called board, each cell will represent a row of the grid. (3.) In the first cell of the board list, youll place a list.
a.) Pick a random number between 0 and 1. If the number is greater than or equal to 0.7 youll add a Treasure T to the next cell of the list. If the number is less than 0.7 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 (1).
(4.) Repeat step (3) until the board is the width the user asked for in step 1.
(5.) Tell the user how many treasures you have hidden.
(6.) 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 (0 to the width of the board -1)
b.) Ask the user to enter in a column number (0 to the height of the board -1)
c.) Check that location to see if it is a T(Treasure) or an O(Open).
~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.
Dungeon Treasure Map In this assignment you will

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 Programming Questions!