'
' *********************************************************************
'                              W U Z Z L E R S
'                       A Word and Picture Puzzle Game
'                    yet another kidprg in GFA Basic from
'                               D.A. Brumleve
'                         Copyright 1989 by ST-LOG
' **********************************************************************
'                               Version 4.1
'                            February 9, 1989
' **********************************************************************
'                                REFERENCE
' **********************************************************************
' VARIABLES
' A%=dummy holding keyboard input
' Aa%=current x position of the mouse
' Aaa%
' Active_player%=0 (player one) or 1 (player two)
' Actual_count%=number of correct guesses toward completing the word
' Alpha$
' Alphabet_grid$=snapshot of the alphabet grid
' Already_chosen%()=array keeping track of letters already selected
' Alrt$
' Back%=value (0 or 1) indicates user's intention to exit a subprogram and return to the
'            Shell screen
' Bb%=current y position of the mouse
' Bbb%
' Blank_it%=value (0 or 1) indicates whether or not user wants to erase a picture
' Bpbaddr%
' Buf$
' Button%
' C$
' C%
' Cbutton%=current status of the mouse buttons
' Cc%=currently-selected drawing color
' Ccc%
' Clear_draw_options$=a snapshot of unselected drawing options for use in
'           clearing selections
' Col%
' Color_choice$=a snapshot of the three color choice rows (with none
'             selected) for use in erasing previous color selections
' Creation_screen$=snapshot of the Creation screen
' Current_screen$=a snapshot of the entire screen as it was before the
'            line was begun.  The snapshot is put upon the screen to
'            (in effect) erase a rubber shape/line or to restore the previous
'            picture or screen.
' Cx%
' Dev%=drive from which the program was loaded
' Df%
' Dt_color%(pixel_row%,pixel_column%)=an array storing the color number of
'               each pixel in the defined block in magnify mode
' Drw_type%=the type of drawing to be done:
'             0=Fill, 1=Freehand Drawing 2=Line 3=Large Dot Freehand Drawing
'             4=Frame 5=Circle
' Dummy%
' Dur%
' Dur1%
' Dur2%
' Dur3%
' File$=puzzle file, "wuzzlers.dat" (must be in same directory as program)
' File_number$
' File_number%
' Flled_it%
' Fll_style%
' Fll_type%
' First_dot%=indicates whether or not the first dot has been drawn (in draw mode)
' Got_one%
' Guess$=the user's guess for each letter
' Gx%=x-position of underlining
' Gx%()=x-position of text
' Gy%
' Here_goes%
' Hub_x%=x position of the hub of the circle
' Hub_y%=y position of the hub of the circle
' I$
' I%
' J%
' Jj%
' Just_loaded%=indicates whether or not the last action was to load a record.
' L$
' Last_aa%=previous x position of the mouse
' Last_bb%=previous y position of the mouse
' Length%
' Llx%=x position of upper left-hand corner of box around defined block
' Lly%=y position of upper left-hand corner of box around defined block
' Lsuccess%=indicates whether or not loading has been successful
' Ltter_count%=keeps track of the number of letters in the new word
' Lttr$(Ltter_count%)=string array representing each letter typed
' Lx%
' Ly%
' Magni_block$=a snapshot of the defined block in the draw box
' Magnified_it%=an indicator of whether or not any changes have been made
'               to the defined block while in magnify mode
' Magnify_grid$
' Main_screen$
' Mx%
' My%
' N%
' Nw_word$=the new word for which the picture will serve as a hint
' No_more%=value (0 or 1) indicates whether there are unused puzzles on the
'                "wuzzlers.dat" on disk
' Nt%
' Nt1%
' Nt2%
' Nt3%
' Oct%
' Oct1%
' Oct2%
' Oct3%
' P$
' Palette%()=array storing original color palette
' Play_game%=value (0 or 1) indicates whether the user is playing the game
'                or not
' Player_name$()=array storing input names of players
' Plx%
' Ply%
' Point_x1%=x position of the beginning point of shape/line to be drawn
' Point_x2%=x position of the end point of the shape/line drawn
' Point_y1%=y position of the beginning point of shape/line to be drawn
' Point_y2%=y position of the end point of the shape/line drawn
' Prx%
' Pry%
' Puz$
' Puzzle$()
' Puzzle%(Active_player%)=number of puzzles successfully solved
' Puzzle_piece%
' Puzzle_total$()
' Qy%
' R%
' Radius%=the radius of the circle
' Real_dir$=the original directory (must be root)
' Real_word$=the actual word the user is supposed to guess
' Recno%=record number of puzzle to be loaded/saved
' Record_already_chosen%()=array storing record numbers of puzzles which
'                have been displayed during a game
' Result%=result of checks for disk read/write errors
' Rez%=current screen resolution
' Rim_x%=x position of one point on the rim of the circle
' Rim_y%=y position of that same point on the rim of the circle
' Rr%
' Rubber_box$=a snapshot of the draw box prior to alteration of defined block
' Rx%
' Ry%
' Score$
' Score%(Active_player%)=score for this puzzle, figured as 9 minus the number of
'            incorrect guesses
' Shell_screen$=snapshot of the Shell screen
' Sizepuz%()
' Sizetotal%
' Strposit%
' Stx%
' Sty%
' Target_hit%=value (0 or 1) indicates whether the mouse in magnify mode
'            has been clicked in a permitted area.
' Tempnw_word$
' Temppuz$
' Total_score$()
' Total_score%(Active_player%)=the cumulative score of one player              !
' Two_player%=value (0 or 1) indicates a one- or two-player game
' Tx%
' Word_length%=the number of letters in the actual word
' Wrong_guess_count%=number of incorrect guesses
' Xx%
' Yes%
' Your_turn$
' Yy%
'
' *******************************************************************
'                               PROGRAM
' *******************************************************************
'
' **************************** INITIALIZE ***************************
Dim Palette%(15),Player_name$(1),Score%(1),Puzzle%(1),Puzzle_total$(1)
Dim Total_score$(1),Total_score%(1),Dt_color%(17,8),Gx%(12),Puzzle$(9)
Dim Sizepuz%(9),Lttr$(12),Already_chosen%(26),Record_already_chosen%(200)
Dev%=Gemdos(&H19)
Real_dir$=Dir$(Dev%+1)
File$="\wuzzlers.dat"
If Dir$(Dev%+1)<>""
  Alert 1," |You must use this program|from the ROOT directory of|your disk!",3,"Oops!",Dummy%
  End
Endif
Cls
@Check_rez
@Save_palette
Hidem
Graphmode 2
@Black_screen
@Shell_screen
Sget Shell_screen$
Cls
@All_screens
@Main_screen
Sget Main_screen$
Cls
@All_screens
@Creation_screen
Sget Creation_screen$
Get 171,0,316,62,Color_choice$
@Fill_puzzle_array
Cls
@Set_color
Sput Shell_screen$
Play_game%=0
Lsuccess%=0
Here_goes%=0
Showm
'
' *************************** SHELL SCREEN LOOP ****************************
Do
  @Let_go
  Repeat
    Mouse Xx%,Yy%,Button%
  Until Button%>0
  If Xx%>0 And Xx%<142 And Yy%>85 And Yy%<137
    Play_game%=1
    Back%=0
    @Clear_records
    Deffill 3,2,8
    Fill 1,86
    @Select_sound
    Pause 15
    @Black_screen
    Sput Main_screen$
    @How_many
    Total_score%(1)=0
    Total_score%(0)=0
    Puzzle%(1)=0
    Puzzle%(0)=0
    @Report_score
    If Two_player%=1
      Active_player%=Random(2)
    Endif
    @Play_game
    Play_game%=0
  Endif
  If Xx%>177 And Xx%<319 And Yy%>85 And Yy%<137
    Back%=0
    File_number%=1
    Deffill 12,2,8
    Fill 178,86
    @Select_sound
    Pause 15
    @Creation
  Endif
  If Xx%>83 And Xx%<225 And Yy%>147 And Yy%<199
    @Exit_alert2
    If Yes%=1
      Pause 15
      @Finale_sound
      Cls
      @Restore_palette
      End
    Else
      Sput Shell_screen$
    Endif
  Endif
Loop
'
' ************************* MAIN PLAY LOOP ********************************
Procedure Play_game
  Do
    If Two_player%=1
      If Player_name$(Active_player%)<>""
        Your_turn$=Player_name$(Active_player%)+", press PLAY for your puzzle!"
      Else
        Your_turn$="Player "+Str$(Active_player%+1)+", press PLAY for your puzzle!"
      Endif
    Else
      Your_turn$="    Press PLAY to load a puzzle!"
    Endif
    Deftext 3,0,0,6
    Text 10,35,Your_turn$
    @Let_go
    Repeat
      Mouse Mx%,My%,Button%
    Until Button%>0
    If My%>0 And My%<18
      If Mx%>0 And Mx%<52
        @Exit_alert
        If Yes%=1
          Back%=1
        Else
          Sput Current_screen$
        Endif
      Endif
      If Mx%>114 And Mx%<166
        Sget Current_screen$
        Deffill 11,2,8
        Fill 115,1
        @Select_sound
        @Help1
      Endif
      If Mx%>57 And Mx%<109
        @Clear_junk
        Sget Current_screen$
        Deffill 3,2,8
        Fill 58,1
        @Select_sound
        @Load_it
        If Lsuccess%=1
          @Guess_letters
        Else
          If Back%=1
            Goto Check_back
          Endif
          Sput Current_screen$
          Goto Check_back
        Endif
        Deffill 0,2,8
        Fill 58,1
        If Two_player%=1
          If Active_player%=1
            Active_player%=0
          Else
            Active_player%=1
          Endif
        Endif
      Endif
    Endif
    Check_back:
    Exit If Back%=1
  Loop
  Hidem
  Sput Shell_screen$
  Showm
