Guessing game - Logical operators

I am making a small guessing game, however I think I have the decision condition wrong, as whenever I enter a number, it always comes up as being correct. I am looking for “equals to” e.g ==


You may use “=” instead of “<>”.
I think it simple mistake that decision is “random <> guess”, so almost time it returns true.

@Jumbo now it keeps saying is correct but will keep repeating the loop

I hope the reason is
—We are getting a random number which would be almost never be equal to the one we guess
— as we have given condition like
random <> guess
as they are almost never equal, it goes to TRUE side
— so if we want to check for FALSE side the use a condition like
random = guess
So this condition will most of the time fail so will go for FALSE side

Hope this would help you
Cheers @SSJCalzana

If that still says as false …yes of course as we are using random number which won’t assure at what sequence it will get matched
The change the random number range between (1, 5)
—so if we try to enter any value between 1-5 at one point it will match and we will get to the true side as the number of possible entries becomes less

Cheers @SSJCalzana

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.