BlitzCoder Essentials
•
Home Page
•
About BlitzCoder
•
Contributors
•
Terms of Use
•
Email Us
Main Areas
•
BlitzCoder Chat
•
Discussions
•
Articles/Tutorials
•
Code Database
•
Link Database
•
Showcase Area
•
Worklogs
•
Competitions
Special Areas
•
Undocumented
Other Blitz Sites
•
Blitz Basic Home
•
Blitz Showcase
•
BlitzPlay Library
Forum Login
Username:
Password:
•
Register Now!
BlitzCoder Code Archives Page
Main Codes Page
"Guessing game"
, by cabledue
this is a little somthing that you can do if your bored. I hope you like it. I need to know if you can make fullscreen.
Code
;this GAME is a guessing one Print "Welcome to the Guessing Game!" AppTitle "Guessing Game!" ;seed the random generator...don't worry, it will be explained later SeedRnd MilliSecs() ;pick a nubmer bewteen 1 and 100 numbertoguess = Rand(1,100) ;the num of guesses the user has used numofguesses = 0 ;set the beginning of loop label .loopbegin ;Find out the user's guess guess = Input$("Guess a number ") ;if player guesses outside of range, tell him to guess again If guess > 100 Or guess < 1 Print "Pick a number between 1 and 100, silly!" ;Go back to the beginning Goto Loopbegin EndIf ;add a guess to the guess counter numofguesses = numofguesses + 1 ;If the guess is too low, go back to beginning If guess < numbertoguess Then Print "the number was to low." Goto loopbegin ;if guess is too high, go back to the beginning Else If guess > numbertoguess Then Print "the number was too high." Goto loopbegin EndIf Print "You guessed the number " + numbertoguess + " in " + numofguesses + " tries!." WaitKey End
Copyright(c) 2000-2004, BlitzCoder. All Rights Reserved.
Code software created by Krylar's Kreations