Return
'
' ************************ INPUT LETTERS (PLAY) ****************************
Procedure Guess_letters
  Puzzle_piece%=Random(9)+1
  @Give_a_hint
  Word_length%=Len(Real_word$)
  Lx%=179
  For I%=1 To Word_length%
    Gx%(I%)=Lx%
    Add Lx%,11
  Next I%
  Wrong_guess_count%=0
  Wrong_guess_count%=0
  Deftext 1,0,0,13
  Lx%=180
  For I%=1 To Word_length%
    Text Lx%,137,"_ "
    Add Lx%,11
  Next I%
  For I%=1 To 26
    Already_chosen%(I%)=0
  Next I%
  A%=0
  Actual_count%=0
  Score%(0)=0
  Score%(1)=0
  Do
    If Two_player%=1
      If Player_name$(Active_player%)=""
        Your_turn$="Player "+Str$(Active_player%+1)+", guess a letter:"
      Else
        Your_turn$=Player_name$(Active_player%)+", guess a letter:"
      Endif
    Else
      Your_turn$="                Guess a letter:"
    Endif
    Deftext 3,0,0,6
    Text 58,35,Your_turn$
    Repeat
      Mouse Aa%,Bb%,Cbutton%
    Until Cbutton%>0
    @Let_go
    If Aa%>0 And Aa%<52 And Bb%>0 And Bb%<18
      @Exit_alert
      If Yes%=1
        Back%=1
      Else
        Sput Current_screen$
      Endif
    Endif
    If Aa%>114 And Aa%<166 And Bb%>0 And Bb%<18
      Sget Current_screen$
      Deffill 11,2,8
      Fill 115,1
      @Select_sound
      @Help1
    Endif
    If Aa%>177 And Aa%<312 And Bb%>44 And Bb%<101
      Got_one%=0
      Restore Alphabet_data
      For I%=1 To 26
        Read Lx%,Ly%,Alpha$,N%
        If Aa%>Lx% And Aa%<Lx%+15 And Bb%>Ly% And Bb%<Ly%+19 And Already_chosen%(I%)=0
          Guess$=Alpha$
          Already_chosen%(I%)=1
          Color 2
          Box Lx%,Ly%,Lx%+15,Ly%+19
          Deffill 0
          Pbox Lx%+1,Ly%+1,Lx%+14,Ly%+18
          For J%=1 To Word_length%
            If Guess$=Mid$(Real_word$,J%,1)
              Deftext 2,2,0,13
              Text Lx%+4,Ly%+15,Alpha$
              Deftext 2,0,0,13
              Text Gx%(J%),132,Mid$(Real_word$,J%,1)
              @Other_sound
              Inc Actual_count%
              Got_one%=1
            Endif
          Next J%
          If Got_one%=1
            @Clear_instructions
            @Guess_right
          Endif
          If Got_one%=0
            @Clear_instructions
            Deftext 14,2,0,13
            Text Lx%+4,Ly%+15,Guess$
            @Other_sound2
            @Guess_wrong
            Got_one%=2
            Inc Wrong_guess_count%
          Endif
          Color 3
          Box Lx%,Ly%,Lx%+15,Ly%+19
        Endif
        Exit If Got_one%=1 Or Got_one%=2
      Next I%
    Endif
    Exit If Back%=1
    Exit If Actual_count%=Word_length%
    Exit If Wrong_guess_count%=9
    Exit If Bb%>0 And Bb%<52 And Aa%>0 And Aa%<18
  Loop
  If Back%=1
    Goto No_more
  Endif
  If Bb%>0 And Bb%<52 And Aa%>0 And Aa%<18
    Goto No_more
  Endif
  @Display_puzzle
  If Actual_count%=Word_length%
    Inc Puzzle%(Active_player%)
  Endif
  Score%(Active_player%)=9-Wrong_guess_count%
  Score$="This Puzzle: "+Str$(Score%(Active_player%))
  Deftext 2,0,0,6
  Text 171,159,Score$
  Total_score%(Active_player%)=Total_score%(Active_player%)+Score%(Active_player%)
  @Report_score
  If Actual_count%=Word_length%
    Deftext 2,0,0,13
    Text 219,36,"W O W !"
    @Congrats_sound
  Endif
  If Wrong_guess_count%=9
    Deftext 14,0,0,13
    Text 214,36,"Too Bad!"
    Deftext 14,0,0,6
    Text 175,115,"The word was:"
    For J%=1 To Word_length%
      Deftext 2,0,0,13
      Text Gx%(J%),132,Mid$(Real_word$,J%,1)
    Next J%
    @Dud_sound
  Endif
  @Clear_instructions
  Showm
  No_more:
Return
'
Procedure Report_score
  If Two_player%=1
    @Clear_scores
    Deftext 3,0,0,6
    If Player_name$(0)=""
      Total_score$(0)="Player 1 Total: "+Str$(Total_score%(0))
      Text 171,169,Total_score$(0)
    Else
      Total_score$(0)="Total: "+Str$(Total_score%(0))
      Text 243,169,Total_score$(0)
      Text 171,169,Player_name$(0)
    Endif
    If Player_name$(1)=""
      Total_score$(1)="Player 2 Total: "+Str$(Total_score%(1))
      Text 171,189,Total_score$(1)
    Else
      Total_score$(1)="Total: "+Str$(Total_score%(1))
      Text 243,189,Total_score$(1)
      Text 171,189,Player_name$(1)
    Endif
    Deftext 3,0,0,6
    Puzzle_total$(0)="# Puzzles: "+Str$(Puzzle%(0))
    Puzzle_total$(1)="# Puzzles: "+Str$(Puzzle%(1))
    Deftext 14,0,0,6
    Text 211,179,Puzzle_total$(0)
    Text 211,199,Puzzle_total$(1)
  Else
    @Clear_scores1
    Deftext 3,0,0,6
    If Player_name$(0)<>""
      P$="Player: "+Player_name$(0)
      Text 171,179,P$
    Endif
    Total_score$(0)="Total Points: "+Str$(Total_score%(Active_player%))
    Text 171,189,Total_score$(0)
    Puzzle_total$(0)="# Puzzles: "+Str$(Puzzle%(0))
    Deftext 14,0,0,6
    Text 195,199,Puzzle_total$(0)
  Endif
Return
'
Procedure Guess_right
  Deftext 2,0,0,13
  Text 175,36,"     Right!"
  Pause 20
  @Clear_instructions
Return
'
Procedure Guess_wrong
  Deftext 14,0,0,13
  Text 175,36,"     Wrong!"
  @Give_a_hint
  Pause 20
  @Clear_instructions
Return
'
Procedure Give_a_hint
  Restore Drw_box_puzzle_data
  For I%=1 To 9
    Read Plx%,Ply%,Prx%,Pry%
    If I%=Puzzle_piece%
      Put Plx%,Ply%,Puzzle$(I%)
    Endif
  Next I%
  Inc Puzzle_piece%
  If Puzzle_piece%>9
    Puzzle_piece%=1
  Endif
Return
'
Procedure Display_puzzle
  Restore Drw_box_puzzle_data
  For I%=1 To 9
    Read Plx%,Ply%,Prx%,Pry%
    Put Plx%,Ply%,Puzzle$(I%)
  Next I%
