Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The Hurkle is an imaginary creature that hides somewhere in a two-dimensional 9x9 integer game-space. Each time the game is run the program places the

The Hurkle is an imaginary creature that hides somewhere in a two-dimensional 9x9 integer game-space. Each time the game is run the program places the Hurkle at a random position in the game-space (a row and column pair) and the player has a maximum of five (5) guesses to guess the Hurkle's location. The Hurkle does not move during the game. If the player finds the Hurkle, the program reports the success and ends. If the player does not find the Hurkle the program gives a hint about what direction to the player move to find the Hurkle. The hint must be correct and the optimal direction -- the program doesn't lie or mislead the player! There are eight possible hints: north, northeast, east, southeast, south, southwest, west, and northwest. The program must detect guesses that are not in the game-space and re-prompt until a valid value is given (invalid guesses don't count as one of the five).

When the program starts, and after each turn, a map of the game-space is displayed, showing rows and columns. (in line with each row, picture is off)

1 2 3 4 5 6 7 8 9 A . . . . . . . . . B . . . . . . . . . C . . . . . . . . . D . . . . . . . . . E . . . . . . . . . F . . . . . . . . . G . . . . . . . . . H . . . . . . . . . I . . . . . . . . . Turns: 0 ?

Make sure above is in line. Also make sure each move is saved. DO NOT USE A GO TO FUNCTION PLEASE.

After each turn the map is displayed with an X marking the location of the move. If the player uses all their turns, they lose and the Hurkle's location is revealed. If they guess the location of the Hurkle they win, and the Hurkle is shown as an H in the map.

At each turn the player can enter a move, which is a letter and a number (with no blanks), such as F8. Or they can enter 'n' for a new game, or 'q' to quit.

(You only get 5 turns after that game ends.)

Need to be made using C code (NOT C++). Please do not use any go to's. Please do based on instructions have asked multiple times and all have been wrong.

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

Understanding Databases Concepts And Practice

Authors: Suzanne W Dietrich

1st Edition

1119827949, 9781119827948

More Books

Students also viewed these Databases questions