Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Back in the early days of small computers, one of the first small games that was written was called Hunt the Hurkle (not to be

image text in transcribed

Back in the early days of small computers, one of the first small games that was written was called Hunt the Hurkle" (not to be confused with Hunt the wumpus" which was a similar small game). A hurkle is a creature that hides at random in one cell of a large two-dimensional grid. The user has a small number of guesses to find the hurkle. If the guess is incorrect, the hurkle will tell the user to "Go northwest", "go south", "go southeast", etc. If the guess is correct, the hurkle says "You caught me!" and the game ends. If there are too many incorrect guesses, the hurkle says "I got away!" and the game ends. The first part of the program needs to select the position, at random, of the hurkle in the grid. The grid is 100x100, so you need to pick the X position of the hurkle at random from 0 to 99, and the Y position at random from 0 to 99 as well. Location is the upper left corner of the grid, and is the lower right corner of the grid. You'll need to add the statement import random at the start of the program (see page 261 of the Companion for a list of random-number functions) The user has no more than six guesses to find the hurkle. The following is a pseudocode" version of the program you are to write. You will need to translate the pseudocode into Python and flesh out some of the more ambiguous parts. Pick the X,Y location of the hurkle at random Guess 0 Found False while (Guess

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

Step: 3

blur-text-image

Ace Your Homework with AI

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

Get Started

Students also viewed these Databases questions