vendredi 5 novembre 2021

Number guessing game: Different message when guess = >100?

I'm creating a little number guessing game for class and I have a question that my prof still hasn't spoken about:

In my if-statements I have different messages telling the player when the guess is < random number, > the random number and == the random number. Now I would like to also print a message when the guess is too far off the random number;

If the random number is 700 and my guess is more than 100 off, how do I put this in the if-statement? I have of course tried guess + >100 but that obviously doesn't work. Do I need a new variable for this?

Aucun commentaire:

Enregistrer un commentaire