15 lines
489 B
Text
15 lines
489 B
Text
nmin = 5
|
|
nmax = 15
|
|
chosen = int( rnd( 1) * (nmax-nmin+1)) +nmin
|
|
print "Guess a whole number between "; nmin; " and "; nmax
|
|
[loop]
|
|
input "Enter your number "; guess
|
|
if guess < nmin or guess > nmax then
|
|
print "That was an invalid number"
|
|
end
|
|
else
|
|
if guess < chosen then print "Sorry, your number was too low"
|
|
if guess > chosen then print "Sorry, your number was too high"
|
|
if guess = chosen then print "Well guessed!": end
|
|
end if
|
|
if guess <> chosen then [loop]
|