Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

please use C++ and show your code below. Turn in: A copy of the program and sample, annotated output showing the program runs. You do

image text in transcribedplease use C++ and show your code below.

Turn in: A copy of the program and sample, annotated output showing the program runs. You do not need to print an entire game, but you should show (and label) the important cases, which include the player winning, the player losing, the player entering an illegal move, and how the map changes when the player enters a legal move For this assignment you will be writing a gopher hunt game. In gopher hunt the player has to pick cells on a two dimensional grid - avoiding the locations of the gophers. Each time a cell is selected the number of gophers in the neighboring spaces is revealed in that cell (neighbors includes diagonals so each cell has eight neighbors). The player loses if they pick a cell containing a gopher. (Yes, this game is very similar to minesweeper On each turn the entire map should be printed, showing which cells have been explored, which cells haven't been explored, and for the explored cells how many neighboring cells contain gophers. It should look something like +++101 +++20 (but bigger), where a is an unexplored cell and the numbers are explored cells showing the number of neighboring gophers After the map is displayed the player picks a cell by entering the cell's x.y coordinates. The program should make sure that these values are in bounds and print an error message and request new coordinates if the cell is out of bounds If there is a gopher in the selected cell the player should lose. Otherwise the number of gophers in neighboring cells should be added to the map and the process repeats. The player wins if every cell without a gopher in it has been revealed For this game you will probably want two 2-dimensional arrays. One array keeps track of where the gophers are and the number of neighboring gophers for each square. The other array keeps track of which cells the player has already guessed You may change the theme of the game. If you want the player to be avoiding the sleeping vampires, that's fine Turn in: A copy of the program and sample, annotated output showing the program runs. You do not need to print an entire game, but you should show (and label) the important cases, which include the player winning, the player losing, the player entering an illegal move, and how the map changes when the player enters a legal move Turn in: A copy of the program and sample, annotated output showing the program runs. You do not need to print an entire game, but you should show (and label) the important cases, which include the player winning, the player losing, the player entering an illegal move, and how the map changes when the player enters a legal move For this assignment you will be writing a gopher hunt game. In gopher hunt the player has to pick cells on a two dimensional grid - avoiding the locations of the gophers. Each time a cell is selected the number of gophers in the neighboring spaces is revealed in that cell (neighbors includes diagonals so each cell has eight neighbors). The player loses if they pick a cell containing a gopher. (Yes, this game is very similar to minesweeper On each turn the entire map should be printed, showing which cells have been explored, which cells haven't been explored, and for the explored cells how many neighboring cells contain gophers. It should look something like +++101 +++20 (but bigger), where a is an unexplored cell and the numbers are explored cells showing the number of neighboring gophers After the map is displayed the player picks a cell by entering the cell's x.y coordinates. The program should make sure that these values are in bounds and print an error message and request new coordinates if the cell is out of bounds If there is a gopher in the selected cell the player should lose. Otherwise the number of gophers in neighboring cells should be added to the map and the process repeats. The player wins if every cell without a gopher in it has been revealed For this game you will probably want two 2-dimensional arrays. One array keeps track of where the gophers are and the number of neighboring gophers for each square. The other array keeps track of which cells the player has already guessed You may change the theme of the game. If you want the player to be avoiding the sleeping vampires, that's fine Turn in: A copy of the program and sample, annotated output showing the program runs. You do not need to print an entire game, but you should show (and label) the important cases, which include the player winning, the player losing, the player entering an illegal move, and how the map changes when the player enters a legal move

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Beginning VB 2008 Databases

Authors: Vidya Vrat Agarwal, James Huddleston

1st Edition

1590599470, 978-1590599471

More Books

Students also viewed these Databases questions