Read the Manual
You've learned a lot. If you've made it through this far,
and you are still having fun, then it's time to make up some
of your own programs. QBASIC's help is what you should read
through whenever you are curious about everything else QBASIC
can do. It can do a lot more than what I've shown you in
this book.
Some of the samples that follow may do things that you haven't
seen mentioned in the book. See if you can find out what these
new things are by looking them up in the help that comes with
QBASIC.
Number Guesser
In this game, the computer picks a number between 1 and 10.
You have to try and guess the number.
CLS RANDOMIZE TIMER PRINT "Welcome to Number Guesser" PRINT "I'm thinking of a number between 1 and 10." Number = INT(RND * 10 + 1) DO INPUT "What is your guess? ", Guess IF Guess = Number THEN PRINT "Correct!" EXIT DO ELSE PRINT "Try again" END IF LOOP
Source: http://jpsor.ucoz.com |