Return
'
' ********************************* CREATION ***************************
Procedure Creation
  Hidem
  Sput Creation_screen$
  ' SET UP DEFAULTS *********
  Back%=0
  Drw_type%=1
  Just_loaded%=0
  Deffill 2,2,8
  Fill 247,111
  Cc%=2
  Fill 172,1
  Fll_type%=2
  Fll_style%=8
  Deffill Cc%,Fll_type%,Fll_style%
  Pbox 247,67,315,83
  Defmouse 5
  Showm
  Sget Current_screen$
  ' 97 is the pseudo-ASCII value of the second character returned when
  ' the UNDO key is pressed.  If UNDO is pressed after adding a mark (a
  ' line, circle, etc.) in the draw box, the previous version of the
  ' drawbox is restored, as long as the user has not pressed the mouse
  ' button since completing the drawing of that mark.
  Do
    @Let_go
    Repeat
      Mouse Mx%,My%,Button%
      L$=Inkey$
      If Asc(Right$(L$))=97
        Sput Current_screen$
      Endif
    Until Button%>0
    If Just_loaded%=1
      Deffill 0,2,8
      Pbox 57,19,160,40
      Just_loaded%=0
    Endif
    ' LOAD OPTION ***********
    If Mx%>0 And Mx%<52 And My%>22 And My%<40
      Deffill 10,2,8
      Fill 1,23
      @Select_sound
      Deffill 1,2,8
      Pbox 6,50,160,193
      @Load_it
      @Display_puzzle
      Pause 20
      If Lsuccess%=1
        Inc File_number%
      Endif
      Deffill 0,2,8
      Fill 1,23
      Just_loaded%=1
    Endif
    ' QUIT OPTION ***********
    If My%>0 And My%<18
      If Mx%>0 And Mx%<52
        @Exit_alert
        If Yes%=1
          Back%=1
        Else
          Sput Current_screen$
        Endif
      Endif
      ' SAVE OPTION ***********
      If Mx%>57 And Mx%<109
        @Done_with_it
        Goto Dne_creating
      Endif
      ' HELP OPTION ***********
      If Mx%>114 And Mx%<166
        Sget Current_screen$
        Deffill 11,2,8
        Fill 115,1
        @Select_sound
        @Help2
      Endif
    Endif
    ' COLOR CHOICES ***********
    If Mx%>171 And Mx%<316
      If My%>0 And My%<18
        Restore Clor_choice_data1
        For I%=1 To 6
          Read Col%,Lx%
          If Mx%>Lx% And Mx%<Lx%+20 And Col%<>Cc%
            Put 171,0,Color_choice$
            Cc%=Col%
            Deffill Cc%,2,8
            Fill Lx%+1,1
            @Other_sound
            @Filling_fill_box
          Endif
        Next I%
        @Let_go
      Endif
      If My%>22 And My%<40
        Restore Clor_choice_data2
        For I%=1 To 6
          Read Col%,Lx%
          If Mx%>Lx% And Mx%<Lx%+20 And Col%<>Cc%
            Put 171,0,Color_choice$
            Cc%=Col%
            Deffill Cc%,2,8
            Fill Lx%+1,23
            @Other_sound
            @Filling_fill_box
          Endif
        Next I%
        @Let_go
      Endif
      If My%>44 And My%<62
        If Mx%>183 And Mx%<203 And Cc%<>0
          Put 171,0,Color_choice$
          Cc%=0
          Deffill 8,2,8
          Fill 184,45
          @Other_sound
          @Filling_fill_box
        Endif
        If Mx%>208 And Mx%<228 And Cc%<>1
          Put 171,0,Color_choice$
          Cc%=1
          Deffill 8,2,8
          Fill 209,45
          @Other_sound
          @Filling_fill_box
        Endif
        @Let_go
      Endif
    Endif
    ' DRAWING OPTIONS: ***********
    If Mx%>171 And Mx%<241
      ' FILL OPTION *********
      If My%>66 And My%<84 And Drw_type%<>0
        @Clear_draw_options
        Drw_type%=0
        Deffill 2,2,8
        Fill 172,67
        @Other_sound
      Endif
      ' CIRCLE/FILLED CIRCLE OPTION ********
      If My%>88 And My%<106 And Drw_type%<>5
        @Clear_draw_options
        Drw_type%=5
        Deffill 2,2,8
        Fill 172,89
        @Other_sound
      Endif
      ' LINE OPTION *********
      If My%>110 And My%<128 And Drw_type%<>2
        @Clear_draw_options
        Drw_type%=2
        Deffill 2,2,8
        Fill 172,111
        @Other_sound
      Endif
      ' MAGNIFY ********
      If My%>132 And My%<199
        @Clear_draw_options
        Drw_type%=6
        Deffill 2,2,8
        Fill 175,133
        @Other_sound
        @Magnify_draw
        Put 176,134,Magnify_grid$
        Deffill 1,2,8
        Fill 175,133
        ' DEFAULT TO FREEHAND WITH SMALL "DOT" AFTER EXITING MAGNIFY MODE
        @Clear_draw_options
        Drw_type%=1
        Deffill 2,2,8
        Fill 247,111
        Color 1
        Draw 298,119                !Position of small drawing nib indicator
        Goto Dne_creating
      Endif
    Endif
    If Mx%>246 And Mx%<316
      ' FILL PATTERN BOX ********
      If My%>66 And My%<84
        @Fill_pattern_change
        @Other_sound
      Endif
      ' FRAME ********
      If My%>88 And My%<106 And Drw_type%<>4
        @Clear_draw_options
        Drw_type%=4
        Deffill 2,2,8
        Fill 247,89
        @Other_sound
      Endif
      ' FREEHAND DRAW OPTION ********
      If My%>110 And My%<128
        If Drw_type%=1
          ' FREEHAND WITH LARGE "DOT" ********
          @Other_sound
          Drw_type%=3
          Deffill 1,2,8
          Pbox 297,118,299,120        !Position of large drawing nib indicator
        Else
          ' FREEHAND WITH SMALL "DOT"
          @Clear_draw_options
          Drw_type%=1
          Deffill 2,2,8
          Fill 247,111
          @Other_sound
          Color 1
          Draw 298,119                !Position of small drawing nib indicator
        Endif
      Endif
      ' BLANK (ERASE ENTIRE DRAW BOX) *******
      If My%>44 And My%<62
        Deffill 2,2,8
        Fill 247,45
        @Other_sound
        @Blank_pic
        If Yes%=1
          Deffill 1,2,8
          Pbox 6,50,160,193
          @Erase_sound
        Else
          Sput Current_screen$
        Endif
        Deffill 0,2,8
        Fill 247,45
      Endif
    Endif
    ' DRAW IN THE BOX **********
    If Mx%>5 And Mx%<161 And My%>49 And My%<194
      ' The user has pressed the mouse while in the draw box.  The currently-
      ' selected Drw_type% will determine the kind of drawing done.  Longer
      ' drawing routines are placed in subroutines (Procedures) below.
      Aa%=Mx%
      Bb%=My%
      Sget Current_screen$
      If Drw_type%=0
        Deffill Cc%,Fll_type%,Fll_style%
        Fill Mx%,My%
      Endif
      If Drw_type%=1
        @Freehand_draw
      Endif
      If Drw_type%=2
        @Line_draw
      Endif
      If Drw_type%=3
        @Large_dot_freehand_draw
      Endif
      If Drw_type%=4
        @Frame_draw
      Endif
      If Drw_type%=5
        @Circle_draw
      Endif
    Endif
    Dne_creating:
    Exit If Back%=1
  Loop
  @Let_go
  Hidem
  Sput Shell_screen$
  Defmouse 0
  Showm
Return
'
Procedure Fill_pattern_change
  Fll_style%=Fll_style%+1
  If Fll_type%=2 And Fll_style%=25
    Fll_type%=3
    Fll_style%=1
  Endif
  If Fll_type%=3 And Fll_style%=13
    Fll_type%=2
    Fll_style%=1
  Endif
  @Filling_fill_box
Return
'
Procedure Filling_fill_box
  If Cc%=0
    Deffill 1,2,8
  Else
    Deffill 0,2,8
  Endif
  Pbox 247,67,315,83
  Deffill Cc%,Fll_type%,Fll_style%
  Pbox 247,67,315,83
Return
'
Procedure Freehand_draw
  Color Cc%
  First_dot%=1
  Do
    Mouse Aa%,Bb%,Cbutton%
    Exit If Cbutton%=0
    Exit If Aa%<6 Or Aa%>160 Or Bb%<50 Or Bb%>193
    If Aa%>5 And Aa%<161 And Bb%>49 And Bb%<194
      If First_dot%=1
        Hidem
      Endif
      First_dot%=0
      Draw Aa%,Bb%
    Endif
  Loop
  Showm
Return
'
Procedure Line_draw
  @Let_go
  If Aa%>5 And Aa%<161 And Bb%>49 And Bb%<194
    Point_x1%=Aa%
    Point_y1%=Bb%
  Endif
  Sget Current_screen$
  Color 0
  Hidem
  ' A "rubber" line is created in this loop.  If the mouse is inside the draw
  ' box, the mouse is hidden, and the end of the rubber line serves to indicate
  ' where the mouse is.  If the user moves the mouse outside the draw box,
  ' the rubber line disappears, but the mouse is shown.  If the mouse is clicked
  ' inside the draw box (left button), the computer will draw a line from the
  ' beginning point determined above to the current position of the mouse.
  ' If the right mouse button is clicked, no line will be drawn and the program
  ' will exit this subroutine.  If either (or both) buttons are clicked when
  ' the mouse is outside the draw box, no line will be drawn and the program
  ' will exit this subroutine.
  Repeat
    Mouse Aa%,Bb%,Cbutton%
    If Aa%>5 And Aa%<161 And Bb%>49 And Bb%<194 And (Last_aa%<>Aa% Or Last_bb%<>Bb%)
      Sput Current_screen$
      Hidem
      Draw Point_x1%,Point_y1% To Aa%,Bb%
    Endif
    If Aa%<6 Or Aa%>160 Or Bb%<50 Or Bb%>193 And (Last_aa%<>Aa% Or Last_bb%<>Bb%)
      Sput Current_screen$
      Showm
    Endif
    Last_aa%=Aa%
    Last_bb%=Bb%
  Until Cbutton%>0
  Showm
  @Let_go
  If Cbutton%=2 Or Cbutton%=3
    Sput Current_screen$
    Goto No_line
  Endif
  If Cbutton%=1 And Aa%>5 And Aa%<161 And Bb%>49 And Bb%<194
    Color Cc%
    Point_x2%=Aa%
    Point_y2%=Bb%
    Draw Point_x1%,Point_y1% To Point_x2%,Point_y2%
  Endif
  No_line:
Return
'
Procedure Frame_draw
  @Let_go
  If Aa%>5 And Aa%<161 And Bb%>49 And Bb%<194
    Point_x1%=Aa%
    Point_y1%=Bb%
  Endif
  Sget Current_screen$
  Color 0
  Hidem
  ' A "rubber" frame is created in this loop.  If the mouse is inside the draw
  ' box, the mouse is hidden, and the lower right-hand corner of the rubber
  ' frame indicates where the mouse is.  If the user moves the mouse outside
  ' the draw box, the rubber line disappears, but the mouse is shown.  If the
  ' left mouse button is clicked inside the draw box, the computer will draw a
  ' frame from the upper left-hand corner (beginning point) determined above
  ' to the lower right-hand corner determined by the current position of the
  ' mouse.
  ' If the right mouse button is clicked, no frame will be drawn and the program
  ' will exit this subroutine.  If either (or both) buttons are clicked when
  ' the mouse is outside the draw box, no frame will be drawn and the program
  ' will exit this subroutine.
  Repeat
    Mouse Aa%,Bb%,Cbutton%
    If Aa%>5 And Aa%<161 And Bb%>49 And Bb%<194 And (Last_aa%<>Aa% Or Last_bb%<>Bb%)
      Sput Current_screen$
      Hidem
      Box Point_x1%,Point_y1%,Aa%,Bb%
    Endif
    If Aa%<6 Or Aa%>160 Or Bb%<50 Or Bb%>193 And (Last_aa%<>Aa% Or Last_bb%<>Bb%)
      Sput Current_screen$
      Showm
    Endif
    Last_aa%=Aa%
    Last_bb%=Bb%
  Until Cbutton%>0
  Showm
  @Let_go
  If Cbutton%=2 Or Cbutton%=3
    Sput Current_screen$
    Goto No_frame
  Endif
  If Cbutton%=1 And Aa%>5 And Aa%<161 And Bb%>49 And Bb%<194
    Color Cc%
    Point_x2%=Aa%
    Point_y2%=Bb%
    Box Point_x1%,Point_y1%,Point_x2%,Point_y2%
  Endif
  No_frame:
