CodeBase - a simple guessing game
Return to the CodeBase listing
Category: Complete Applications
Version: 1.0
Information
Uploaded: 4th Jan 2009 02:37
Modified: 1st Jan 1970 01:00
Author: awsumman4
Summary
randomize (timer()) MyRandomNumber = RND(10) randomage = rnd(5) Print "The number is between 0 and 10" repeat Input "Can you guess my number? ", MyGuess if MyGuess = 1 GuessedRight = 1 print "Well done" else GuessedRight = 0 Print "No you dont have it, guess again." Endif Until GuessedRight = 1 input "Guess how old I am? ", age if age = 1 Age = 1 print "Good job, you get to continue the game." else age = 0 Print "No you dont have it, you lose!" end endif Print "Press any key to exit" wait key
Full Description
randomize (timer())<br /> MyRandomNumber = RND(10)<br /> randomage = rnd(5)<br /> Print "The number is between 0 and 10"<br /> repeat<br /> Input "Can you guess my number? ", MyGuess<br /> if MyGuess = 1<br /> GuessedRight = 1<br /> print "Well done"<br /> else<br /> GuessedRight = 0<br /> Print "No you dont have it, guess again."<br /> Endif<br /> Until GuessedRight = 1<br /> input "Guess how old I am? ", age<br /> if age = 1<br /> Age = 1<br /> print "Good job, you get to continue the game."<br /> else<br /> age = 0<br /> Print "No you dont have it, you lose!"<br /> end<br /> endif<br /> Print "Press any key to exit"<br /> wait key
Comments
No comments yet.