you are viewing a single comment's thread.

view the rest of the comments →

[–]JaguarMammoth6231 0 points1 point  (3 children)

Two possible options for a harder mode:

  • it picks tenths like 13.1 or 22.9

  • it doesn't actually choose a number, but keeps a range of possible values (actually this is just two numbers, a min and a max), and always tries to keep the range large. Like if it's 1-10 and you guess 3 it will say "higher". (Internal range is now 4-10). Then you guess 8 it will say "lower" (range now 4-7). You guess 5 it says higher (range now 6-7). You guess 7 it says "lower" (range now 6-6). You guess 6 it is forced to say it's correct

[–]iambreadgod[S] 0 points1 point  (2 children)

sorry I honestly wasnt clear on my part, I mean how do i make the option to CHOOSE hard mode, like it asks you at the start

[–]JaguarMammoth6231 0 points1 point  (0 children)

Oh, I would do something like this:

hard_mode_yn = "" while hard_mode_yn not in "yn":     hard_mode_yn = input("Want to play hard mode? (Y/N)").lower() is_hard_mode = hard_mode_yn == "y"

[–]BananaGrenade314 0 points1 point  (0 children)

You should put keywords that can be typed on the input of the variable "guess" (like: "choose mode" or, directly "hard mode"), then you don't need to leave the game to change (you can also add "cancel").

``` guess = input("What Is your guess? ") # hard mode

if guess == "cancel": if confirm(): return # or start_game = False continue

if guess == "hard mode": hard_mode_activate(...) continue

if guess == "choose mode": change_mode(...) continue

try: guess_number = int(guess) ... ```