Return
'
Procedure Circle_draw
  Color Cc%
  @Let_go
  If Aa%>5 And Aa%<161 And Bb%>49 And Bb%<194
    Hub_x%=Aa%
    Hub_y%=Bb%
  Endif
  Sget Current_screen$
  Color 0
  Hidem
  ' A "rubber" circle is created in this loop.  If the mouse is inside the draw
  ' box and the entire circle fits inside the draw box, the mouse is hidden,
  ' and the rim of the circle indicates where the mouse is.  If the user moves
  ' the mouse out of the draw box or the circle becomes too large to fit within
  ' the draw box, the rubber circle disapears and the mouse is shown. If the
  ' left mouse button is clicked inside the draw box and the circle would fit
  ' within the draw box, the computer will draw a circle using the hub
  ' (beginning point) determined above and the radius determined by the
  ' current position of the mouse.
  ' If the right mouse button is clicked (or both buttons), no circle will be
  ' drawn and the computer will exit this subroutine.  If either or both buttons
  ' are clicked when the mouse is outside the draw box or when the circle will
  ' not fit within the draw box, no circle will be drawn and the computer will
  ' exit this subroutine.
  Repeat
    Mouse Aa%,Bb%,Cbutton%
    If Aa%>5 And Aa%<161 And Bb%>49 And Bb%<194 And (Last_aa%<>Aa% Or Last_bb%<>Bb%)
      Radius%=Int(Sqr((Aa%-Hub_x%)*(Aa%-Hub_x%)+(Bb%-Hub_y%)*(Bb%-Hub_y%)))
      If Hub_x%-Radius%>5 And Hub_y%-Radius%>49 And Radius%+Hub_x%<161 And Radius%+Hub_y%<194
        Sput Current_screen$
        Hidem
        Circle Hub_x%,Hub_y%,Radius%
      Else
        Sput Current_screen$
        Showm
      Endif
    Endif
    If (Aa%<6 Or Aa%>160 Or Bb%<50 Or Bb%>193 And (Last_aa%<>Aa% Or Last_bb%<>Bb%))
      Sput Current_screen$
      Showm
    Endif
    Last_aa%=Aa%
    Last_bb%=Bb%
  Until Cbutton%>0
  Showm
  @Let_go
  If Cbutton%=2 Or Cbutton%=3
    Sput Current_screen$
    Goto No_circle
  Endif
  If Cbutton%=1
    Rim_x%=Aa%-Hub_x%
    Rim_y%=Bb%-Hub_y%
    Radius%=Int(Sqr(Rim_x%*Rim_x%+Rim_y%*Rim_y%))
    If Hub_x%-Radius%>5 And Hub_y%-Radius%>49 And Radius%+Hub_x%<161 And Radius%+Hub_y%<194
      Color Cc%
      Circle Hub_x%,Hub_y%,Radius%
    Endif
  Endif
  No_circle:
Return
'
Procedure Large_dot_freehand_draw
  Defmouse 6
  Deffill Cc%,2,8
  First_dot%=1
  Do
    Mouse Aa%,Bb%,Cbutton%
    Exit If Cbutton%=0
    Exit If Aa%<7 Or Aa%>159 Or Bb%<51 Or Bb%>192
    If Aa%>6 And Aa%<160 And Bb%>50 And Bb%<193
      If First_dot%=1
        Hidem
      Endif
      First_dot%=0
      Pbox Aa%-1,Bb%-1,Aa%+1,Bb%+1
    Endif
  Loop
  Defmouse 5
  Showm
Return
'
Procedure Magnify_draw
  ' First, the user selects a section of the drawing screen to be magnified.
  ' If the mouse is on the draw box, a black frame of the correct dimensions
  ' (16 pixels wide by 8 high) will be shown instead of the mouse.  If the
  ' frame cannot fit on the draw box because of the mouse's location, the mouse
  ' is shown as an arrow.  If the left button is pressed while the frame is
  ' shown, a red frame will surround the defined block and the magnified grid
  ' will fill with the appropriate color(s).  If the right button (or both
  ' buttons) is pressed, the computer will exit this subroutine without
  ' magnifying a block.
  Magnified_it%=0
  Flled_it%=0
  @Let_go
  Defmouse 0
  Get 4,49,162,194,Rubber_box$
  Sget Current_screen$
  Color 0
  Didnt_catch_it:
  Repeat
    Mouse Aa%,Bb%,Cbutton%
    Exit If Cbutton%>1
    If Aa%<6 Or Aa%>161-17 Or Bb%<50 Or Bb%>194-8 And (Last_bb%<>Bb% Or Last_aa%<>Aa%)
      Sput Current_screen$
      Showm
    Endif
    If Aa%>5 And Aa%<162-17 And Bb%>49 And Bb%<195-8 And (Last_bb%<>Bb% Or Last_aa%<>Aa%)
      Sput Current_screen$
      Hidem
      Box Aa%-1,Bb%-1,Aa%+17,Bb%+8
    Endif
    Last_aa%=Aa%
    Last_bb%=Bb%
  Until Cbutton%=1
  If Cbutton%>1
    Goto No_magnify
  Endif
  Hidem
  @Let_go
  ' In the clause below, the computer indicates a defined block by putting
  ' a red frame around it on the draw box.  If the left mouse button has
  ' been pressed while the mouse was not on the draw box, the user will
  ' have another chance to define a block.
  If Aa%>4 And Aa%<162-17 And Bb%>49 And Bb%<195-8
    Sput Current_screen$
    Color 2
    Box Aa%-1,Bb%-1,Aa%+17,Bb%+8
  Else
    Goto Didnt_catch_it
  Endif
  ' In the loop below, the computer examines each pixel in the defined block
  ' and fills the corresponding square in the magnified grid with that
  ' pixel's color.
  Llx%=Aa%-1
  Lly%=Bb%-1
  Get Llx%+1,Lly%+1,Llx%+17,Lly%+8,Magni_block$
  Lx%=176
  Ly%=134
  For I%=1 To 8
    For J%=1 To 17
      Dt_color%(J%,I%)=Point(J%+Llx%,I%+Lly%)
      Deffill Dt_color%(J%,I%),2,8
      Pbox Lx%+1,Ly%+1,Lx%+7,Ly%+7
      Add Lx%,8
    Next J%
    Add Ly%,8
    Lx%=176
  Next I%
  Showm
  ' Now the user has an opportunity to draw directly on the magnified grid.
  ' The changes made here will also be reflected in the draw box.
  ' If the right button is pressed (or both buttons), the computer will exit
  ' the subroutine and the magnify mode.  The drawing mode will return to the
  ' default (draw with a small dot).
  Do
    Flled_it%=0
    Repeat
      Mouse Mx%,My%,Button%
      Exit If Mx%>176 And My%>133 And Mx%<312 And My%<199
    Until Button%=0
    Repeat
      Mouse Aa%,Bb%,Cbutton%
    Until Cbutton%>0
    Get Llx%+1,Lly%+1,Llx%+17,Lly%+8,Magni_block$
    Exit If Cbutton%>1
    If (Aa%>171 And Bb%>130 And Aa%<319 And Bb%<199) Or (Aa%>171 And Bb%>0 And Aa%<319 And Bb%<65)
      Target_hit%=1
      ' * mouse is in the general area of the magnification grid or color choices
    Else
      Target_hit%=0
    Endif
    Exit If Target_hit%=0
    ' COLOR CHOICES ***********
    If Aa%>171 And Aa%<316 And Bb%>0 And Bb%<62
      If Bb%>0 And Bb%<18
        Restore Clor_choice_data1
        For I%=1 To 6
          Read Col%,Lx%
          If Aa%>Lx% And Aa%<Lx%+20 And Col%<>Cc%
            Put 171,0,Color_choice$
            Cc%=Col%
            Deffill Cc%,2,8
            Fill Lx%+1,1
            @Filling_fill_box
          Endif
        Next I%
      Endif
      If Bb%>22 And Bb%<40
        Restore Clor_choice_data2
        For I%=1 To 6
          Read Col%,Lx%
          If Aa%>Lx% And Aa%<Lx%+20 And Col%<>Cc%
            Put 171,0,Color_choice$
            Cc%=Col%
            Deffill Cc%,2,8
            Fill Lx%+1,23
            @Filling_fill_box
          Endif
        Next I%
      Endif
      If Bb%>44 And Bb%<62
        If Aa%>183 And Aa%<203 And Cc%<>0
          Put 171,0,Color_choice$
          Cc%=0
          Deffill 8,2,8
          Fill 184,45
          @Filling_fill_box
        Endif
        If Aa%>208 And Aa%<228 And Cc%<>1
          Put 171,0,Color_choice$
          Cc%=1
          Deffill 8,2,8
          Fill 209,45
          @Filling_fill_box
        Endif
      Endif
    Endif
    If Point(Aa%,Bb%)<>Cc% And Aa%>176 And Aa%<312 And Bb%>134 And Bb%<199
      Lx%=176
      Ly%=134
      For I%=1 To 8
        For J%=1 To 17
          If Aa%>Lx% And Aa%<Lx%+8 And Bb%>Ly% And Bb%<Ly%+8
            Color Cc%
            Draw J%+Llx%,I%+Lly%
            Deffill Cc%,2,8
            Pbox Lx%+1,Ly%+1,Lx%+7,Ly%+7
            Magnified_it%=1
            Flled_it%=1
          Endif
          Exit If Flled_it%=1
          Add Lx%,8
        Next J%
        Exit If Flled_it%=1
        Add Ly%,8
        Lx%=176
      Next I%
    Endif
  Loop
  No_magnify:
  Put 4,49,Rubber_box$
  @Let_go
  If Magnified_it%=1
    Put Llx%+1,Lly%+1,Magni_block$
  Endif
  Defmouse 5
  Showm
