7.16. Improve the Number Guessing game from the earlier chapter

Let the user guess several times (with responses each time) till he finds
the hidden number.

Allow the user to type
n   - skip this game and start a new one
s   - show the hidden value
x   - exit


Now I can tell you that what you have is actually a 1 dimensional space fight
and you are trying to guess the distance of the enemy space ship.
As it is not a sitting duck, after every shot the spaceship can randomly move +2-2.

For trainng purposes you might want to limit the outer spaces to 0-100.
Make sure the enemy does not wander off the training field.
Give warning if the user shoots out of space.

Keep track of the minimum and maximum number of hits (in a file).


If you are interested in on-site trainings by the author, please contact me directly.

Online courses: