Well, I have just been getting used to programming in Pascal again, and I
thought I would write the age-old number guessing game. It all works, well it
*should* but I seem to be having problems with some logic in an if statement:
if (iGuess > 0) or (iGuess < 101) then { do my code }
I thought this bit of code should detect if iGuess is inbetween 0 and 100, but it doesn't seem to work! Can anyone tell me why?
Your if-condition is True for any value of iGuess, because you use 'or' instead of 'and'!
Also is there a random number generator in gpc? I have hardcoded the value for this program, I want to play with it being random too :)
Yes, though I don't know the details.
Tom