Return
'
' *************************** COLOR PALETTE **********************
Procedure Set_color
  Setcolor 0,0,0,0            !=Color# 0, BLACK (BACKGROUND)
  Setcolor 15,7,7,7           !=Color# 1, WHITE
  Setcolor 1,7,0,0            !=Color# 2, RED
  Setcolor 2,0,6,0            !=Color# 3, LIGHT GREEN
  Setcolor 4,5,2,0            !=Color# 4, BROWN
  Setcolor 6,0,0,7            !=Color# 5, BRIGHT BLUE
  Setcolor 3,0,5,0            !=Color# 6, DARK GREEN
  Setcolor 5,2,4,7            !=Color# 7, LIGHT BLUE
  Setcolor 7,6,6,6            !=Color# 8, LIGHT GREY
  Setcolor 8,0,0,0            !=Color# 9, OTHER BLACK
  Setcolor 9,7,3,4            !=Color# 10, PINK
  Setcolor 10,7,3,0           !=Color# 11, ORANGE
  Setcolor 12,7,5,0           !=Color# 12, GOLD
  Setcolor 14,6,0,7           !=Color# 13, LIGHT PURPLE
  Setcolor 11,7,7,0           !=Color# 14, LIGHT YELLOW
  Setcolor 13,5,0,5           !=Color# 15, DARK PURPLE
Return
'
Procedure Black_screen
  For I%=0 To 15
    Setcolor I%,0,0,0
  Next I%
Return
'
Procedure Check_rez
  Rez%=Xbios(4)
  If Rez%<>0
    Alrt$=" |This program requires|  Low Resolution."
    Alert 3,Alrt$,1,"Oops!",Dummy%
    End
  Endif
Return
'
Procedure Save_palette
  For I%=0 To 15
    Palette%(I%)=Xbios(7,W:I%,W:-1)
  Next I%
Return
'
Procedure Restore_palette
  For I%=0 To 15
    Setcolor I%,Palette%(I%)
  Next I%
Return
'
' ************************* MOUSE CHECKS *************************
Procedure Help_check_mouse
  Deftext 0,0,0,6
  If Argh%=1
    Text 52,Ly%+12," ARGH!"
  Else
    Text 50,Ly%+12,"CONTINUE"
  Endif
  Repeat
    Mouse Aa%,Bb%,Cbutton%
  Until Aa%>21 And Aa%<145 And Bb%>Ly% And Bb%<Ly%+15 And Cbutton%>0
  Deffill Df%,2,8
  Fill 22,Ly%+1
  @Alert_sound
  Pause 15
Return
'
Procedure Check_mouse
  @Let_go
  Repeat
    Mouse Aa%,Bb%,Cbutton%
  Until Cbutton%>0 And Bb%>Ly% And Bb%<Ly%+18 And ((Aa%>21 And Aa%<81) Or (Aa%>85 And Aa%<145))
  Deffill Df%,2,8
  If Aa%>21 And Aa%<81
    Fill 22,Ly%+1
    Yes%=1
  Else
    Fill 86,Ly%+1
    Yes%=0
  Endif
  @Alert_sound
  Pause 20
Return
'
'
Procedure Let_go
  Repeat
    Mouse Aaa%,Bbb%,Ccc%
  Until Ccc%=0
Return
'
' ****************************** SCREENS **************************
Procedure Shell_screen
  Deftext 2,1,0,13
  Text 98,13,"W U Z Z L E R S"
  Deftext 14,0,0,6
  Text 37,25,"A Word and Picture Puzzle Game"
  Deftext 3,1,0,4
  Text 45,35,"YET ANOTHER KIDPRG  IN GFA BASIC FROM"
  Deftext 3,0,0,4
  Text 155,35,Chr$(191)
  Deftext 2,0,0,6
  Text 35,45,"         D.A. Brumleve"
  Deftext 14,5,0,4
  Text 60,54,"                      ST-LOG"
  Deftext 14,1,0,4
  Text 60,54,"    COPYRIGHT 1989 BY"
  Deftext 2,1,0,4
  Text 225,13,"VERSION 4.1"
  Deftext 2,0,0,6
  Text 35,75,"As published originally in    !"
  Sty%=6
  Stx%=48
  Color 3
  Box 204+Stx%,52+Sty%,224+Stx%,73+Sty%
  Color 2
  Box 205+Stx%,53+Sty%,223+Stx%,72+Sty%
  Deffill 2,2,8
  Pbox 205+Stx%,66+Sty%,223+Stx%,72+Sty%
  Deffill 3,2,8
  Pbox 206+Stx%,54+Sty%,222+Stx%,65+Sty%
  Deftext 2,1,0,13
  Text 207+Stx%,65+Sty%," T"
  Text 205+Stx%,65+Sty%,"S"
  Deftext 3,1,0,4
  Text 205+Stx%,71+Sty%,"LOG"
  Color 1
  Restore Shell_data
  For I%=1 To 3
    Read Lx%,Ly%,Rx%,Ry%,C%,I$,Tx%
    Box Lx%,Ly%,Rx%,Ry%
    Box Lx%+3,Ly%+3,Rx%-3,Ry%-3
    Deffill C%,2,8
    Pbox Lx%+4,Ly%+4,Rx%-4,Ry%-4
    If I%=3
      Deftext 0,1,0,13
    Else
      Deftext 0,0,0,13
    Endif
    Text Tx%,Ly%+32,I$
  Next I%
Return
'
Procedure All_screens
  ' This routine draws the EXIT,PLAY/SAVE,HELP, and MAKE boxes and the puzzle box.
  Restore All_screens_data
  For I%=1 To 3
    Read C%,C$,Cx%,Lx%,Ly%,Rx%,Ry%
    Color 1
    Box Lx%,Ly%,Rx%,Ry%
    Box Lx%+3,Ly%+3,Rx%-3,Ry%-3
    Deffill C%,2,8
    Pbox Lx%+4,Ly%+4,Rx%-4,Ry%-4
    Deftext 0,0,0,6
    Text Cx%,Ry%-6,C$
  Next I%
  Read Lx%,Ly%,Rx%,Ry%
  Color 1
  Box Lx%,Ly%,Rx%,Ry%
  Box Lx%+3,Ly%+3,Rx%-3,Ry%-3
  Deffill 1,2,8
  Pbox Lx%+6,Ly%+6,Rx%-6,Ry%-6
  Deffill 9,2,8
  Fill Lx%+5,Ly%+5
Return
'
Procedure Main_screen
  Color 12
  Box 171,0,319,18
  Deftext 2,0,0,13
  Text 186,15,"W U Z Z L E R S"
  Deftext 3,0,0,13
  Color 3
  Restore Alphabet_data
  For I%=1 To 26
    Read Lx%,Ly%,Alpha$,N%
    Box Lx%,Ly%,Lx%+15,Ly%+19
    Text Lx%+4,Ly%+15,Alpha$
  Next I%
  Get 177,44,297+15,82+19,Alphabet_grid$
Return
'
Procedure Creation_screen
  ' This routine draws the special boxes used in the creation segment of the
  ' program: color choices, drawing options, "SAVE" box
  Restore Creation_screen_data
  Ly%=0
  Jj%=6
  For I%=1 To 3
    If I%=3
      Jj%=2
    Endif
    For J%=1 To Jj%
      Read C%,Lx%
      Color 1
      Box Lx%,Ly%,Lx%+20,Ly%+18
      Box Lx%+3,Ly%+3,Lx%+17,Ly%+15
      Deffill C%,2,8
      Pbox Lx%+4,Ly%+4,Lx%+16,Ly%+14
    Next J%
    Add Ly%,22
  Next I%
  Deffill 14,2,8
  Pbox 61,4,105,14
  Deftext 0,0,0,6
  Text 67,12,"SAVE"
  Deffill 10,2,8
  Pbox 4,26,48,36
  Color 1
  Box 0,22,52,40
  Box 3,25,49,37
  Deftext 0,0,0,6
  Text 10,34,"LOAD"
  Lx%=171
  For I%=1 To 2
    Ly%=66
    For J%=1 To 3
      Box Lx%,Ly%,Lx%+70,Ly%+18
      Box Lx%+3,Ly%+3,Lx%+67,Ly%+15
      Add Ly%,22
    Next J%
    Lx%=246
  Next I%
  Deftext 1,0,0,6
  Ly%=66
  For J%=1 To 3
    Read Cx%,C$
    Text Cx%,Ly%+12,C$
    Add Ly%,22
  Next J%
  Ly%=88
  For J%=1 To 2
    Read Cx%,C$
    Text Cx%,Ly%+12,C$
    Add Ly%,22
  Next J%
  Color 0
  Box 249,69,313,81
  Color 1
  Box 246,44,316,62
  Box 249,47,313,59
  Deftext 1,0,0,6
  Text 261,56,"BLANK"
  Draw 298,119                !Position of small drawing nib indicator
  Deffill 1,2,8
  Pbox 171,132,316,199
  Deffill 9,3,12
  Fill 172,156
  Get 176,136,312,199,Magnify_grid$
  Deffill 0,2,8
  Pbox 171,132,316,199
  Color 1
  Box 175,133,313,199
  Color 9
  Draw 176,198 To 312,198
  Put 176,134,Magnify_grid$
  Get 171,88,316,150,Clear_draw_options$
Return
'
' ****************************** INSTRUCTIONS ********************
Procedure Done_with_it
  Df%=14
  Ly%=145
  Qy%=25
  Deffill Df%,2,8
  Fill 58,11
  @Select_sound
  Sget Current_screen$
  Pbox 6,50,160,193
  @Yes_or_no
  Deftext 0,0,0,6
  Text 10,65+Qy%,"  Do you want to"
  Text 7,75+Qy%," save this picture"
  Text 10,85+Qy%," to use as a word"
  Text 10,95+Qy%,"      puzzle?"
  @Check_mouse
  If Yes%=1
    @Save_it
  Endif
  Sput Current_screen$
  Deffill 0,2,8
  Fill 58,11
