home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
No Fragments Archive 10: Diskmags
/
nf_archive_10.iso
/
MAGS
/
STFORMAT
/
STF18A.MSA
/
SIDE_2_DOT2DOT_DOTMAKER.LST
< prev
next >
Wrap
File List
|
1990-11-04
|
30KB
|
1,434 lines
'
' *********************************************************************
' D O T M A K E R
' Puzzle Editor for DOT-TO-DOTS
' yet another kidprg in GFA Basic from
' D.A. Brumleve
' Copyright 1989 by ST-LOG
' **********************************************************************
' Version 3.2
' February 21, 1989
' **********************************************************************
' REFERENCE
' **********************************************************************
' VARIABLES
' Aa%
' Ab%
' Ac%
' Ad%
' Addx$
' Addx%()
' Addxx$
' Addy$
' Addy%()
' Addyy$
' Adx%()
' Ady%()
' Alrt$
' Bb%
' C$
' C%
' Cc%
' Ch%
' Ch1%
' D$
' D%
' Ddd$
' Dn%
' Dot_mode%
' Dummy%
' Dur%
' Edit_option$
' Got_dot%
' Grid$
' Hh%
' I%
' Ii%
' J%
' Jj%
' Just_starting%
' K%
' Lnumber%
' Lsuccess%
' Main_option$
' Main_screen$
' Mm%
' N%
' Nding$
' Nding%
' Nn%
' No_dot%
' Nt%
' Numc%
' Oct%
' Oo%
' P$
' Palette%()
' Pdot%
' Recno%
' Rez%
' Rr%
' Screen$
' T$
' Temp_grid$
' Tt%
' Ttt%
' Undo$
' X$
' X%()
' Xd%
' Xx$
' Y$
' Y%()
' Y1%
' Y2%
' Yd%
' Yy$
' Z$
' Z%
' Zn%
' Zz%
'
' ********************* INITIALIZE AND SET UP SCREEN **********************
Sget Screen$
Rez%=Xbios(4)
If Rez%<>0
Alrt$=" |This kidprg requires|low resolution."
Alert 3,Alrt$,1,"Oops!",Dummy%
End
Endif
Hidem
Defmouse 0
Dim X%(27),Y%(27),Palette%(15),Addx%(100),Addy%(100),Ady%(100),Adx%(100)
@Save_palette
@Black_screen
Cls
Graphmode 2
@Main_screen
Cls
@Edit_screen
Cls
@Title
Cls
Sput Main_screen$
D%=1
Nding%=0
Lnumber%=0
Z%=1
Zz%=1
Defmouse 0
Showm
'
' ***************************** MAIN LOOP ***************************
Do
Mouse Aa%,Bb%,Cc%
Vsync
If Cc%>0
If Aa%>0 And Aa%<50
' *** exit
If Bb%>0 And Bb%<16
Deffill 2
Fill 6,1
Sget Screen$
Numc%=2
@Select_sound
@Alert_box2
@Alert_box3
Deftext 1,0,0,6
Text 89,85,"Do you really want"
Text 88,105," to stop?"
@Alert_check
If Ab%>74 And Ab%<154
Pause 15
@Finale_sound
Cls
@R_palette
End
Else
Sput Screen$
Pause 15
Deffill 11
Fill 6,1
Endif
Endif
' *** help
If Bb%>19 And Bb%<35
Deffill 4
Fill 6,34
@Select_sound
Sget Screen$
Numc%=4
K%=0
@Help_alert
@Help_alert2
@Help1
@Help_alert_check
Sput Screen$
Pause 15
Deffill 11
Fill 6,34
Endif
' *** print
If Bb%>38 And Bb%<54 And X%(1)<>0
Sget Screen$
Deffill 3
Fill 1,39
@Select_sound
Numc%=3
@Alert_box2
@Alert_box3
Deftext 1,0,0,6
Text 87,85," Do you want to"
Text 88,105,"print this puzzle?"
@Alert_check
If Ab%>74 And Ab%<154
@Print_it
Else
Sput Screen$
Endif
@Let_go
Pdot%=0
Pause 15
Endif
' *** save
If Bb%>130 And Bb%<146
If X%(D%-1)<>0
Sget Screen$
Deffill 5
Fill 1,131
@Select_sound
@Let_go
Numc%=5
@Connect_q
@Alert_box2
@Alert_box3
Deftext 1,0,0,6
Text 87,85," Do you want to"
Text 84,105," save this puzzle?"
@Alert_check
If Ab%>74 And Ab%<154
@Save_it
Endif
Sput Screen$
Pause 15
Endif
Endif
' *** load
If Bb%>164 And Bb%<180
Sget Screen$
Deffill 14
Fill 1,165
@Select_sound
Pause 15
@Let_go
@Clear_arrays
Inc Lnumber%
@Load_it
Pause 15
Sput Screen$
If Lsuccess%=1
@Clear_dot_box
@Restore_extra_lines2
@Redraw_pic
Endif
Showm
Endif
' *** edit
If Bb%>74 And Bb%<90
Hidem
@Make_mouse
Defmouse Cross$
Deffill 9
Fill 1,75
@Select_sound
@Let_go
Pause 15
Put 0,0,Edit_option$
Deffill 5
Fill 1,75
Just_starting%=1
Dot_mode%=1
Showm
@Place_dots
Hidem
Defmouse 0
Showm
Put 0,0,Main_option$
Endif
' *** new
If Bb%>183 And Bb%<199
Deffill 12
Fill 1,184
@Select_sound
@Clear_arrays
@Erase_sound
Pause 15
Sput Main_screen$
Endif
Endif
Endif
Loop
'
' ******************************* EDITOR ******************************
Procedure Place_dots
Do
@Let_go
Repeat
Mouse Aa%,Bb%,Cc%
Until Cc%>0
Exit If Aa%>0 And Aa%<50 And Bb%>0 And Bb%<16
If Aa%>0 And Aa%<50
' *** undo
If Bb%>183 And Bb%<199 And Just_starting%=0
Deffill 6
Fill 1,184
@Select_sound
Put 60,0,Temp_grid$
If Dot_mode%=1
X%(D%-1)=0
Y%(D%-1)=0
Dec D%
Else
If Zz%=1
Z%=Z%-2
Else
Z%=Z%-1
Endif
Zz%=1
Endif
Pause 15
Put 0,183,Undo$
Just_starting%=1
Goto No_dot
Endif
' *** alter a dot
If Bb%>93 And Bb%<109 And X%(D%-1)<>0
Deffill 13
Fill 1,94
@Select_sound
@Let_go
Sget Screen$
Deftext 1,1,0,4
Text 72,196," CLICK ON THE DOT YOU WANT TO CHANGE."
@Determine_dot
Sget Screen$
Hidem
Defmouse 0
Showm
@Alert_box4
@Alert_check2
Hidem
Defmouse Cross$
Showm
Sput Screen$
If Ab%>103 And Ab%<183
@Replace_dots
@Clear_dot_box
@Restore_extra_lines2
@Redraw_pic
@Let_go
Else
@Delete_dots
Endif
Clr Temp_grid$
Just_starting%=1
@Let_go
Deffill 11
Fill 1,94
Goto No_dot
Endif
' *** show
If Bb%>19 And Bb%<35 And X%(1)<>0
Hidem
Deffill 3
Fill 6,20
@Select_sound
Sget Screen$
Numc%=3
Show%=1
@Alert_box2
@Alert_box3
Deftext 1,0,0,6
Text 87,85," Do you want to"
Text 86,105," see this puzzle?"
Defmouse 0
Showm
@Alert_check
If Ab%>74 And Ab%<154
@Show_it
Endif
Hidem
Defmouse Cross$
Showm
Sput Screen$
@Let_go
Pdot%=0
Show%=0
Pause 15
Deffill 11
Fill 6,20
Endif
' *** dot mode
If Bb%>74 And Bb%<90 And Dot_mode%=0
Put 0,0,Edit_option$
Deffill 5
Fill 1,75
@Select_sound
Dot_mode%=1
Just_starting%=1
Clr Temp_grid$
Goto No_dot
Endif
' *** line mode
If Bb%>130 And Bb%<146 And Dot_mode%=1
Put 0,0,Edit_option$
Deffill 10
Fill 1,131
@Select_sound
Dot_mode%=0
Just_starting%=1
Clr Temp_grid$
Goto No_dot
Endif
Endif
' *** in the grid area in line mode
If Aa%>60 And Bb%>0 And Aa%<319 And Bb%<199 And Dot_mode%=0
If Aa%>71 And Bb%>15 And Aa%<305 And Bb%<185 And Dot_mode%=0
@Let_go
If Z%<101
If Zz%=1
Get 60,0,319,199,Temp_grid$
Endif
Color 2
Draw Aa%,Bb%
Adx%(Z%)=Aa%
Ady%(Z%)=Bb%
Just_starting%=0
If Zz%=2
Draw Adx%(Z%-1),Ady%(Z%-1) To Aa%,Bb%
Addx%(Z%)=Aa%
Addy%(Z%)=Bb%
Addx%(Z%-1)=Adx%(Z%-1)
Addy%(Z%-1)=Ady%(Z%-1)
Endif
Inc Z%
If Zz%=1
Zz%=2
Else
Zz%=1
Endif
@Other_sound
Else
Hidem
Sget Screen$
Deftext 1,1,0,4
Text 72,196," WHOOPS! YOU ALREADY HAVE 5O LINES!"
@Buzz_sound
Pause 100
Sput Screen$
Showm
Endif
Else
@Dud_sound
Endif
Goto No_dot
Endif
' *** in the grid area in dot mode
If Aa%>60 And Bb%>0 And Aa%<319 And Bb%<199 And Dot_mode%=1
If Aa%>71 And Bb%>15 And Aa%<305 And Bb%<185 And Dot_mode%=1
If D%<27
Xd%=Aa%
Yd%=Bb%
No_dot%=0
If D%>1
For I%=1 To D%-1
If Abs(X%(I%)-Xd%)<16 And Abs(Y%(I%)-Yd%)<16
No_dot%=1
Endif
Exit If No_dot%=1
Next I%
If Abs(X%(I%)-Xd%)<16 And Abs(Y%(I%)-Yd%)<16
Hidem
Sget Screen$
Deftext 1,1,0,4
Text 76,196," THAT'S TOO CLOSE TO ANOTHER DOT!"
@Dud_sound
Pause 100
Sput Screen$
Showm
Goto No_dot
Endif
Endif
Sound 1,15,4,4,8
Sound 1,15,1,5,4
Sound 1,0,0,0,0
Color 1
Deffill 11
Get 60,0,319,199,Temp_grid$
X%(D%)=Aa%
Y%(D%)=Bb%
If D%>1
Draw X%(D%-1),Y%(D%-1) To X%(D%),Y%(D%)
Endif
Pcircle X%(D%),Y%(D%),7
Circle X%(D%),Y%(D%),7
If D%=20
Ddd$="2O"
Text X%(D%)-6,Y%(D%)+2,Ddd$
Goto No_dot2
Endif
If D%=10
Ddd$="1O"
Text X%(D%)-6,Y%(D%)+2,Ddd$
Goto No_dot2
Endif
If Len(Str$(D%))=1
Tt%=3
Else
Tt%=6
Endif
Deftext 1,1,0,4
Text X%(D%)-Tt%,Y%(D%)+2,D%
No_dot2:
If D%>1
I%=D%-1
Pcircle X%(D%-1),Y%(D%-1),7
Circle X%(D%-1),Y%(D%-1),7
If I%=20
Ddd$="2O"
Text X%(I%)-6,Y%(I%)+2,Ddd$
Goto No_dot3
Endif
If I%=10
Ddd$="1O"
Text X%(I%)-6,Y%(I%)+2,Ddd$
Goto No_dot3
Endif
If Len(Str$(D%-1))=1
Tt%=3
Else
Tt%=6
Endif
Text X%(D%-1)-Tt%,Y%(D%-1)+2,D%-1
Endif
No_dot3:
Inc D%
Just_starting%=0
Else
Hidem
Sget Screen$
Deftext 1,1,0,4
Text 76,196," WHOOPS! YOU ALREADY HAVE 26 DOTS!"
@Buzz_sound
Pause 100
Sput Screen$
Showm
Endif
Else
@Dud_sound
Endif
Endif
No_dot:
Loop
Deffill 9
Fill 1,1
@Select_sound
@Let_go
If Zz%=2
Zz%=1
Put 60,0,Temp_grid$
Endif
Pause 15
Return
'
' ****************************** DETERMINE DOT ****************************
Procedure Determine_dot
Got_dot%=0
Again:
Repeat
Mouse Hh%,Ii%,Jj%
Until Jj%>0 And Hh%>64 And Ii%>8 And Hh%<312 And Ii%<192
@Let_go
For I%=1 To D%-1
If Hh%>X%(I%)-7 And Hh%<X%(I%)+7 And Ii%>Y%(I%)-7 And Ii%<Y%(I%)+7
Sput Screen$
Deffill 2
Pcircle X%(I%),Y%(I%),7
Color 1
Circle X%(I%),Y%(I%),7
J%=I%
Got_dot%=1
Deftext 1,0,0,4
If J%=10
Text X%(J%)-6,Y%(J%)+2,"1O"
Goto Did_it2
Endif
If J%=20
Text X%(J%)-6,Y%(J%)+2,"2O"
Goto Did_it2
Endif
If Len(Str$(J%))=1
Tt%=3
Else
Tt%=6
Endif
Text X%(J%)-Tt%,Y%(J%)+2,J%
Did_it2:
Endif
Exit If Got_dot%=1
Next I%
If Got_dot%=0
@Dud_sound
Goto Again
Endif
Return
'
' ********************************* DELETE DOTS ****************************
Procedure Delete_dots
If D%-1>1
For Ttt%=J% To D%-1
X%(Ttt%)=X%(Ttt%+1)
Y%(Ttt%)=Y%(Ttt%+1)
Next Ttt%
Endif
D%=D%-1
@Clear_dot_box
@Restore_extra_lines2
@Redraw_pic
Return
'
' ******************************** REPLACE DOTS ****************************
Procedure Replace_dots
Deffill 11
Pcircle X%(J%),Y%(J%),7
Color 1
Circle X%(J%),Y%(J%),7
Try2:
Deftext 1,1,0,4
Text 72,196," CLICK ON THE GRID FOR A NEW DOT."
Repeat
Mouse Aa%,Bb%,Cc%
Until Cc%>0 And Aa%>71 And Bb%>15 And Aa%<305 And Bb%<185
No_dot%=0
For I%=1 To D%-1
If Abs(X%(I%)-Aa%)<16 And Abs(Y%(I%)-Bb%)<16
No_dot%=1
Endif
If I%=J%
No_dot%=0
Endif
Exit If No_dot%=1
Next I%
If No_dot%=1
Hidem
Deffill 11,2,8
Pbox 61,188,318,198
Deftext 1,1,0,4
Text 76,196," THAT'S TOO CLOSE TO ANOTHER DOT!"
@Dud_sound
Pause 100
Deffill 11,2,8
Pbox 61,188,318,198
Showm
Goto Try2
Endif
@Let_go
Sound 1,15,4,4,8
Sound 1,15,1,5,4
Sound 1,0,0,0,0
X%(J%)=Aa%
Y%(J%)=Bb%
Return
'
' *************************** DISK ACTIVITIES ***************************
Procedure Load_it
If Exist("dot2dots.dat")
Hidem
Open "r",#1,"dot2dots.dat",255
Field #1,1 As Nding$,1 As D$,1 As Z$,100 As Addx$,100 As Addy$,26 As X$,26 As Y$
Rr%=Lof(#1)/255
If Lnumber%>Rr%
Lnumber%=1
Endif
Get #1,Lnumber%
Dn%=Asc(D$)
Zn%=Asc(Z$)
Nding%=Asc(Nding$)
Color 1
For I%=1 To Zn%
Addx%(I%)=Asc(Mid$(Addx$,I%,1))+72
Addy%(I%)=Asc(Mid$(Addy$,I%,1))+15
Next I%
For I%=1 To Dn%
X%(I%)=Asc(Mid$(X$,I%,1))+72
Y%(I%)=Asc(Mid$(Y$,I%,1))+15
Next I%
Close #1
D%=Dn%+1
Z%=Zn%+1
Lsuccess%=1
Else
Numc%=14
K%=0
Pause 15
@Buzz_sound
@Help_alert
@Help_alert2
@Load_dialog
Showm
@Help_alert_check
Lsuccess%=0
Endif
Return
'
Procedure Save_it
Hidem
Xx$=""
Yy$=""
Addxx$=""
Addyy$=""
X$=String$(26,0)
Y$=X$
Addx$=String$(100,0)
Addy$=Addx$
For I%=1 To 100
Addxx$=Addxx$+Chr$(Addx%(I%)-72)
Addyy$=Addyy$+Chr$(Addy%(I%)-15)
Next I%
For I%=1 To D%-1
Xx$=Xx$+Chr$(X%(I%)-72)
Yy$=Yy$+Chr$(Y%(I%)-15)
Next I%
Open "r",#1,"dot2dots.dat",255
Field #1,1 As Nding$,1 As D$,1 As Z$,100 As Addx$,100 As Addy$,26 As X$,26 As Y$
Recno%=(Lof(#1)/255)+1
If Dfree(0)>(Recno%)*255
Lset Nding$=Chr$(Nding%)
Lset D$=Chr$(D%-1)
Lset Z$=Chr$(Z%-1)
Lset Addx$=Addxx$
Lset Addy$=Addyy$
Lset X$=Xx$
Lset Y$=Yy$
Put #1,Recno%
Close #1
Showm
Else
Close #1
Numc%=6
K%=0
Pause 15
@Buzz_sound
@Help_alert
@Help_alert2
@Save_dialog
Showm
@Help_alert_check
Endif
Return
'
' ***************** CLEAR/RESTORE SCREEN AREAS AND VARIABLES ***************
Procedure Clear_dot_box
Deffill 11
Pbox 61,1,318,198
Put 60,0,Grid$
Return
'
Procedure Clear_arrays
For I%=1 To 27
X%(I%)=0
Y%(I%)=0
Next I%
For I%=1 To 100
Addx%(I%)=0
Addy%(I%)=0
Next I%
D%=1
Dn%=0
Zn%=0
Z%=1
Return
'
Procedure Clear_numbers
Color 1
For I%=1 To D%-1
Deffill 11
Pcircle X%(I%),Y%(I%),7
Next I%
For I%=2 To D%-1
Draw X%(I%-1),Y%(I%-1) To X%(I%),Y%(I%)
Next I%
If Nding%=1
Draw X%(1),Y%(1) To X%(D%-1),Y%(D%-1)
Endif
Return
'
Procedure Restore_extra_lines
If Z%>1
For I%=2 To Z% Step 2
Color 1
Draw Addx%(I%-1),Addy%(I%-1) To Addx%(I%),Addy%(I%)
Next I%
Endif
Return
'
Procedure Restore_extra_lines2
If Z%>1
For I%=2 To Z% Step 2
Color 2
Draw Addx%(I%-1),Addy%(I%-1) To Addx%(I%),Addy%(I%)
Next I%
Endif
Return
'
Procedure Restore_numbers
For I%=1 To D%-1
Deffill 11
Pcircle X%(I%),Y%(I%),7
Color 1
Circle X%(I%),Y%(I%),7
Deftext 1,1,0,4
If I%=10
Text X%(I%)-6,Y%(I%)+2,"1O"
Goto Did_it1
Endif
If I%=20
Text X%(I%)-6,Y%(I%)+2,"2O"
Goto Did_it1
Endif
If Len(Str$(I%))=1
Tt%=3
Else
Tt%=6
Endif
Text X%(I%)-Tt%,Y%(I%)+2,I%
Did_it1:
Next I%
Return
'
Procedure Redraw_pic
If D%-1>0
For I%=1 To D%-1
If I%>1
Color 1
Draw X%(I%),Y%(I%) To X%(I%-1),Y%(I%-1)
Endif
Next I%
For I%=1 To D%-1
Deffill 11
Pcircle X%(I%),Y%(I%),7
Color 1
Circle X%(I%),Y%(I%),7
Deftext 1,1,0,4
If I%=10
Text X%(I%)-6,Y%(I%)+2,"1O"
Goto Did_it
Endif
If I%=20
Text X%(I%)-6,Y%(I%)+2,"2O"
Goto Did_it
Endif
If Len(Str$(I%))=1
Tt%=3
Else
Tt%=6
Endif
Text X%(I%)-Tt%,Y%(I%)+2,I%
Did_it:
Next I%
Endif
Return
'
' ***************************** SCREENS **********************************
Procedure Main_screen
Deffill 11
Pbox 0,0,319,199
Deffill 7,3,12
Fill 72,16
Get 72,16,304,184,Grid$
Cls
Deffill 1,2,8
@Clear_dot_box
Graphmode 2
Color 1
Restore Screen_data
For I%=1 To 7
Read Y1%,Y2%,C%
Deffill 11
Pbox 0,Y1%,50,Y2%+2
Box 0,Y1%,50,Y2%+2
Deffill C%
Pbox 2,Y1%+2,48,Y2%
Box 2,Y1%+2,48,Y2%
Next I%
Deftext 1,0,0,6
Text 10,11,"EXIT"
Text 10,30,"HELP"
Text 6,49,"PRINT"
Text 10,85,"EDIT"
Text 10,141,"SAVE"
Text 9,175,"LOAD"
Text 6,194,"BLANK"
Deffill 11
Pbox 60,0,319,199
Color 1
Box 60,0,319,199
Put 72,16,Grid$
Get 60,0,319,199,Grid$
Get 0,0,50,199,Main_option$
Sget Main_screen$
Return
'
Procedure Edit_screen
Color 1
Restore Screen2_data
For I%=1 To 6
Read Y1%,Y2%,C%
Deffill 11
Pbox 0,Y1%,50,Y2%+2
Box 0,Y1%,50,Y2%+2
Deffill C%
Pbox 2,Y1%+2,48,Y2%
Box 2,Y1%+2,48,Y2%
Next I%
Deftext 1,0,0,6
Text 10,11,"DONE"
Text 13,85,"DOT"
Text 9,30,"SHOW"
Text 6,104,"ALTER"
Text 10,141,"LINE"
Text 10,194,"UNDO"
Get 0,183,50,199,Undo$
Get 0,0,50,199,Edit_option$
Return
'
Procedure Title
K%=30
Numc%=9
@Clear_arrays
@Title_alert
Deftext 2,1,0,13
Text 98,30,"D O T M A K E R"
Deftext 1,0,0,6
T$=" "+Chr$(191)
Text 47,50,T$
Text 47,50,"Another KIDPRG in GFA Basic"
Deftext 1,0,0,6
Text 89,70,"from D.A. Brumleve"
C$=" "+Chr$(189)
Text 75,89,C$
Text 75,90," 1988 by"
Text 70,130,"As published in ST-Log!"
Deftext 1,5,0,6
Text 75,90," ST-LOG"
Deftext 1,1,0,4
Text 58,110," VERSION 3.2"
Deftext 2,1,0,4
Text 45,150,"PUZZLE FILES CREATED WITH THIS PROGRAM"
Text 43,160,"CAN BE USED WITH THE GAME, DOT-TO-DOTS."
@Help_alert2
@Set_color
Showm
@Help_alert_check
Hidem
Return
'
' ************************ COLOR PALETTE ACTIVITIES **********************
Procedure Set_color
Setcolor 0,4,4,4 !=Color# 0
Setcolor 15,0,0,0 !=Color# 1--black
Setcolor 1,7,0,0 !=Color# 2--red
Setcolor 2,0,6,0 !=Color# 3--(print) green
Setcolor 4,7,4,0 !=Color# 4--(help) orange
Setcolor 6,7,6,0 !=Color# 5--gold
Setcolor 3,7,0,7 !=Color# 6
Setcolor 5,0,5,7 !=Color# 7--blue
Setcolor 7,5,5,5 !=Color# 8
Setcolor 8,3,3,3 !=Color# 9
Setcolor 9,7,3,3 !=Color# 10
Setcolor 10,7,7,7 !=Color# 11--white
Setcolor 12,3,3,7 !=Color# 12
Setcolor 14,5,4,7 !=Color# 13
Setcolor 11,7,3,5 !=Color# 14
Setcolor 13,0,5,0 !=Color# 15
Return
'
Procedure Black_screen
For I%=0 To 15
Setcolor I%,4,4,4
Next I%
Return
'
Procedure Save_palette
For I%=0 To 15
Palette%(I%)=Xbios(7,W:I%,W:-1)
Next I%
Return
'
Procedure R_palette
For I%=0 To 15
Setcolor I%,Palette%(I%)
Next I%
Return
'
' ************************** MOUSE ACTIVITIES ***************************
Procedure Let_go
Repeat
Mouse Mm%,Nn%,Oo%
Until Oo%=0
Return
'
Procedure Make_mouse
Let Cross$=Mki$(7)+Mki$(8)
Let Cross$=Cross$+Mki$(0)
Let Cross$=Cross$+Mki$(11)
Let Cross$=Cross$+Mki$(1)
Restore Ms_data
For I%=1 To 16
Read Backgrnd%
Let Cross$=Cross$+Mki$(Backgrnd%)
Next I%
For I%=1 To 16
Read Foregrnd%
Let Cross$=Cross$+Mki$(Foregrnd%)
Next I%
Return
'
' ******************************* DIALOGS *******************************
Procedure Alert_box1
@Alert_box2
Deffill 11
Pbox 74,80,154,120
Pbox 165,80,245,120
Color 1
Box 74,80,154,120
Box 75+1,81+1,153-1,119-1
Box 165,80,245,120
Box 166+1,81+1,244-1,119-1
Deftext 1,0,0,6
Text 78,135,"Dots Only"
Text 166,135,"Lines Only"
If Show%=1
Text 137,70," See:"
Else
Text 137,70,"Print:"
Endif
Draw 178,90 To 232,100
Draw 232,100 To 200,110
Draw 200,110 To 178,90
Circle 87,90,7
Circle 141,100,7
Circle 109,110,7
Deftext 1,1,0,4
Text 84,92,"1"
Text 138,102,"2"
Text 106,112,"3"
Repeat
Mouse Ab%,Ac%,Ad%
Until Ad%>0 And Ac%>80 And Ac%<120 And ((Ab%>74 And Ab%<154) Or (Ab%>165 And Ab%<245))
@Let_go
If Ab%>74 And Ab%<154
Deffill 3
Fill 75,81
Pdot%=1
Else
Deffill 3
Fill 166,81
Pdot%=0
Endif
@Alert_sound
Pause 15
Return
'
Procedure Alert_box2
Deffill 11
Pbox 65,50,254,149
Color 1
Box 65,50,254,149
Box 66,51,253,148
Box 68,53,251,146
Deffill Numc%
Pbox 69,54,250,145
Return
'
Procedure Alert_box3
Ch%=0
Ch1%=0
Deffill 11
Pbox 74,124,154,140
Pbox 165,124,245,140
Color 1
Box 74,124,154,140
Box 76,126,152,138
Box 165,124,245,140
Box 167,126,243,138
Deftext 1,0,0,6
Text 100,135,"Yes."
Text 195,135,"No."
Return
'
Procedure Alert_box4
Ch%=59
Ch1%=29
Deffill 11
Pbox 103,185,183,199
Pbox 194,185,274,199
Color 1
Box 103,185,183,199
Box 105,187,181,197
Box 194,185,274,199
Box 196,187,272,197
Deftext 1,0,0,6
Text 114,195,"Replace."
Text 209,195,"Remove."
Return
'
Procedure Alert_check
Repeat
Mouse Ab%,Ac%,Ad%
Until Ad%>0 And Ac%>124+Ch% And Ac%<140+Ch% And ((Ab%>74+Ch1% And Ab%<154+Ch1%) Or (Ab%>165+Ch1% And Ab%<245+Ch1%))
Deffill Numc%
If Ch%=59
Ch%=61
Endif
If Ab%>74+Ch1% And Ab%<154+Ch1%
Fill 75+Ch1%,125+Ch%
Else
Fill 166+Ch1%,125+Ch%
Endif
@Alert_sound
Pause 15
@Let_go
Return
'
Procedure Alert_check2
Repeat
Mouse Ab%,Ac%,Ad%
Until Ad%>0 And Ac%>183 And Ac%<199 And ((Ab%>103 And Ab%<183) Or (Ab%>194 And Ab%<274))
Deffill 9
If Ch%=59
Ch%=61
Endif
If Ab%>103 And Ab%<183
Fill 104,186
Else
Fill 195,186
Endif
@Alert_sound
Pause 15
@Let_go
Return
'
Procedure Title_alert
Color 1
Box 30,0,289,199
Box 31,1,288,198
Deffill 11
Pbox 32,2,287,197
Return
'
Procedure Help_alert
Deffill 11
Pbox 61,1,318,198
Color 1
Box 61,1,318,198
Deffill Numc%
Pbox 63,3,316,196
Box 63,3,316,196
Return
'
Procedure Help_alert2
Deffill 11
Pbox 100-K%,175,279-K%,191
Color 1
Box 61-K%,1,318-K%,198
Box 100-K%,175,279-K%,191
Box 102-K%,177,277-K%,189
Deftext 1,0,0,6
Text 117-K%,186," CONTINUE"
Return
'
Procedure Help_alert_check
Repeat
Mouse Ab%,Ac%,Ad%
Until Ad%>0 And Ac%>175 And Ac%<191 And Ab%>100-K% And Ab%<279-K%
Deffill Numc%
Fill 101-K%,176
@Alert_sound
Pause 15
@Let_go
Return
'
Procedure Help1
Deftext 1,0,0,6
Text 66,18,"Use this program to create puz-"
Text 66,28,"zles for use with DOT2DOTS.PRG."
Text 66,38,"Choose EDIT to create or change"
Text 66,48,"a puzzle. Each puzzle may have"
Text 66,58,"up to 26 dots and 5O extra"
Text 66,68,"lines. When drawing, you can"
Text 66,78,"delete your last drawing action"
Text 66,88,"by clicking UNDO, but only if"
Text 66,98,"you haven't made any further"
Text 66,108,"selections. Dots must be"
Text 66,118,"placed several pixels apart."
Text 66,138,"For further information, refer"
Text 66,148,"to the issue of ST-Log in"
Text 66,158,"which this program appeared."
Return
'
Procedure Print_dialog
Deftext 1,0,0,6
Text 66,68," Something is wrong!"
Text 66,88," Is your printer on?"
Text 69,108," Is it connected to"
Text 69,118," your computer?"
Return
'
Procedure Save_dialog
Deftext 1,0,0,6
Text 63,68," Sorry!"
Text 66,88," There is not enough"
Text 69,98," room on this disk to"
Text 66,108," save your work."
Return
'
Procedure No_way_jose
Deftext 1,0,0,6
Text 63,68," Hey!"
Text 66,88," You've only got one"
Text 66,98," puzzle dot in this picture!"
Text 65,108,"I can't show or print the lines"
Text 69,118," 'between' one dot!"
Return
'
Procedure Load_dialog
Deftext 1,0,0,6
Text 68,68," Sorry!"
Text 68,88," There is no DOT2DOTS.DAT"
Text 68,98," file on this disk!"
Return
'
Procedure Connect_q
@Alert_box2
@Alert_box3
Deftext 1,0,0,6
Text 87,85," Do you want the"
Text 84,95,"first and last dots"
Text 84,105," to be connected?"
@Alert_check
@Let_go
If Ab%>74 And Ab%<154
Nding%=1
Else
Nding%=0
Endif
Return
'
' ******************************* SHOW ***********************************
Procedure Show_it
@Alert_box1
If Pdot%=0 And X%(2)<>0
@Connect_q
Endif
If Pdot%=0 And X%(2)=0
Hidem
Numc%=3
K%=0
Pause 25
@Buzz_sound
@Help_alert
@Help_alert2
@No_way_jose
Showm
@Help_alert_check
Hidem
Goto No_show
Endif
Hidem
Deffill 11
Pbox 60,0,319,199
Color 1
Box 60,0,319,199
Deftext 1,1,0,4
Text 72,197," CLICK MOUSE BUTTON TO RESUME."
If Pdot%=1
' show dots only
@Restore_extra_lines
@Restore_numbers
Else
' show lines only
@Clear_numbers
@Restore_extra_lines
Endif
Repeat
Until Mousek
No_show:
Return
'
' ******************************** PRINT ***********************************
Procedure Print_it
@Alert_box1
If Pdot%=0 And X%(2)<>0
@Connect_q
Endif
If Pdot%=0 And X%(2)=0
Numc%=3
K%=0
Pause 25
@Buzz_sound
@Help_alert
@Help_alert2
@No_way_jose
Showm
@Help_alert_check
Hidem
Goto No_prnt
Endif
If Out?(0)<>0
@Black_screen
Cls
Deffill 11
Pbox 60,0,319,199
Color 1
Box 60,0,319,199
If Pdot%=1
' print dots only
@Restore_extra_lines
@Restore_numbers
Get 60,0,319,199,P$
Cls
Put 30,0,P$
Setcolor 0,7,7,7
Setcolor 15,0,0,0
Setcolor 10,7,7,7
Hardcopy
Else
' print lines only
@Clear_numbers
@Restore_extra_lines
Get 60,0,319,199,P$
Cls
Put 30,0,P$
Setcolor 0,7,7,7
Setcolor 15,0,0,0
Setcolor 10,7,7,7
Hardcopy
Endif
@Black_screen
Cls
Else
Numc%=3
K%=0
Pause 15
@Buzz_sound
@Help_alert
@Help_alert2
@Print_dialog
Showm
@Help_alert_check
Endif
@Set_color
No_prnt:
Sput Screen$
Showm
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 Buzz_sound
Sound 1,15,1,1,10
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 Finale_sound
Hidem
Pause 15
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 Erase_sound
For Oct%=6 Downto 3
For N%=12 Downto 1
Sound 1,15,N%,Oct%,3
Next N%
Next Oct%
Sound 1,0,0,0,0
Return
'
Procedure Dud_sound
Sound 1,15,10,3,2
Sound 1,15,1,3,8
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:
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
'
Screen_data:
' exit:
Data 0,14,2
' help:
Data 19,33,4
' print:
Data 38,52,3
' edit:
Data 74,88,11
' save:
Data 130,144,5
' load:
Data 164,178,14
' new:
Data 183,197,12
'
Screen2_data:
' done:
Data 0,14,11
' show:
Data 19,33,3
' add dot:
Data 74,88,5
' change:
Data 93,107,13
' line:
Data 130,144,10
' undo:
Data 183,197,6
'
Ms_data:
Data 0,896,640,640,640,640,640,65278,32770,65278,640,640,640,640,640,896
Data 0,0,256,256,256,256,256,256,32508,256,256,256,256,256,256,0
'