Classic Computer Magazine Archive A.N.A.L.O.G. ISSUE 78 / NOVEMBER 1989 / PAGE 26

Survey Sweepstakes

BY ALBERT BAGGETTA

    In Survey Sweepstakes you play against an egotistical adversary-a built-in obnoxious opponent who affectionately calls himself "Knowing Norman." He has a carnival-barker personality and is the kind of player you'd like to kick in the pants. There is also a third party in this game: the computer. The computer is in charge of the game. It selects the questions, acts as referee and keeps track of all the calculations and displays.
    The computer has conducted a survey in order to discover such things as, for example, the five most popular drinks. (Oh, you didn't know that computers„take a little nip once in a while?) The Atari pits you against Norman and challenges you to name three of the favorites in each round. Pretty easy, huh? Correct answers get you points; incorrect answers get points for the opponent.

PLAYING THE GAME
    First, run the file SWEER.PRG (use low resolution), and you will see a file selector from which you may choose a question file. (Even Vanna and Pat don't let you do this.) A sample file of 75 questions is on this month's disk. Later in this article, I will tell you how to create your own. For now, select the Click QUEST.SWP file. You will then see the questions loading into memory.
    After the questions have loaded, you'll see the set-up screen, where you'll find Knowing Norman and be asked to enter your name for this game. In subsequent games you can just hit Return, because your name will already be entered., Otherwise, you may enter any name up to 25 characters long. To correct any mistakes, use the backspace key. When you're done, press Return. Now you will be asked if you would like the answers revealed. If you select "Y," you'll see the computer's answers after every round. If you enter "N," you will not be given any answers during the game, which will keep you from memorizing them. Answer accordingly, and Press Return.
    You will now be told the number of rounds you'll be playing. The computer will select anywhere from five to ten rounds. Don't worry. If you get tired of playing, there's a way to leave the game before it's over. I'll get to that later.
    The screen will pause for a few seconds, and then you'll be sent to the main play screen. Before starting play, take a close look at the screen. You will see two black windows outlined in white. The left window is yours (see your name over it?). The right window belongs to Norman. You can see his picture and name over this box. The long white window toward the bottom of the screen is where you'll read the polled questions. These questions have been created and secured by the mythical BriceWaterhose, Inc. You can begin play by pressing the return key.
    When you press Return, you'll see a new display appear at the bottom of the screen. It consists of four indicators arranged as follows:   < RIGHT >   < WRONG >   < ILLEGAL >   <TIME INDICATOR >. I will explain these as we progress through the game. At the top of the screen (in the center) you'll find the number of the current round. This number will increase throughout the game until you have played all of the allowed rounds.
    The Brice Waterhose window clears, and a question appears. The question format is the same throughout the game. You'll be asked to identify three of the computer's five most popular selections.
    You will always play first. (This advantage will, of course, be offset by an advantage Norman has.) The border around your box will pulse, signaling you to type in your first answer. There are several restrictions you need to be aware of here. First, you may use only 16 characters to answer (including spaces between words). Second, you may enter your answer in all lowercase, or use uppercase for the first character only. Acronyms are the only exception here. These must be entered in uppercase only. For example, you should enter "Young Men's Christian Association" as "YMCA" to get a correct answer. After you enter your answer, press Return. If you press Return without entering anything, the move will be interpreted as a wrong answer.
    Let's take a look at those indicators at the bottom of the screen. When you give a correct answer, the appropriate indicator will flash and ten points will be added to your score. (Your score is displayed at the bottom of your window.) If you give a wrong answer, points will be added to your opponent's score. If you try to give the same answer twice, or if you try to use an answer given by your opponent, the "illegal" indicator will flash. There's no penalty for an illegal answer; you will simply be reprimanded, your answer will be cleared and you will have to enter something else.
    To-create some suspense, I have added a timer. You'll notice that when your window starts pulsating, the time in the lower-right of the screen starts dropping from ten to zero. Finish typing your answer before the timer reaches zero; otherwise, you will lose ten points to your opponent.
    After judgment has been passed on your answer, the computer switches control to Norman's window. Norman will enter his answer after he has had time to "think." (While Norman is a state-of-the-art opponent, he is a slow and sloppy typist. However, he does make every attempt to be accurate, so he will correct any typos he makes. Being a novice actually makes him a little more human.)
    There are a few other facts you should know about scoring and how the game is played. There are two types of games: the normal game and the bonus game. In a normal game the award is ten points. In a bonus game (announced by a flashing sign in the upper-left corner of the screen) the prize is 20 points for each correct answer. Points, by the way, are multiplied by a random figure and accumulated to arrive at a sweepstakes prize, awarded at the end of the game.
    Each question has three of five possible answers. But each player does not have an infinite number of guesses. Four guesses are allotted each player, with one additional guess awarded for each correct answer. Wrong answers are costly, even in a regular game. If a player cannot answer a question correctly, he not only loses the awarded points. but the lost points are added to the opponent's score.
    Remember the timer I mentioned earlier? When the meter runs out for you, good of Norman receives ten points (20 in a bonus round). Unfortunately for you, Norman is not subject to this penalty when his timer runs down. ("Not fair!" you say. Well, remember that little advantage you had by starting the game?)
    Each round will eventually come to an end. Either one of the players will guess three of the correct answers, or the round allotment will be used up by each player. Whoever finishes the round will gain an additional 20 points.
    One other rule of play must be mentioned. Each player has the right to challenge at least once in each round. If, for example, you are not sure of an answer, simply type in the word "Challenge." Norman will then have to come up with theAnswer. If he answers correctly, however, he gets the points. If he does not, you will receive them.



    At the end of each round, applause will be given in the form of a vibrating screen, identifying the leader up to that point. At the close of the game, another colorful screen will announce the final winner, along with the money accumulated in the sweepstakes. The player will also be given the option to end play or start another game.
    I mentioned earlier that the computer will determine how many rounds will be played in each game. If you get tired of playing or are unexpectedly called away, you may conclude a game by typing the word "Quit" during your turn. When you hit Return, you will be sent to the final winner screen, where you will have the option of ending the game.

CREATING QUESTION FILES
    After playing with the default questions (found in the QUEST.SWP file on the magazine disk), the game becomes easy to beat, so you might like to make up some new questions of your own. The games can be tailored in this way toward specific subject areas or degrees of expertise and may be played by your friends.
    A question file is an ASCII file that can be created with most word processors or text editors. There is, however, a definite format to the file that must be followed.
    To make a file, the first item you must type is the number of questions you will create. You may put this information in later if you are not yet sure of the number of questions. After this, press Return only once. Next, type your first question. This must be two lines of no more than 40 characters each. Press Return at the end of each question line.. It is best to organize each question to fit on two lines. However, if you do not need two lines for your question, just press Return to add a blank second line.
    Now you need to enter ten possible answers for this question. The first five must be acceptable answers. These can be anything you want. The second set of five answers must be wrong and will be used by Norman for alternative guesses. None of these should be the same as the first five entered, and none of them should be correct answers. The first letter of each of the answers should be capitalized and the remainder in lowercase. Each of these ten answers must be entered on a separate line and followed by a Return.
    To make this a little clearer, let's take a look at the setup for the beginning of the default file on the magazine disk:

75
Our computers have polled for the five most popular colors. Identify three to win.
Red
Green
Blue
Orange
Yellow
Black
Purple
Pink
Burgundy
Tan
Which three of five board games have proved most popular in our polls?
Monopoly
Life
Scrabble
Clue
Checkers
Chess
Backgammon
Beat the Clock
Boggle
Othello

    When you save your questions as an ASCII file, you may use any filename for the first eight characters. But the extender must be .SWP. If the file does not load properly, go back and check that you have followed the format carefully. Creating the questions can be time-consuming and requires some invention, but it can be fun and educational. I found the almanac and encyclopedia to be of great help. Within a short time, you can have an informative collection of questions and a whole new game to offer your friends and relatives.

Albert Baggetta

    Albert Baggetta is an English teacher and a professional guitarist. He lives in Agawam, Massachusetts, with his wife, Beverly, and his two children. He frequently can be found wandering the ST SIG on DELPHI.


Rem *************************************
Rem *                                   *
Rem *      Survey Sweepstakes           *
Rem *                                   *
Rem *      bg A. Baggetta               *
Rem *      Copyright 1989               *
Rem *      bg ANALOG Computing          *
Rem *                                   *
Rem *************************************
Dim Oldcolri(15),Oldcolrr(157,Oldcolrg(15),Oldcolrb(15)
Dim Name$(9),Nv(10),Chs$(11)
Dim Q0$(100),Q1$(100),I0$(100),I1$(100),I2$(100),I3$(100),I4$(100)
Dim I5$(100),I6$(100),I7$(100),I8$(10O),I9$(100)
'
If Xbios(4)<>0
  Alert 3,"Low Rez Only",1,"Sorry",Dummy%
  End
Endif
@Colr_get
Round=0
Sr=99
Turn=0
Sound 1,0
Wave 1,0
Setcolor 4,2,1,4
Setcolor 10,7,7,7
Setcolor 9,7,7,7
Print At(14,2):"Select A File"
@Lod_file
If Ed=1 Then
  Goto Finish
Endif
Hidem
Storage$=""
Your_name$="------------------"
Topgame:
If Round=Sr Then
  @Winner_screen
  If Ik$="Y" Or Ik$="y" Then
    Turn=0
    Ik$=""
    Round=0
    Sr=99
    Goto Topgame
  Endif
  If Ik$="N" Or Ik$="n" Then
    Cls
    Goto Finish
  Endif
Endif
@Opening
@Place_question
Leave=0
Repeat
  If C_t_y=1 Then
    @Input_your_answers
  Endif
  '
  ' quit
  '
  If Ik$="Y" Or Ik$="y" Then
    Turn=0
    Ik$=""
    Round=0
    Sr=99
    Goto Topgame
  Endif
  If Ik$="N" Or IkS="n" Then
    Cls
    Goto Finish
  Endif
  '
  If C_t_n=1 Then
    @Input_norman_answer
  Endif
Until Leave=1
If Rev$="Y" Or Rev$="y" Then
  Prbox 10,60,150,150
  Prbox 160,60,300,150
  Ancol=3
  Anrow=9
  For Blank=9 To 17
    Print At(3,Blank):"                "
  Next Blank
  Print At(Ancol,Anrow):"Correct Answers"
  Anrow=Anrow+l
  For Ani=0 To 4
    Print At(Ancol,Anrow+(Ani+l));Chs$(Ani)
  Next Ani
  Print At(Ancol,Anrow+(Ani+l)+2);"**ress Return**"
  Repeat
  Until Inkey$<>""
Endif
Leave=0
Goto End_round
'
Face_data:
Data 0,0,11,0,11,0,17,3,17,3,25,11,25,11,29,23,29,23,31,20,31,20,33,19
Data 33,19,36,20,36,20,37,22,37,22,36,26,36,26,34,29,34,29,30,31,30,31
Data 29,39,29,39,27,47,27,47,22,52,22,52,17,54,17,54,9,55,9,55,2,55,2,55
Data -6,54,-6,54,-11,52,-11,52,-16,47,-16,47,-18,39,-18,39,-19,31,-19,31
Data -23,29,-23,29,-24,26,-24,26,-24,22,-24,22,-23,20,-23,20,-22,19,-22,19
Data -20,20,-20,20,-18,23,-18,23,-14,10,-14,10,-6,3,-6,3,0,0
' brows
Data -11,22,-7,20,-7j20,-3,20,-3,20,0,20,0,20,2,22
Data 9,22,11,21,11,21,14,20,14,20,10,20,10,20,22,22
' glasses
' bridge
' left view
Data -18,22,-10,24,-10,24,21,25,21,25,29,22
Data -10,24,-12,27,-12,27,-12,30,-12,30,-11,33,-11,33,-9,34,-9,34,-5,34
Data -5,34,0,30,0,30,1,27,1,27,1,24
' glasses
' right view
Data 10,24,10,27,10,27,11,30,11,30,16,34,16,34,20,34,28,34,22,33,22,33
Data 23,30,23,30,23,27,23,27,21,25
' nose
Data 0,30,0,33,0,33,-1,36,-1,36,-3,38,-3,38,-4,40,-4,40,-1,41,-1,41
Data 4,42,4,42,7,42,7,42,12,41,12,41,15,40,15,40,14,38,14,38,12,36,12,36
Data 11,33,11,33,11,30
' smile mouth
Data -11,40,-5,45,-5,45,2,47,2,47,9,47,9,47,16,45,16,45,22,40
' tooth
Data -2,46,-2,49,-2,49,2,49,2,49,2,47
'
Procedure Draw-faces
  Color 8
  Restore Face_data
  Repeat
    Read C0%,R0%,C1%,R1%
    Line C%+C0%/2,R%+R0%/2,C%+C1%/2,R%:+R1%/2
  Until C0%=2 And R0%=49 And C1%=2 And R1%=47
  Plot C%-7/2,R%+28/2    ! Place Knowing Norman's eyes
  Plot C%-6/2,R%+28/2
  Plot C%+17/2,R%+28/2
  Plot C%+18/2,R%+28/2
  Deffill 9,2,8
  Fill C%+5,32
  Deffill 3,2,8
  Fill C%-5/2,R%+29/2
  Fill C%+19/2,R%+29/2
  Deffill 12,2,8
  Fill C%+2/2,R%+27/2
  Deffill 0,2,8
  Fill C%+28/2, R%+25/2
Return
'
'
Procedure Smile
  Graphmode 2
  Restore Dt0
  R%=30
  C%=225
  Repeat
    Read C0%,RO%,C1%,R1%
    Line C%+C0%/2,R%+R0%/2,C%+C1%/2,R%+R1%/2
  Until C0%=2 And R0%=49 And C1%=2 And R1%=47
  Dt0:
  Data -11,40,-5,45,-5,45,2j47,2,47,9,47,9,47,16,45,16,45,22,40
  ' tooth
  Data -2,46,-2,49,-2,49,2,49,2,49,2,47
Return
'
Procedure Sadness
  Restore Dtl
  R%=30
  C%=225
  Repeat
    Read C0%,R0%,C1%,R1%
    Line C%+C0%/2,R%+R0%/2,C%+C1%/2,R%+R1%/2
  Until C0%=16 And R0%=45 And C1%=22 And R1%=47
  Dt1:
  Data -11,47,-5,45,-5,45,16,45,16,45,22,47
Return
'
'
' keep the old color pallett
'
Procedure Colr_get
  For I%=0 To 15
    @Vq_color(I%)
    Oldcolri(I%)=I%
    Oldcolrr(I%)=R%
    Oldcolrg(I%)=G%
    Oldcolrb(I%)=B%
  Next I%
Return
'
Procedure Vq_color(I%)
  Dpoke Contrl,26
  Dpoke Contrl+2,0
  Dpoke Contrl+4,0
  Dpoke Contrl+6,2
  Dpoke Contrl+8,0
  Dpoke Intin,I%
  Dpoke Intin+2,1
  Vdisys
  R%=Dpeek(Intout+2)
  G%=Dpeek(Intout+4)
  B%=Dpeek(Intout+6)
Return
'
' restore old colors and end
'
Finish:
For I%=0 To 15
  In%.=Oldcolri(I%)
  R%=Oldcolrr(I%)
  G%=Oldcolrg(I%)
  B%=Oldcolrb(I%)
  Gosub Vr_color(In%,R%,G%,B%)
Next I%
End
'
Procedure Vr_color(In%,R%,G%,B%)
  Dpoke Contrl,14
  Dpoke Contrl+2,0
  Dpoke Contrl+6,4
  Dpoke Intin,In%
  Dpoke Intin+2,R%
  Dpoke Intin+4,G%
  Dpoke Intin+6,B%
  Vdisys
Return
'
Procedure Opening
  Cls
  Reveal=0
  Ang=0
  Mik=0
  If Turn=0 Then
    Yscr=0
    Nscr=0
    Deffill 4,2,19
    Color 4
    Box 0,0,310,199
    Box 40,25,270,170
    Fill 5,5
    Print At(10,6);"Hi, I'm      Norman!"
    C%=150
    R%=30
    @Draw_faces
    Deftext 4,4,0,6
    Text 77,168,"Survey Sweepsteaks"
    Print At(10,10):"Your name, please: ";
    Print At(12,13):Your_name$
    Print At(10,13);
    Form Input 20,New_name$
    If New_name$="" Then
      New-name$=Your_name$
    Else
      Your_name$=New_name$
    Endif
    Print At(10,15):"Reveal Answers? Y/N"
    Leap:
    Print At(30,15);
    Form Input 1,Rev$
    If Rev$<>"Y" And Rev$<>"y" And Rev$<>"N" And Rev$<>"n" Then
      Print At(30,15):"  "
      Goto Leap
    Endif
    Asr=5
    Bsr=10
    Sr=Int(Rnd*(Bsr-Asr+1))+Asr
    Print At(10,17):"      Rounds: "
    Print At(10,18);"   In This Game ":Sr
    Pause 180
  Endif
  Used$=""
  Bonus=0
  Chance%=0
  Chance2%=0
  Ritechk%=0
  Ritechk2%=0
  Col%=2
  Row%=10
  Coln%=22
  Rown%=10
  If Turn=0 Then
    Deffill 4,2,8
    Pbox 0,0,318,280
    Deftext 7,4,0,24
    Graphmode 2
    Text 19,22,"Survey Sweepstakes"
    Deftext 6,4,0,24
    Text 20,23,"Survey Sweepstakes"
    C%=225                            ! Place Norman Face
    R%=30
    @Draw_faces
    Deftext 8,0,0,4
    Text 20,55,Your_name$
    Text 170,55,"Knowing"
    Text 245,55,"Norman"
    Deffill 1,2,0        ! Define two text windows in black
    Color 10
    Rbox 159,59,301,151  ! Outline Norman's box
    Prbox 160,60,300,150
    Color 11
    Rbox 9,59,151,151    ! Outline your
    Prbox 10,60,150,150
    Deffill 0,2,8
    Deftext 1,0,8,4
    Color 0
   
Rbox 9,154,301,186   ! Outline question box in pink
    Prbox 10,155,380,185 ! Define a white window for questions
    Get 0,0,310,199,Screen$
    Def text 8,0,0,4
    Text 165,150,"Score:"+Str$(Nscr)
    Text 15,150,"Score:"+Str$(Yscr)
    Def text 1,0,0,8
    Text 45,172,Chr$(158)+"rice "+Chr$(214)+"aterhose,"+Chr$(216)+"nc."
    Deftext 1,1,0,4
    Text 65,181,"Fictionalized Perlustrations"
    Deffill 0,2,8
    Pbox 108,35,190,45
    @In_song
    Deftext 1,1,0,4
    Text 115,42,"Press A Key"
    @Mug_it
    Repeat
    Until Inkeg$<>""
  Else
    Put 0,0,Screen$,3
  Endif
  @Comment
  @Mug_it
  Pause 100
  Deffill 1,2,8
  Prbox 160,60,300,150
  Turn=1
  Deffill 1,2,8
  Prbox 10,140,150,150
  Deftext 8,0,0,4
  Text 15,150,"Score: "+Str$(Yscr)
  Prbox 160,140,300,150
  Text 165,150,"Score: "+Str$(Nscr)
  '
  Deftext 1,0,0,4      ! Set up and identify the notice boxes
  Deffill 2,2,8
  Prbox 10,188,50,198
  Text 16,195,"RIGHT"
  Deffill 3,2,8
  Prbox 70,188,110,198
  Text 76,195,"WRONG"
  Deffill 6,2,8
  Prbox 130,188,210,198
  Text 148,195,"ILLEGAL"
  Deffill 1,2.8
  Color 2
  Rbox 270,188,298,198
  Color 3
  Rbox 271,189,289,197
  Prbox 272,190,288,196
  Deftext 2,0,0,4
  Text 225,196,"Timer->"
  Deftext 8,0,0,4
  Text 277,195,"  "
  Color 2
  Rbox 95,32,200,48
  Bn=lnt(Rnd*5)+1        ! If Bn=5 then we get a bonus round
  If Bn=5 Then           ! Twenty points instead of ten
    Graphmode 3
    Text 20,45,"BONUS"
    @Bonus sound
    For Rpt=1 To 6
      Text 20,45,"BONUS"
      Pause 10
    Next Rpt
    Bonus=1
  Endif
  Graphmode 2
Return
'
Procedure Place-question
  Deffill 0,2,8
  Round=Round+1
  Pbox 108,35,190,45
  Deftext 1,16,8,4
  Text 125,42,"ROUND "+Str$(Round)
  Deftext 1,0,0,4
  Color 15
  Rbox 9,154,301,186   ! Outline question box in pink
  Prbox 10,155,300,185 ! Define a white window for questions
  @Select_data
  Text 15,178,Quest0$
  Text 15,177,Questl$
  C_t_y=1
Return
'
Procedure Input_your_answers
  C_t_n=0
  C_t_y=0
  Leave=0
  '
  U1:
  Graphmode 2
  Response$=""
  Inc Chance%
  Yclr%=7
  Col%=2
  Lk%=0
  Print At(Col%-1,Row%):">"
  Print At(Col%+1,Row%):"            "
  Tmc=0
  Tm=11
  Deftext 0,0,0,4
  Deffill 1,2,8
  Repeat
    Inc Tmc
    If Tmc=1000 Then
      Sound 1,15,5,7
      Dec Tm
      Tmc=0
      Prbox 272,190,288,196
      If Tm=10 Then
        Text 274,195,Str$(Tm)
      Else
        Text 277,195,StrS(Tm)
      Endif
      If Tm=0 Then
        Graphmode 3
        Sound 1,0
        Setcolor 10,7,7,7
        Text 277,195,Str$(Tm)
        Pause 10
        Tm=11
        Tmc=0
        @Bounce_out
        Graphmode 2
        '
        ' If you cannot answer subtract 10 points from your score and
        ' give to norman. Show capitalization on norman window.
        '
        Yscr=Yscr-10
        Deffill 1,2,8
        Prbox 10,140,156,150
        Deftext 8,0,0,4
        Text 15,150,"Score: "+Str$(Yscr)
        Nscr=Nscr+10
        Prbox 160,140,300,150
        Deftext 8,0,0,4
        Text 165,150,"Score: "+Str$(Nscr)+" CAPITALIZED"
        @Capitalize sound
        Prbox 160,140,300,150
        Deftext 8,0,0,4
        Text 165,150,"Score: "+Str$(Nscr)
        '
        Graphmode 2
        C_t_n=1
      Endif
      If C_t_n=1 Then
        Goto Byebye
      Endif
    Endif
    X$=Inkey$
    If Lk%=16 Then
      Goto Out
    Endif
    Dec Yclr%
    Setcolor 10,Yclr%,YcIr%,YcIr%
    If Yclr%=0 Then
      Yc 1r%=7
    Endif
    If X$<>"" And X$<>Chr$(0) Then ! IF A LEGAL KEY IS PRESSED PRINT IT
      Inc Col%
      Print At(Col%,Row%):X$
      Response$=Response$+X$
      Inc Lk%.
    Endif
    If X$=Chr$(8) Then           !IF THE BACKSPACE KEY IS PRESSED ERASE NAME$
      For Ers%=3 To Col%.
        Print At(Ers%,Row%):" "
      Next Ers%
      Col%=2
      Response$=""
      Lk%=0
    Endif
    Sound 1,0
  Until X$=Chr$C13)            ! IF THE RETURN KEY IS PRESSED JUMP OUT
  Out:
  Sound 1,0
  Graphmode 2
  Prbox 272,190,288,196        ! FILL IN TIMER WITH BLANK
  Rn=-1
  Setcolor 10,7,7,7
  Response$=Mid$(Response$,l,Len(Response$)-1)
  If Mid$(Response$,1,1)>"\" And Mid$(Response$,1,1)<"<" Then
    Convt$=Mid$(Response$,1,1)
    Convt=Asc(Convt$)
    Convt=Convt-32
    MidS(ResponseS,1,1)=Chr$(Convt)
  Endif
  If Mid$(ResponseS,1,4)="Quit" Or Mid$(Response$,1,41="quit" Then
    @Winner screen
    Goto Byebye
  Endif
  If Mid$(Response$,1,5)="Chall" Or Mid$(Response$,1,5)="chall" And Mik=0 Then
    Mik=1
    Inc Row%
    C_t_n=1
    @Chall_music
    Goto Byebye
  Endif
  If Mid$(Response$,1,5)="Chal1" Or Mid$(Response$,1,5)="chall" And Mik=1 Then
    @Ill-sign
    Goto U1
  Endif
  If Mid$(Response$,1,4)=Mid$(Chs$(0),1,4) Then
    Rn=0
  Endif
  If Mid$(Response$,1,4)=Mid$(Chs$(1),1,4) Then
    Rn=1
  Endif
  If Mid$(Response$,1,4)=Mid$(Chs$(2),1,4) Then
    Rn=2
  Endif
  If Mid$(Response$,1,4)=Mid$(Chs$(3),1,4) Then
    Rn=3
  Endif
  If Mid$(Response$,1,4)=Mid$(Chs$(4),1,4) Then
    Rn=4
  Endif
  If Mid$(Response$,1,4)=Mid$(Chs$(5),1,4) Then
    Rn=5
  Endif
  If Mid$(Response$,1,4)=Mid$(Chs$(6),1,4) Then
    Rn=6
  Endif
  If Mid$(Response$,1,4)=Mid$(Chs$(7),1,4) Then
    Rn=7
  Endif
  If Mid$(Response$,1,4)=Mid$(Chs$(8),1,4) Then
    Rn=8
  Endif
  If Mid$(Response$,1,4)=Mid$(Chs$(9),1,4) Then
    Rn=9
  Endif
  If Rn<0 Or Rn>9 Then
    Goto Jumpover
  Endif
  '
  ' It it has been used catch it and offer another chance
  '
  @Used_check
  If Cku=1 Then
    @Ill_sign
    Dec Chance%
    Goto U1
  Endif
  Used$=Used$+Str$(Rn)
  Cku=0
  '
  Jumpover:
  @Check_answers
  If Right%=1 Then
    @Correct
    Inc Ritechk%
    Inc Row%
    If Bonus=1 Then     ! If bonus round give an extra 18 points
      Yscr=Yscr+20
    Else
      Yscr=Yscr+10
    Endif
    Deffill 1,2,8
    Prbox 18,140,158,150
    Deftext 8,0,0,4
    For Rs=1 To 5
      Graphmode 3
      Text 15,150,"Score: "+Str$(Yscr)
      Pause 10
    Next Rs
    Graphmode 2
    C_t_y=1
  Else
    @Incorrect
    Inc Row%
    If Bonus=1 Then
      Nscr=Nscr+20
    Else
      Nscr=Nscr+10
    Endif
    Deffill 1,2,8
    Prbox 160,148,300,150
    Deftext 8,0,0,4
    For Rs=1 To 5
      Graphnode 3
      Text 165,150,"Score: "+Str$(Nscr)
      Pause 10
    Next Rs
    Graphnode 2
    C_t_n=1
 
Endif
  '
  ' Check to see if your number of chances have been alloted or
  ' If you have three correct answers to win
  '
  If Ritechk%=3 Then
    Leave=1
    Yscr=Yscr+20
    Deffill 1,2,8
    Prbox 10,140,150,150
    Def text 8,0,0,4
    For Rs=1 To 5
      Graphmode 3
      Text 15,150,"Score: "+StrS(Yscr)
      Pause 18
    Next Rs
    Graphnode 2
    Goto Byebye
  Endif
  If Chancex=4 Then
    Leave=1
  Endif
  Byebye:
  Graphnode 2
Return
'
Procedure Input_nornan_answer
  C_t_n=0
  C_t_y=0
  @Mug_it
  Leave=0
  For Trpt=1 To 4
    Graphnode 3
    Deftext 0,0,0,4
    Text 230,149,"MY TURN!!"
    Pause 20
  Next Trpt
  Inc Chance2%
  Response$=""
  U2:
  Rn=0
  Coln%=22
  Rn=Int(Rnd*15)
  If Rn>9 And Ang=0 Then
    Response$="Challenge      "
    Ang=1                       ! Allow only one challange
    Coln%=21
    Ad%=0
    Print At(Coln%+1,Rown%):"               "
    For Prtnm=l To Len(Response$)
      Inc Ad%
      Print At(Coln%+Ad%,Rown%);Mid$(Response$,Prtnm,1)
      Pause Int(Rnd*20)+1
    Next Prtnm
    Inc Rown%
    C_t_y=1
    @Chall_music
    Goto Byebye2
  Endif
  If Rn>9 And Ang=1 Then
    Goto U2
  Endif
  '
  ' Do not allow any repeats of the number
  '
  @Used_check
  If Cku=1 Then
    Goto U2
  Endif
  Used$=Used$+StrS(Rn)
  Cku=0
  '
  Response$=Chs$(Rn)
  Pz=Int(Rnd*12000)+1
  Tmc=0
  Tm=11
  Graphmode 2
  Deftext 0,0,0,4
  Text 230,149,"Hmmmmmmm?"
  For Pzrpt=1 To Pz
    Tmc=Tmc+1
    If Tmc=1000 Then
      Sound 1,15,5,7
      Tm=Tm-1
      Tmc=0
      Prbox 272,190,288,196
      If Tm=10 Then
        Text 274,195,Str$(Tm)
      Else
        Text 277,195,Str$(Tm)
      Endif
      If Tm=0
        Graphmode 3
        Text 230,149,"Hmmmmmmm?"
        Graphmode 2
        Sound 1,0
        For Rptmr=1 To 3
          Graphmode 3
          Text 277,195,Str$(Tn)
          Pause 10
        Next Rptmr
        Graphmode 2
        Tm=10
        Tmc=0
        @Bounce_out
        C_t_y=1
        If C_t_y=1 Then
          Goto Ot
        Endif
      Endif
    Endif
    Ot:
    Sound 1,0
    Exit If C_t_y=1
  Next Pzrpt
  If C_t_y=1 Then
    Goto Byebye2
  Endif
  Graphmode 3
  Text 230,149,"Hmmmmmmm?"
  Sound 1,0
  Coln%=21
  Ad%=0
  Fka=65
  Fkb=122
  Print At(Coln%+1,Rown%):"                 "
  Stln=Len(Response$)
  For Prtnm=l To Stln
    Inc Ad%
    Print At(Coln%+Ad%,Rown%):Mid$(Response$,Prtnm,1)
    Pause Int(Rnd*40)+1
    Fk=lnt(Rnd*(Fkb-Fka+ll)+Fka    ! Norman makes typing errors and
    Fkk=Int(Rnd*5)+1               ! corrects them.
    If Fkk=5 And Stln<>Prtnm Then
      Print At(Coln%+Ad%.+l,Rown%):Chr$(Fk)
      Pause Int(Rnd*40)+1
    Endif
  Next Prtnm
  Pause 80
  '
  @Check_answers
  If Right%=1 Then
    @Correct
    Inc Ritechk2%
    Inc Rown%
    If Bonus=1 Then
      Nscr=Nscr+20
    Else
      Nscr=Nscr+10
    Endif
    Deffill 1,2,8
    Prbox 160,140,300,150
    Deftext 8,0,0,4
    For Rs=1 To 5
      Graphmode 3
      Text 165,150,"Score: "+Str$(Nscr)
      Pause 10
    Next Rs
    Graphmode 2
    C_t_n=1
  Else
    @Incorrect
    Inc Rown%
    If Bonus=1 Then
      Yscr=Yscr+20
    Else
      Yscr=Yscr+10
    Endif
    Deffill 1,2,8
    Prbox 10,140,150,150
    Deftext 8,0,0,4
    For Rs=1 To 5
      Graphmode 3
      Text 15,150,"Score: "+Str$(Yscr)
      Pause 10
    Next Rs
    Graphnode 2
    C_t_y=1
  Endif
  If Chance2%=>4 Then
    Leave=1
    Goto Byebye2
  Endif
  If Ritechk2%=3 Then
    Leave=1
    Deffill 1,2,8
    Prbox 160,140,300,150
    Deftext 8,0,0,4
    For Rs=1 To 5
      Graphnode 3
      Text 165,158,"Score: "+Str$(Nscr)
      Pause 10
    Next Rs
    Graphmode 2
  Endif
  Byebye2:
  Graphnode 2
Return
'
Procedure Correct
  Sound 1,0
  Graphnode 2
  Def text 1,0,0,4
  Deffill 2,2,8
  For J%=1 To 5
    Sound 1,10,9,5,2
    Prbox 10,188,50,198
    Pause 5
    Text 16,195,"RIGHT"
    Sound 1,10,4,5,15
  Next J%
  Sound 1,0
  Right%=0
Return
'
Procedure Incorrect
  Sound 1,0
  Wave 1,0
  Graphnode 2
  Deftext 1,0,0,4
  Deffill 3,2,8
  Wave 1,1,14,35
  For J%=1 To 5
    Prbox 70,188,110,198
    Pause 5
    Text 76,195,"WRONG"
    Pause 5
  Next J%
  Wave 1,0
Return
'
Procedure Check_answers
  Right%=0
  Wrong%=0
  For I%=0 To 4
    If Mid$(Chs$(I%),1,4)=Mid$(Response$,1,41 Then
      Right%=1
    Endif
  Next I%
Return
'
End_round:
Sound 1,0
Wave 1,0
Cls
DeffiI1 1,2,8
Prbox 0,48,320,170
Deftext 2,4,0,24
Text 50,100,"End of Round "+Str$(Round)
Deftext 3,4,0,6
If Yscr>Mscr Then
  Text 75,120,"The winner so far is "
  Text 80,135,Your_name$
  Text 80,150,Str$(Yscr)+" points"
Endif
If Nscr>Yscr Then
  Text 40,120,"Seems like Norman is winning."
  Text 40,135,Str$(Nscrl+" points"
Endif
If Nscr=Yscr Then
  Text 40,120,"Well, we have a tie so far."
  Text 40,135,StrS(Nscr)+" to "+Str$(Yscr)
Endif
Wave 1,1,12,300
Scrn%=7
For Srpt=1 To 20000
  Dec Scrn%
  If Scrn%=0 Then
    Scrn%=7
  Endif
  Setcolor 0,Scrn%,Scrn%,Scrn%
Next Srpt
Setcolor 0,7,7,7
Wave 1,0
Bonus=0
Goto Topgame
'
Procedure Ill_sign
  Sound 1,0
  Wave 1,0
  Graphnode 2
  Deftext 1,0,0,4
  Wave 1,1,8,100
  For Rpt%=1 To 5
    Deffill 6,2,8
    Prbox 130,188,210,198
    Pause 10
    Text 148,195,"ILLEGAL"
    Pause 10
  Next Rpt%
  Wave 1,0
  Graphnode 1
Return
'
Procedure Select_data
  Ss%=Int(Rnd*(Vbls-1))
  Ss$=Str$(Ss%)
  If Len(Ss$)<2 Then
    Ss$="0"+Ss$
  Endif
  Add_data=Add_data+l
  If Add_data=Vbls-1 Then
    Storage$=""
    Add_data=0
  Endif
  For Ex%=0 To Len(Storage$)
    If Mid$(Storage$,Ex%,2)=Ss$ Then
      @Select_data
    Endif
  Next Ex%
  Storage$=Storage$+Ss$
  Quest0$=Q0S(Ss%)
  Quest1S=Q1$(Ss%)
  Chs$(0)=I0$(Ss%)
  Chs$(l)=I1$(Ss%)
  Chs$(2)=I2S(Ss%)
  Chs$(3)=I3$(Ss%)
  Chs$(4)=I4$(Ss%)
  Chs$(5)=I5$(Ss%)
  Chs$(6)=I6$(Ss%)
  Chs$(7)=I7$(Ss%)
  Chs$(8)=I8S(Ss%)
  ChsS(9)=I9$(Ss%)
Return
'
Procedure Lod_file
  Ed=0
  Fileselect "a:\*.swp","Quest3.swp",Aa$
  Cls
  If Exist(Aa$) Then
    Open "I",#1,Aa$
    Input #1,A$
    Vbls=Val(A$)
    Print At(10,10):Aa$
    Print At(10,12);"Loading...."Vbls;" Questions"
    Print At(10,14);"Question #";
    For I%=0 To Vbls-1
      Print At(21,14):I%+1
      Input #1,A$
      Q0$(I%)=A$
      Input #1,A$
      Q1$(I%)=A$
      Input #1,A$
      I0S(I%)=A$
      Input #1,A$
      I1$(I%]=A$
      Input #1,A$
      I2$(I%)=A$
      Input #1,A$
      I3$S(I%)=A$
      Input #1,A$
      I4$(I%)=A$
      Input #l,A$
      I5$(I%)=A$
      Input #1,A$
      I6$(I%)=A$
      Input #1,A$
      I7$(I%)=A$
      Input #1,A$
      I8$(I%)=A$
      Input #1,A$
      I9$(I%)=A$
    Next I%
    Pause 100
  Else
    Alert 3," | |Missing Question File", 1,"END",Ab
    Ed=1
  Endif
  Cls
Return
'
Procedure Used_check
  Cku=0
  For Ex2%=1 To Len(Used$)
    If Mid$(Used$,Ex2%,1)=Str$(Rn) Then
      Cku=1
    Endif
  Next Ex2%
Return
'
Procedure Bounce_out
  Sound 1,0
  Wave 1,0
  For Drop=12 Downto 1
    Sound 1,10,Drop,4,1
  Next Drop
  Sound 1,0
  For Bounce=1 To 10
    For Up=1 To 3
      Sound 1,10,Up,4,1
    Next Up
    For Down=3 Downto 1
      Sound 1,10,Down,4,1
    Next Down
  Next Bounce
  Sound 1,10,1,1,10
  Sound 1,0
  Wave 1,0
Return
'
Procedure Winner_screen
  Graphnode 2
  Cls
  Sound 1,0
  Wave 1,0
  Deffill 1,2,8
  Prbox 0,40,320,170
  Deftext 2,4,0,24
  Text 100,100,"WINNER"
  Deftext 3,0,0,6
  If Nscr>Yscr Then
    Tval=Nscr*Int(Rnd*200)+1
    Tval$=Str$(Tval)
    Text 70,120,"Norman"
    Text 70,135,"$"+Tval$+"  "+Str$(Nscr)+" points"
    Nscr=0
    Tval=0
    Goto Cloz_up
  Endif
  If Yscr>Nscr Then
    Tval=Yscr*Int(Rnd*200)+1
    Tval$=Str$(Tval)
    Text 70,120,Your_name$
    Text 70,135,"$"+Tval$+"  "+Str$(Yscr)+" points"
    Yscr=0
    Tval=0
    Goto Cloz_up
  Endif
  If Yscr<>0 And Nscr<>0 And Yscr=Nscr Then
    Text 55,120,"Tie Game ... No winners here."
  Endif
  Cloz_up:
  Wave 1,1,12,300
  Scrn%=7
  Text 35,150,"<Y> to play again <N> to end"
  Repeat
    Dec Scrn%
    If Scrn%=0 Then
      Scrn%=7
    Endif
    Setcolor 0,Scrn%,Scrn%+2,Scrn%+4
    Ik$=Inkeg$
    Pause 5
    Until Ik$="Y" Or Ik$="y" Or Ik$="N" Or Ik$="n"
    Setcolor 0,7,7,7
    Wave 1,0
Return
'
Procedure Chall_music
  Sound 1,0
  Sound 2,0
  Sound 3,0
  Wave 7,0
  Restore C_major
  For G=1 To 5
    Read Ntl,Nt2,Nt3,Oct
    Sound 1,10,Ntl,5
    Sound 2,10,Nt2,5
    Sound 3,10,Nt3,5
    Wave 7,7,3,15000,10
  Next G
  C_major:
  Data 1,5,8,4
  C_minor:
  Data 1,8,4,4
  C_major_6:
  Data 1,5,10,3
  C_minor_7:
  Data 4,1,10,3
  C_7:
  Data 1,5,11,4
Return
'
Procedure In_song
  Restore Intro_song
  For Sn=1 To 9
    Del=5
    If Sn=3 Or Sn=6 Or Sn=9 Then
      Del=9
    Endif
    Read Xs
    Sound 1,10,Xs,4,Del
  Next Sn
  Sound 1,18,12,3
  Sound 2,10,3,4
  Sound 3,10,8,4
  Wave 7,7,3,8000,10
  Intro_song:
  Data 12,10,8
  Data 10,8,6
  Data 8,6,5
Return
'
Procedure Comment
  Coumt=Int(Rnd*10)+1
  If Coumt=1 Then
    Print At(22,12):" Ok, Pal...    "
    Print At(22,13):"Let's gooooo!! "
  Endif
  If Coumt=2 Then
    Print At(22,12):" Ok pushover   "
    Print At(22,13);"Get cookin!!!!!"
  Endif
  If Coumt=3 Then
    Print At(22,121;"Make out your  "
    Print At(22,131:"will yet???    "
  Endif
  If Comt=4 Then
    Print At(22,12);"Might as well  "
    Print At(22,13):"quit right now!"
  Endif
  If Comt=5 Then
    Print At(22,12):"Look out, kid.."
    Print At(22,13):"dis is war!!!  "
  Endif
  If Comt=6 Then
    Print At(22,12):"Scared, yet,   "
    Print At(22,13):"Pal???         "
  Endif
  If Comt=7 Then
    Print At(22,12):"Get your coffin"
    Print At(22,13);"ready!!        "
  Endif
  If Comt=8 Then
    Print At(22,12);"Your feelin' da"
    Print At(22,13):"heat now...??  "
  Endif
  If Comt=9 Then
    Print At(22,12):"Psssssssst!     "
    Print At(22,13):"Booooooooooo!.. "
  Endif
  If Comt=10 Then
    Print At(22,12):"Go back to grade"
    Print At(22,13):"school!!!       "
  Endif
Return
'
Procedure Mug_it
  Graphmode 2
  For Facerpt=1 To 3
    Sound 1,10,12,6,1
    Color 0
    @Smile
    Color 8
    @Sadness
    Pause 2
    Sound 1,10,1,6,1
    Color 0
    @Sadness
    Color 8
    @Smile
    Pause 2
  Next Facerpt
  Sound 1,0
Return
'
Procedure Bonus_sound
  For Decay=15 To 0 Step -3
    For Ups=1 To 12
      Sound 1,Decay,Ups,5,1
    Next Ups
  Next Decay
Return
'
Procedure Capitalize_sound
  For Cap=1 To 100
    For I=1 To 10
      Wave 1,1,1000,1
    Next I
    For I=10 To 1 Step -1
      Wave 1,1,1000,I
    Next I
  Next Cap
  Sound 1,0
  Wave 1,0
Return