Return
'
Procedure Exit_alert
  Sget Current_screen$
  Deffill 2,2,8
  Fill 1,1
  @Select_sound
  Deffill 2,2,8
  Pbox 6,50,160,193
  Df%=2
  Ly%=145
  Qy%=25
  @Yes_or_no
  Text 16,75+Qy%,"  Do you really"
  Text 16,85+Qy%,"  want to quit?"
  @Check_mouse
Return
'
Procedure Exit_alert2
  Deffill 2,2,8
  Fill 84,148
  @Select_sound
  Deffill 2,2,8
  Pbox 83+4,147+4,225-4,199-4
  Df%=2
  Ly%=175
  Qy%=141
  Color 0
  R%=71
  Box 21+R%,Ly%,81+R%,Ly%+18
  Box 85+R%,Ly%,145+R%,Ly%+18
  Box 24+R%,Ly%+3,78+R%,Ly%+15
  Box 88+R%,Ly%+3,142+R%,Ly%+15
  Deffill 1,2,8
  Fill 22+R%,Ly%+1
  Fill 86+R%,Ly%+1
  Deftext 0,0,0,6
  Text 37+R%,Ly%+12,"Yes."
  Text 104+R%,Ly%+12,"No!"
  Text 93,160," Do you really"
  Text 93,170," want to quit?"
  @Let_go
  Repeat
    Mouse Aa%,Bb%,Cbutton%
  Until Cbutton%>0 And Bb%>Ly% And Bb%<Ly%+18 And ((Aa%>21+R% And Aa%<81+R%) Or (Aa%>85+R% And Aa%<145+R%))
  Deffill Df%,2,8
  If Aa%>21+R% And Aa%<81+R%
    Fill 22+R%,Ly%+1
    Yes%=1
  Else
    Fill 86+R%,Ly%+1
    Yes%=0
  Endif
  @Alert_sound
  Pause 15
Return
'
Procedure How_many
  Deffill 3,2,8
  Pbox 6,50,160,193
  Df%=3
  Ly%=145
  Qy%=25
  @Yes_or_no
  Text 8,75+Qy%," Will two players"
  Text 10,85+Qy%," play this game?"
  @Set_color
  @Check_mouse
  If Yes%=1
    Two_player%=1
  Else
    Two_player%=0
    Active_player%=0
  Endif
  Qy%=15
  Deffill 3,2,8
  Pbox 6,50,160,193
  Deftext 0,0,0,6
  If Two_player%=1
    Text 9,75+Qy%,"  Player 1, type"
    Text 12,85+Qy%,"  your name and"
    Text 15,95+Qy%," press <Return>."
  Else
    Text 19,85+Qy%,"Type your name"
    Text 10,95+Qy%,"and press <Return>."
  Endif
  @Get_word2
  Player_name$(0)=Nw_word$
  If Two_player%=1
    Deffill 3,2,8
    Pbox 6,50,160,193
    Deftext 0,0,0,6
    Text 9,75+Qy%,"  Player 2, type"
    Text 12,85+Qy%,"  your name and"
    Text 15,95+Qy%," press <Return>."
    @Get_word2
    Player_name$(1)=Nw_word$
  Endif
  Sput Main_screen$
  Showm
Return
'
Procedure Blank_pic
  Sget Current_screen$
  Blank_it%=0
  Deffill 8,2,8
  Pbox 6,50,160,193
  Df%=8
  Ly%=145
  Qy%=25
  @Yes_or_no
  Text 10,75+Qy%,"  Do you want to"
  Text 8,85+Qy%,"erase this picture?"
  @Check_mouse
  If Yes%=1
    Blank_it%=1
  Else
    Blank_it%=0
  Endif
Return
'
Procedure No_new_word
  @Oopsy
  Text 8,75+Qy%," You cannot save a"
  Text 8,85+Qy%," picture without a"
  Text 13,95+Qy%,"   puzzle word!"
  Argh%=1
  @Argh
  @Argh_dialog
  @Help_check_mouse
  Argh%=0
Return
'
Procedure File_not_found
  @Oopsy
  Text 10,75+Qy%,"There is no puzzle"
  Text 10,85+Qy%,"file on this disk!"
  Argh%=1
  @Argh
  @Argh_dialog
  @Help_check_mouse
  Argh%=0
Return
'
Procedure No_room_to_save
  @Oopsy
  Text 10,75+Qy%,"   There is not"
  Text 10,85+Qy%,"  enough room on"
  Text 7,95+Qy%," this disk to save"
  Text 10,105+Qy%,"   your puzzle!"
  Argh%=1
  @Argh
  @Argh_dialog
  @Help_check_mouse
  Argh%=0
Return
'
Procedure No_more_puzzles
  @Oopsy
  Text 10,75+Qy%,"   There are no"
  Text 10,85+Qy%," more puzzles on"
  Text 7,95+Qy%,"    this disk!"
  Argh%=1
  @Argh
  @Argh_dialog
  @Help_check_mouse
  Argh%=0
Return
'
Procedure Oopsy
  Deffill 15,2,8
  Pbox 6,50,160,193
  Qy%=0
  Ly%=141
  Df%=15
  Deftext 0,0,0,6
  Text 13,65+Qy%,"      Oops!"
Return
'
Procedure Help1
  Df%=11
  Ly%=169
  @Help_dialog
  Deftext 0,0,0,6
  Text 10,65,"Click PLAY to load"
  Text 10,75,"a puzzle.  Then "
  Text 10,85,"use the mouse to"
  Text 10,95,"choose letters and"
  Text 10,105,"try to guess the"
  Text 10,115,"puzzle word.  You"
  Text 10,125,"can score up to 9"
  Text 10,135,"points on each"
  Text 10,145,"puzzle."
  @Help_check_mouse
  @Help_dialog
  Deftext 0,0,0,6
  Text 10,65,"If you guess a"
  Text 10,75,"letter that is not"
  Text 10,85,"in the puzzle word,"
  Text 10,95,"another piece of"
  Text 10,105,"the puzzle is"
  Text 10,115,"displayed as a"
  Text 10,125,"hint and 1 point"
  Text 10,135,"is deducted from"
  Text 10,145,"the possible 9."
  @Help_check_mouse
  @Help_dialog
  Text 10,65,"Try to guess the"
  Text 10,75,"puzzle word before"
  Text 10,85,"the puzzle is"
  Text 10,95,"complete!"
  Text 10,125,"Click the mouse"
  Text 10,135,"on EXIT when you"
  Text 10,145,"are done playing."
  @Help_check_mouse
  Sput Current_screen$
Return
'
Procedure Help2
  Df%=11
  Ly%=169
  @Help_dialog
  Deftext 0,0,0,6
  Text 10,65,"Use the drawing"
  Text 10,75,"options to draw"
  Text 10,85,"a picture to use"
  Text 10,95,"as a word puzzle."
  Text 10,105,"When your picture"
  Text 10,115,"is ready, click"
  Text 10,125,"SAVE to type your"
  Text 10,135,"puzzle word and"
  Text 10,145,"save the puzzle."
  @Help_check_mouse
  @Help_dialog
  Text 10,65,"To draw, use the"
  Text 10,75,"mouse to select"
  Text 10,85,"a drawing color"
  Text 10,95,"and function:"
  Text 10,115,"FILL"
  Gy%=15
  Deftext 0,1,0,4
  Text 20,108+Gy%,"CLICK ON A SHAPE IN"
  Text 20,116+Gy%,"YOUR PICTURE TO FILL"
  Text 20,124+Gy%,"IT WITH CURRENT FILL"
  Text 20,132+Gy%,"PATTERN AND COLOR."
  @Help_check_mouse
  @Help_dialog
  Text 10,65,"CIRCLE"
  Gy%=-35
  Deftext 0,1,0,4
  Text 20,108+Gy%,"CLICK LEFT BUTTON TO"
  Text 20,116+Gy%,"PLACE CENTER OF CIRCLE."
  Text 20,124+Gy%,"CLICK LEFT BUTTON AGAIN"
  Text 20,132+Gy%,"TO FINISH DRAWING"
  Text 20,140+Gy%,"CIRCLE."
  Text 20,148+Gy%,"CLICK RIGHT BUTTON TO"
  Text 20,156+Gy%,"QUIT WITHOUT DRAWING"
  Text 20,164+Gy%,"CIRCLE."
  @Help_check_mouse
  @Help_dialog
  Text 10,65,"LINE"
  Gy%=-35
  Deftext 0,1,0,4
  Text 20,108+Gy%,"CLICK LEFT BUTTON TO"
  Text 20,116+Gy%,"BEGIN LINE."
  Text 20,124+Gy%,"CLICK LEFT BUTTON AGAIN"
  Text 20,132+Gy%,"AT END OF LINE TO"
  Text 20,140+Gy%,"FINISH DRAWING."
  Text 20,148+Gy%,"OR CLICK RIGHT BUTTON"
  Text 20,156+Gy%,"TO QUIT WITHOUT DRAWING"
  Text 20,164+Gy%,"LINE."
  @Help_check_mouse
  @Help_dialog
  Text 10,65,"FRAME"
  Gy%=-35
  Deftext 0,1,0,4
  Text 20,108+Gy%,"CLICK LEFT BUTTON TO"
  Text 20,116+Gy%,"PLACE UPPER LEFT-HAND"
  Text 20,124+Gy%,"CORNER OF FRAME."
  Text 20,132+Gy%,"CLICK LEFT BUTTON AGAIN"
  Text 20,140+Gy%,"TO SET LOWER RIGHT-HAND"
  Text 20,148+Gy%,"CORNER AND FINISH DRAW-"
  Text 20,156+Gy%,"ING FRAME."
  Text 20,164+Gy%,"OR CLICK RIGHT BUTTON"
  Text 20,172+Gy%,"TO QUIT WITHOUT DRAWING"
  Text 20,180+Gy%,"FRAME."
  @Help_check_mouse
  @Help_dialog
  Text 10,65,"DRAW"
  Gy%=-35
  Deftext 0,1,0,4
  Text 20,108+Gy%,"CLICK ON PICTURE TO"
  Text 20,116+Gy%,"DRAW DOT. <DRAG> MOUSE"
  Text 20,124+Gy%,"TO DRAW CONNECTED DOTS."
  Text 20,132+Gy%,"CLICK TWICE ON DRAW"
  Text 20,140+Gy%,"OPTION FOR LARGE DOT,"
  Text 20,148+Gy%,"ONCE FOR SMALL DOT."
  @Help_check_mouse
  @Help_dialog
  Text 10,65,"BLANK"
  Text 10,132-25,"FILL PATTERNS"
  Gy%=-35
  Deftext 0,1,0,4
  Text 20,108+Gy%,"CLICK BLANK OPTION TO"
  Text 20,116+Gy%,"COMPLETELY ERASE THE"
  Text 20,124+Gy%,"CURRENT PICTURE."
  Gy%=-25
  Text 20,140+Gy%,"CLICK FILL PATTERN BOX"
  Text 20,148+Gy%,"TO CHANGE THE CURRENT"
  Text 20,156+Gy%,"FILL PATTERN."
  @Help_check_mouse
  @Help_dialog
  Text 10,65,"MAGNIFY"
  Gy%=-35
  Deftext 0,1,0,4
  Text 20,108+Gy%,"CLICK THE MAGNIFICATION"
  Text 20,116+Gy%,"BOX. MOVE THE MOUSE"
  Text 20,124+Gy%,"TO FRAME PART OF YOUR"
  Text 20,132+Gy%,"PICTURE TO MAGNIFY."
  Text 20,140+Gy%,"CLICK LEFT BUTTON."
  Text 20,148+Gy%,"CLICK GRID IN THE"
  Text 20,156+Gy%,"MAGNIFICATION BOX TO"
  Text 20,164+Gy%,"MODIFY YOUR DRAWING."
  Text 20,172+Gy%,"CLICK THE RIGHT BUTTON"
  Text 20,180+Gy%,"TO STOP MAGNIFICATION."
  @Help_check_mouse
  @Help_dialog
  Text 10,65,"LOAD"
  Text 10,105,"UNDO"
  Gy%=-35
  Deftext 0,1,0,4
  Text 20,108+Gy%,"CLICK THE LOAD OPTION"
  Text 20,116+Gy%,"TO SEE THE PUZZLES ON"
  Text 20,124+Gy%,"YOUR DISK."
  Text 20,113,"WHILE DRAWING, IF YOU"
  Text 20,121,"WANT TO UNDO YOUR LAST"
  Text 20,129,"OPERATION, PRESS THE"
  Text 20,137,"UNDO KEY BEFORE CLICK-"
  Text 20,145,"THE MOUSE TO MAKE"
  Text 20,153,"ANOTHER SELECTION OR"
  Text 20,161,"TO DRAW."
  @Help_check_mouse
  Sput Current_screen$
