home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 2001 February
/
PCWorld_2001-02_cd.bin
/
Software
/
Vyzkuste
/
visirc
/
guess.vsc
< prev
next >
Wrap
Text File
|
1995-07-17
|
732b
|
34 lines
// GUESS.VSC (version 1.00)
// A simple guess-the-number game for ViRC '96 (0.34+)
//
// Simply type "/load guess.vsc" to play!!
Name Guess the number game!!
@ $num = $rand(1000)
@ $guess = $?="Guess the number. It's between 0 and 999."
@ $tries = 1
while ($num != $guess) && ([$guess] != [])
@ $tries = $($tries + 1)
if ($num > $guess)
@ $g2 = $?="The number is higher. Guess again."
else
if ($num < $guess)
@ $g2 = $?="The number is lower. Guess again."
endif
endif
@ $guess = $g2
endwhile
if ([$guess] == [])
MessageBox Only losers give up. =]
else
MessageBox Congratulations. You got the number in $tries tries.
endif
-@ $num
-@ $guess
-@ $tries
-@ $g2