How to make a TreasureHunter from NumberWizard

Hello Everyone!

Back when i was a University student, i had to make a Treasure Hunter game for one of my exams. I have to admit, i failed miserably, but that is not the point here.

The point: if you are looking for a simple, but exciting challenge, you can make this game on your own.

NumberWizard is a guessing game that uses a halving algorithm between a min and a max number. In order to go a step further lets imagine these values as one axis of a coordinate system. Lets call them Xmin and Xmax. Pair it with Ymin and Ymax. Of course with this, you will need to guess the X and Y axis separately, so lets just make an Xguess and Yguess.

If you follow the course, and make:

Xmax = Ymax = 100;
Xmin = Ymin = 1;
Xguess = Yguess = 50;

After this you just need to make the movements. In my code i used the numpad for directions and 5 as “enter”.

Last but not least, quick challenge, where should you add 1 to the max values to make the game run correct? :slight_smile:

I hope you enjoyed reading, please comment if there is something you`d like to add!

The title “Treasure Hunter” implies that there’s more to the game than just guessing two numbers, …there’s treasure to be found!

I think some additional ideas about what you can do with this game idea will blossom as you get through the next section, 03: Text Adventure.

Privacy & Terms