Countdown.bas in FB
Forum » ASCII board. / ASCII programming. » Countdown.bas in FB
started by: harmonvharmonv
on: 1195388641|%e %b %Y, %H:%M %Z|agohover
number of posts: 2
rss icon RSS: new posts
summary:
Retro2FB submission
Countdown.bas in FB
harmonvharmonv 1195388641|%e %b %Y, %H:%M %Z|agohover
' =============================================
' =                 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
unfold Countdown.bas in FB by harmonvharmonv, 1195388641|%e %b %Y, %H:%M %Z|agohover
Re: Countdown.bas in FB
EKVirtanenEKVirtanen 1195394155|%e %b %Y, %H:%M %Z|agohover

Thanks. This is neat one.
You can add it yourself in wiki if you like ;) But i cando it too, no matter.

E.K.Virtanen

unfold Re: Countdown.bas in FB by EKVirtanenEKVirtanen, 1195394155|%e %b %Y, %H:%M %Z|agohover
new post
page_revision: 0, last_edited: 1181740773|%e %b %Y, %H:%M %Z (%O ago)
Unless stated otherwise Content of this page is licensed under Creative Commons Attribution-Share Alike 2.5 License.