Hi all, i'm a n00b in programming. I buy today dbpro and here is my first simply game. In Italy is called SIMON. I use number and not color. Enjoy !
REM Project: Simon
REM Created: 01/02/2008 15.40.52
REM
REM ***** Main Source File *****
REM
REM print title and wait 3 seconds
print "SIMON GAME in 20 lines.":print:wait 2000
REM declare array
dim numbers(30): dim try(30): playagain$ = "y"
REM do until variable "playagain" is true (y)
while playagain$ = "y"
REM main loop, play until "error" is false (0)
while error = 0
REM initialize counter
i=i+1
REM calculate random number from 0 to 3 and store in array
randomize timer():number=rnd(3):numbers(i) = number
REM print on screen the random number
for x = 1 to i
print "Remember: ", numbers(x): wait 500
next x
REM clear screen
cls
REM player turn, try to guess every single number
for y = 1 to i
input "Guess number: ", try(y)
REM if player fault set variable "error" on true
if try(y) <> numbers(y) then print "You are wrong !":error = 1:wait 1500
next y
REM clear screen
cls
endwhile
REM ask to continue
input "Play again (y/n) ?: ",playagain$
REM if play again set all variable to 0
if playagain$ = "y" then error=0:i=0:x=0:y=0:cls:print "SIMON GAME in 20 lines.":print:wait 2000
endwhile