Countdown
' =============================================
' =                 Countdown                 =
' =     Original program by Mark Chambers     =
' =     from BASIC Computer Games Vol. II     =
' =         TRS-80 Edition - page 46          =
' = Creative Computing Morristown, New Jersey =
' =============================================
'    FreeBasic version by Harmon V.
'    Public Domain

Dim As Integer A, N, T, X, game
Dim AS String YesNo, Message

Screen 12
Do
    Cls
    Color 14, 0
    Print : Print
    Print Tab(30); "C O U N T D O W N"
    Print
    Print
    print
    Color 15, 0
    print tab(10); : input "Hit <Enter> to start";YesNo
    A = int(10*rnd(1))
    N = 0 : T = 0
    print
    print "You have activated the self-destruct sequence"
    print "in this school.  If you wish, you may stop the"
    print "countdown.  To do so, just type in the correct"
    print "number, which will stop the countdown."
    print "The number is from 0 to 9."
    print
    print "Please Hurry!  There is no time to waste!!!!"

    game=0
    while game=0
        print : input "What'll it be? "; X
        if T=4 then game =-1 : exit while
        if X=A then game = 1 : exit while
        if X<A then print "Too small !!!!  ";
        if X>A then print "Too big !!!!  ";
        print "Your number does not compute."
        T = T + 1
        print "Please try again !!!"
        if T=2 then print "Time grows short, please hurry !!!!"
        if T=3 then
            print "Hurry, the Count-down is approaching zero !!!!!"
        end if
    wend
    print
    if game<0 then
        print ,"\\\\\|/////"
        print ,"> B-O-O-M <"
        print ,"/////|\\\\\"
        print
        print "   You died a hero's death."
        print "Your funeral was well-attended."
    else
        print ,"Correct!!!!!"
        print ,"The countdown has stopped."
        print ,"You have saved the school !!"
        print
        print "    *** Congratulations ***"
        print "(Have you seen your shrink lately?)"
    end if
    Print : Print "Do you want to play again? ";
    Do : YesNo = Inkey$ : Loop Until YesNo<>""
Loop While Ucase(YesNo)="Y"
END
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-Share Alike 2.5 License.