home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DP Tool Club 8
/
CDASC08.ISO
/
VRAC
/
LIBERTY.ZIP
/
HILO.BAS
< prev
next >
Wrap
BASIC Source File
|
1993-08-31
|
883b
|
47 lines
' Here is an interactive HI-LO
' Program
[start]
guessMe = int(rnd(1)*100)
cls
print "HI-LO"
print
print "I have decided on a number between one"
print "and a hundred, and I want you to guess"
print "what it is. I will tell you to guess"
print "higher or lower, and we'll count up"
print "the number of guesses you use."
print
[ask]
count = count + 1
print "OK. What is your guess?"
input guess
if guess = guessMe then [win]
if guess < guessMe then print "Guess higher."
if guess > guessMe then print "Guess lower."
goto [ask]
[win]
beep
print "You win! It took "; count; " guesses."
count = 0
input "Play again (Y/N)?"; play$
if instr("YESyes", play$) then [start]
print "Press ALT-F4 to close this window."
end