TGC Codebase Backup



Geuss My Number by DSboy

4th Nov 2009 16:05
Summary

a simple geuss my number file some dubugging necessary



Description



Code
                                    ` This code was downloaded from The Game Creators
                                    ` It is reproduced here with full permission
                                    ` http://www.thegamecreators.com
                                    
                                    main:
input "[1] one player or [2] two player"; option
if option=1 then goto one
if option=2 then goto two

one:
rem generates a random number
b=rnd(10)

rem asks for input
input "guess a number from 1 to 10 ";a

rem shows the result
IF a=b
PRINT b, " is correct"
ELSE
PRINT a, " is incorrect"
PRINT b, " is the correct answer"
ENDIF

wait 1000

cls

do
b=rnd(10)

input "try again " ;a
 
IF a=b
PRINT b, " is correct"
ELSE
PRINT a, " is incorrect"
PRINT b, " is the correct answer"
ENDIF

wait 1000

cls
loop

two:
do
input "player 1: type a number from 1 to 10 (no peeking) ",a
input "player 2: geuss a number from 1 to ten ",b

if a=b
print b, " is correct"
wait 2000

else
print b, " is incorrect"
print a, " is the correct answer"
wait 2000
ENDIF
loop
end