Return
'
Procedure Argh_dialog
  Deffill 1,2,8
  Pbox 22,Ly%,145,Ly%+18
  Deffill 15,2,8
  Pbox 24,Ly%+3,142,Ly%+15
  Color 0
  Box 21,Ly%,145,Ly%+18
  Box 24,Ly%+3,142,Ly%+15
Return
'
Procedure Help_dialog
  Deffill Df%,2,8
  Pbox 6,50,160,193
  Deffill Df%,2,8
  Pbox 24,Ly%+3,142,Ly%+15
  Color 0
  Box 21,Ly%,145,Ly%+18
  Box 24,Ly%+3,142,Ly%+15
  Deffill 1,2,8
  Fill 22,Ly%+1
Return
'
Procedure Dialog_box
  Deffill Df%,2,8
  Fill 58,11
  Pbox 6,50,160,193
Return
'
Procedure Yes_or_no
  Deffill Df%,2,8
  Pbox 24,Ly%+3,78,Ly%+15
  Pbox 88,Ly%+3,142,Ly%+15
  Color 0
  Box 21,Ly%,81,Ly%+18
  Box 85,Ly%,145,Ly%+18
  Box 24,Ly%+3,78,Ly%+15
  Box 88,Ly%+3,142,Ly%+15
  Deffill 1,2,8
  Fill 22,Ly%+1
  Fill 86,Ly%+1
  Deftext 0,0,0,6
  Text 37,Ly%+12,"Yes."
  Text 104,Ly%+12,"No!"
Return
'
' ***************************** KEYBOARD INPUT ************************
Procedure Determine_new_word
  ' The user types a new word to accompany the puzzle picture.  Typing
  ' <Return> signifies that the word is complete.  An opportunity is
  ' then presented to change the word if necessary.
  Start_determining:
  Df%=14
  @Dialog_box
  Qy%=25
  Deftext 0,0,0,6
  Text 15,65+Qy%,"  Type the word"
  Text 15,75+Qy%," for your puzzle"
  Text 15,85+Qy%,"picture and press"
  Text 15,95+Qy%,"    <Return>."
  @Get_word
  Df%=14
  @Dialog_box
  @Yes_or_no
  Deftext 0,0,0,6
  Text 10,90,"  Your word is:"
  Text 10,125,"  Is that right?"
  Deftext 0,0,0,13
  Text 36,110,Nw_word$
  Showm
  @Check_mouse
  If Yes%=0
    Goto Start_determining
  Endif
Return
'
Procedure Get_word
  Deftext 0,0,0,13
  Gx%=17
  For I%=1 To 12
    Text Gx%,144,"_ "
    Add Gx%,11
  Next I%
  Get 5,50,161,193,Rubber_box$
  A%=0
  Hidem
  For I%=1 To 12
    Lttr$(I%)=""
  Next I%
  Ltter_count%=1
  Nw_word$=""
  Gx%=16
  Repeat
    Backed_up:
    Repeat
    Until Inkey$=""
    A%=Inp(2)
    ' If the user presses the Backspace key, the last letter typed is erased.
    If A%=8
      Put 5,50,Rubber_box$
      Lttr$(Ltter_count%-1)=""
      Deffill Df%,2,8
      Pbox 15,125,160,140
      If Ltter_count%>1
        Dec Ltter_count%
        Sub Gx%,11
        Lx%=16
        For I%=1 To Ltter_count%
          Deftext 0,0,0,13
          Text Lx%,140,Lttr$(I%)
          Add Lx%,11
        Next I%
      Endif
      Goto Backed_up
    Endif
    ' The following clause renumbers the ASCII code of the letter typed
    ' if the user is typing in lower case.
    If A%>90
      A%=A%-32
    Endif
    If A%>63 And A%<91 And Ltter_count%<13
      Lttr$(Ltter_count%)=Chr$(A%)
      Deftext 0,0,0,13
      Text Gx%,140,Lttr$(Ltter_count%)
      Inc Ltter_count%
      Add Gx%,11
    Endif
    Pause 5
  Until A%=13
  Dec Ltter_count%
  For I%=1 To Ltter_count%
    Nw_word$=Nw_word$+Lttr$(I%)
  Next I%
Return
'
Procedure Get_word2
  Deftext 0,0,0,13
  Gx%=17+22
  For I%=1 To 8
    Text Gx%,144,"_ "
    Add Gx%,11
  Next I%
  Get 5,50,161,193,Rubber_box$
  A%=0
  Hidem
  For I%=1 To 8
    Lttr$(I%)=""
  Next I%
  Ltter_count%=1
  Nw_word$=""
  Gx%=16+22
  Repeat
    Backed_up2:
    Repeat
    Until Inkey$=""
    A%=Inp(2)
    ' If the user presses the Backspace key, the last letter typed is erased.
    If A%=8
      Put 5,50,Rubber_box$
      Lttr$(Ltter_count%-1)=""
      Deffill Df%,2,8
      Pbox 15,125,160,140
      If Ltter_count%>1
        Dec Ltter_count%
        Sub Gx%,11
        Lx%=16+22
        For I%=1 To Ltter_count%
          Deftext 0,0,0,13
          Text Lx%,140,Lttr$(I%)
          Add Lx%,11
        Next I%
      Endif
      Goto Backed_up2
    Endif
    ' The following clause renumbers the ASCII code of the letter typed
    ' if the user is typing in lower case.
    If A%>90
      A%=A%-32
    Endif
    If A%>63 And A%<91 And Ltter_count%<9
      Lttr$(Ltter_count%)=Chr$(A%)
      Deftext 0,0,0,13
      Text Gx%,140,Lttr$(Ltter_count%)
      Inc Ltter_count%
      Add Gx%,11
    Endif
    Pause 5
  Until A%=13
  Dec Ltter_count%
  For I%=1 To Ltter_count%
    Nw_word$=Nw_word$+Lttr$(I%)
  Next I%
