Bacon
REM *** GUESS WHAT NUMBER IM THINKING ***
REM YET ANOTHER PORT OF THIS OLD CLASSIC. THIS TIME FOR BACON WWW.BASIC-CONVERTER.ORG
REM E.K.VIRTANEN 2010, HTTP://E-K-V.WIKIDOT.COM/
REM PUBLIC DOMAIN

SEED NOW

WHILE NOT(EQUAL(QUIT$, "Y")) DO
    CLEAR
    PRINT
    PRINT " *** GUESS WHAT NUMBER IM THINKING ***"
    PRINT " E.K.VIRTANEN HTTP://E-K-V.WIKIDOT.COM/"
    PRINT " 2010, PUBLIC DOMAIN"
    PRINT
    INPUT " DO YOU WANT TO SEE INSTRUCTIONS? (Y/N)", A$
    IF EQUAL(UCASE$(A$), "Y") THEN CALL INSTRUCTIONS
    ROUNDS = 0
    NUM2GUESS = RND*100/MAXRANDOM
    PRINT NL$, "OK, LET'S START THE GAME."
    'PRINT NUM2GUESS, ":::::::"
    PRINT
    WHILE NOT(EQUAL(QUIT$, "Y")) DO
    ROUNDS = ROUNDS + 1
    PRINT "NOW IS ROUND NUMBER: ", ROUNDS
    IF GUESSED ISNOT 0 THEN PRINT "YOUR LAST GUESS WAS: ", GUESSED
    INPUT NL$, "WHATS YOUR GUESS: ", GUESSED
    IF GUESSED > 0 AND GUESSED < 101 THEN
        IF GUESSED < NUM2GUESS THEN PRINT "TRY HIGHER..."
        IF GUESSED > NUM2GUESS THEN PRINT "TRY SMALLER..."
        IF GUESSED IS NUM2GUESS THEN
        PRINT "HOORAY!!!! YOU GOT IT."
        PRINT "IT TOOK ", ROUNDS, " ROUNDS TO GUESS RIGHT NUMBER."
        QUIT$ = "Y"
        END IF
    ELSE
        PRINT "OK, SO GIVE UP THEN YOU LOOSER."
        QUIT$ = "Y"
    END IF
    WEND
WEND
END

SUB INSTRUCTIONS
    LOCAL a
    CLEAR
    PRINT
    PRINT "IN THIS GAME, THE GOAL IS CLEAR."
    PRINT "COMPUTER CHOOSES ONE NUMBER BETWEEN 1 AND 100"
    PRINT "YOUR MISSION IS TO SOLVE OUT, WHICH NUMBER COMPUTER IS THINKING AT."
    PRINT
    PRINT "IN EACH ROUND, YOU CAN GUESS ONE NUMBER."
    PRINT "COMPUTER THEN TELLS, IS YOUR GUESS HIGHER OR SMALLER THAN NUMBER IT CHOSE."
    PRINT "ONCE YOU GOT THE RIGHT NUMBER GUESSED, GAME ENDS."
    PRINT
    PRINT "IF YOU WANT TO GIVE UP, JUST CHOOSE A NUMBER SMALLER THAN 1 OR HIGHER THAN 100."
    PRINT "NOW PRESS A KEY TO PLAY THE GAME."
    a = GETKEY
END SUB
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-Share Alike 2.5 License.