Return
'
' ************************ SAVE/LOAD A WORD FILE **********************
Procedure Save_it
  Here_goes%=1
  @Determine_new_word
  Here_goes%=0
  Ly%=145
  Qy%=25
  Df%=14
  @Dialog_box
  @Yes_or_no
  Deftext 0,0,0,6
  Text 10,65+Qy%," Are you ready to"
  Text 7,75+Qy%," save this picture"
  Text 10,85+Qy%," to use as a word"
  Text 10,95+Qy%,"      puzzle?"
  @Check_mouse
  If Yes%=0
    Goto No_save
  Endif
  If Nw_word$=""
    @No_new_word
    Goto No_save
  Endif
  Sput Current_screen$
  Restore Drw_box_puzzle_data
  Puz$=""
  Sizetotal%=0
  For I%=1 To 9
    Read Lx%,Ly%,Rx%,Ry%
    Get Lx%,Ly%,Rx%,Ry%,Puzzle$(I%)
    Puz$=Puz$+Puzzle$(I%)
    Sizepuz%(I%)=Len(Puzzle$(I%))
    Sizetotal%=Sizetotal%+Sizepuz%(I%)
  Next I%
  ' * Make sure there is enough room on the disk to accommodate new record:
  If Dfree(Dev%+1)>14082
    Open "R",#1,File$,12+Sizetotal%
    Field #1,12 As Tempnw_word$,Sizetotal% As Temppuz$
    Recno%=(Lof(#1)/(Sizetotal%+12))+1
    Lset Tempnw_word$=Nw_word$
    Lset Temppuz$=Puz$
    Put #1,Recno%
  Else
    @No_room_to_save
  Endif
  Close #1
  No_save:
Return
'
Procedure Load_it
  If Exist(File$)
    Sizepuz%(0)=0
    Tempnw_word$=""
    Open "R",#1,File$,Sizetotal%+12
    Field #1,12 As Tempnw_word$,Sizetotal% As Puz$
    Rr%=Lof(#1)/(Sizetotal%+12)
    If Play_game%=1
      No_more%=0
      Try_again:
      For I%=1 To Rr%
        Exit If Record_already_chosen%(I%)=0
        If I%=Rr% And Record_already_chosen%(Rr%)=1
          @No_more_puzzles
          No_more%=1
        Endif
        Exit If No_more%=1
      Next I%
      If No_more%=1
        Lsuccess%=0
        Close #1
        @Clear_records
        Goto No_load
      Endif
      Recno%=Random(Rr%)+1
      ' * Make sure this record isn't a repeat:
      If Record_already_chosen%(Recno%)=1
        Goto Try_again
      Endif
      Record_already_chosen%(Recno%)=1
    Else
      If File_number%>Rr%
        File_number%=1
      Endif
      File_number$="PUZZLE #"+Str$(File_number%)
      Deftext 10,0,0,6
      Text 57,34,File_number$
      Recno%=File_number%
    Endif
    Get #1,Recno%
    Close #1
    Strposit%=1
    For I%=1 To 9
      Puzzle$(I%)=Mid$(Puz$,Strposit%,Sizepuz%(I%))
      Strposit%=Strposit%+Sizepuz%(I%)
    Next I%
    ' The following loop establishes Real_word$ as the part of Tempnw_word$
    ' that consists of letters rather than spaces.
    Real_word$=""
    For I%=1 To 12
      If Mid$(Tempnw_word$,I%,1)<>" "
        Real_word$=Real_word$+Mid$(Tempnw_word$,I%,1)
      Endif
    Next I%
    Lsuccess%=1
    If Play_game%<>1
      Deffill 0,2,8
      Pbox 57,19,160,40
      Deftext 10,0,0,6
      Text 57,34,Real_word$
    Endif
  Else
    @File_not_found
    Lsuccess%=0
  Endif
  No_load:
Return
'
Procedure Fill_puzzle_array
  Puz$=""
  Restore Drw_box_puzzle_data
  For I%=1 To 9
    Read Lx%,Ly%,Rx%,Ry%
    Get Lx%,Ly%,Rx%,Ry%,Puzzle$(I%)
    Puz$=Puz$+Puzzle$(I%)
    Sizepuz%(I%)=Len(Puzzle$(I%))
    Sizetotal%=Sizetotal%+Sizepuz%(I%)
  Next I%
Return
'
' **************************** CLEARANCE ***************************
Procedure Clear_instructions
  Deffill 0,2,8
  Pbox 0,19,319,43
Return
'
Procedure Clear_junk
  @Clear_instructions
  Graphmode 1
  Deffill 0,2,8
  Fill 58,1
  Deffill 0,2,8
  Pbox 171,105,319,159
  Put 177,44,Alphabet_grid$
  Deffill 1,2,8
  Pbox 6,50,160,193
  Graphmode 2
Return
'
Procedure Clear_scores
  Deffill 0,2,8
  Pbox 295,150,319,199
Return
'
Procedure Clear_scores1
  Deffill 0,2,8
  Pbox 275,180,319,199
Return
'
Procedure Clear_records
  For I%=1 To 200
    Record_already_chosen%(I%)=0
  Next I%
Return
'
Procedure Clear_draw_options
  Put 171,88,Clear_draw_options$
  Deffill 0,2,8
  Fill 172,67
Return
'
' ******************************* SOUNDS *********************************
Procedure Select_sound
  Sound 1,15,6,3,2
  Sound 1,15,6,4,2
  Sound 1,15,8,4,6
  Sound 1,0,0,0,0
Return
'
Procedure Other_sound
  Sound 1,15,6,4,2
  Sound 1,15,1,4,5
  Sound 1,0,0,0,0
Return
'
Procedure Other_sound2
  Sound 1,15,6,3,2
  Sound 1,15,1,2,5
  Sound 1,0,0,0,0
Return
'
Procedure Finale_sound
  Hidem
  Restore Finale_data
  Read N%
  For I%=1 To N%
    Read Nt%,Oct%,Dur%
    Sound 1,15,Nt%,Oct%,Dur%
    Sound 1,0,0,0,0
    Pause 5
  Next I%
Return
'
Procedure Argh
  Sound 1,15,7,3,200
  Nt%=6
  Deftext 2,4,0,13
  For I%=1 To 5
    Text 13+15*I%,107+16*I%,"ARGH!"
    Sound 1,15,Nt%,3,8
    Dec Nt%
  Next I%
  Sound 1,15,1,2,32
  Sound 1,0,0,0,0
Return
'
Procedure Congrats_sound
  Hidem
  Restore Congrats_data
  Length%=25000
  For I%=1 To 4
    Read Dur1%,Dur2%,Dur3%,Nt1%,Oct1%,Nt2%,Oct2%,Nt3%,Oct3%
    Sound 1,0,Nt1%,Oct1%,0
    Sound 2,0,Nt2%,Oct2%,0
    Sound 3,0,Nt3%,Oct3%,0
    Wave 7,7,0,Length%,Dur1%
    Wave 0,0
    Exit If Dur2%=0
    Wave 7,7,0,Length%,Dur2%
    Wave 0,0
    Wave 7,7,0,Length%,Dur3%
  Next I%
  Wave 0,0
Return
'
Procedure Erase_sound
  For Oct%=6 Downto 3
    For Nt%=12 Downto 1
      Sound 1,15,Nt%,Oct%,3
    Next Nt%
  Next Oct%
  Sound 1,0,0,0,0
Return
'
Procedure Dud_sound
  For Nt%=12 Downto 1
    For Oct%=4 Downto 3
      Sound 1,15,Nt%,Oct%,5
      Sound 1,0,0,0,0
    Next Oct%
  Next Nt%
  Sound 1,15,12,2,30
  Sound 1,0,0,0,0
Return
'
Procedure Alert_sound
  Sound 1,15,10,3,2
  Sound 1,0,0,0,0
Return
'
' ******************************* DATA ********************************
Finale_data:
' Formula: Nt%,Oct%,Dur%
Data 7
Data 6,4,16
Data 1,4,8
Data 1,4,8
Data 3,4,16
Data 1,4,32
Data 5,4,16
Data 6,4,64
'
Congrats_data:
' Formula: Dur1%,Dur2%,Dur3%Nt1%,Oct1%,Nt2%,Oct2%,Nt3%,Oct3%
Data 32,16,16
Data 5,4,8,4,1,5
Data 32,16,16
Data 8,4,1,5,5,5
Data 32,16,16
Data 1,5,5,5,8,5
Data 64,0,0
Data 5,5,8,5,1,6
'
Alphabet_data:
' Formula: Lx%,Ly%,A$,N%
Data 177,44,"A",1
Data 192,44,"B",2
Data 207,44,"C",3
Data 222,44,"D",4
Data 237,44,"E",5
Data 252,44,"F",6
Data 267,44,"G",7
Data 282,44,"H",8
Data 297,44,"I",9
Data 177,63,"J",10
Data 192,63,"K",11
Data 207,63,"L",12
Data 222,63,"M",13
Data 237,63,"N",14
Data 252,63,"O",15
Data 267,63,"P",16
Data 282,63,"Q",17
Data 297,63,"R",18
Data 177,82,"S",19
Data 192,82,"T",20
Data 207,82,"U",21
Data 222,82,"V",22
Data 237,82,"W",23
Data 252,82,"X",24
Data 267,82,"Y",25
Data 282,82,"Z",26
'
Clor_choice_data1:
' Formula: Col% (color number),Lx% (upper left-hand x-position of option)
Data 2,171
Data 10,196
Data 11,221
Data 14,246
Data 12,271
Data 4,296
'
Clor_choice_data2:
' Formula: Col% (color number),Lx% (upper left-hand x-position of option)
Data 3,171
Data 6,196
Data 7,221
Data 5,246
Data 13,271
Data 15,296
'
Shell_data:
' Formula: Lx%,Ly%,Rx%,Ry%,C%,I$,Tx%
Data 0,85,142,137,3,"Play the Game",18
Data 177,85,319,137,12,"Make a Puzzle",195
Data 83,147,225,199,2,"E X I T",125
'
All_screens_data:
' Formula for first four items: C%,C$,Cx%,Lx%,Ly%,Rx%,Ry%
Data 2,"EXIT",11,0,0,52,18
Data 3,"PLAY",67,57,0,109,18
Data 11,"HELP",125,114,0,166,18
Data 0,44,166,199
'
Creation_screen_data:
' Formula: C%,Lx%
Data 2,171
Data 10,196
Data 11,221
Data 14,246
Data 12,271
Data 4,296
Data 3,171
Data 6,196
Data 7,221
Data 5,246
Data 13,271
Data 15,296
Data 0,183
Data 1,208
' Formula: Cx%,C$
Data 190,"FILL",182,"CIRCLE",190,"LINE",261,"FRAME",261,"DRAW"
'
Drw_box_puzzle_data:
' Formula:  Lx%,Ly%,Rx%,Ry%
Data 6,50,57,98
Data 57,50,109,98
Data 109,50,160,98
'
Data 6,98,57,145
Data 57,98,109,145
Data 109,98,160,145
'
Data 6,145,57,193
Data 57,145,109,193
Data 109,145,160,193
'
