Home » Archimedes archive » Archimedes World » AW-1993-04.adf » AWApril93 » !AWApril93/Goodies/WordSq/!WordSq/!RunImage

!AWApril93/Goodies/WordSq/!WordSq/!RunImage

This website contains an archive of files for the Acorn Electron, BBC Micro, Acorn Archimedes, Commodore 16 and Commodore 64 computers, which Dominic Ford has rescued from his private collection of floppy disks and cassettes.

Some of these files were originally commercial releases in the 1980s and 1990s, but they are now widely available online. I assume that copyright over them is no longer being asserted. If you own the copyright and would like files to be removed, please contact me.

Tape/disk: Home » Archimedes archive » Archimedes World » AW-1993-04.adf » AWApril93
Filename: !AWApril93/Goodies/WordSq/!WordSq/!RunImage
Read OK:
File size: F30B bytes
Load address: 0000
Exec address: 0000
File contents
   10REM >WordSq$Dir.!RunImage
   20REM WordSquare Creation and Solving program
   30REM By Matthew Eglise
   40REM
   50REM Copyright held by Archimedes World magazine
   60REM This program is NOT Public Domain
   70REM
   80REM Version 3.12 - 26th September 1992
   90REM
  100mem1%=9042:mem2%=17100:filetype%=&03C
  110PROCautoload
  120SYS"Hourglass_On"
  130PROCStart("WordSq",mem1%,mem2%)
  140PROCinit
  150PROCCreate_Windows
  160PROCCreate_Menus
  170PROCloadprefs
  180IFd$<>"" PROCLoadOwn(d$)
  190SYS"Hourglass_Off"
  200ON ERROR PROCError:GOTO200
  210REPEAT
  220PROCpoll
  230UNTIL FNnew("quit")<>0
  240PROCCloseDown
  250END
  260:
  270DEFPROCinit
  280DIM word$(168),len%(168),grid%(2400),show%(168),b$(60)
  290DIM selected%(168),start%(168),dir%(168),temp$(168)
  300DIM sx%(168),sy%(168),ex%(168),ey%(168)
  310DIM valid% 32:$valid%="b1,0,15,4,0,1,14,12"
  320DIM text% 8:$text%=""
  330wordswind%=0:words%=0:grid%=0:selection%=0:ef%=0:high%=0
  340nofit%=0:dimx=0:dimy=0:maxh=0:a=0:needs%=0:gaps=25:len%=0
  350wsqtitle$="":selectedword$="":saveformat$="text":solveformat$="":temp$=""
  360mainwind%=0:solvewind%=0:dispwind%=0:wsqx=0:wsqy=0:wsqwords%=0
  370wordssaved%=1:gridsaved%=1:flag%=0:show%=0:found%=0:done%=0
  380startx%=0:starty%=0:dispx%=0
  390dispbox%=0:wordsbox%=0
  400ENDPROC
  410:
  420DEFPROCCreate_Windows
  430PROCSpritesLoad
  440solve_Window%=FNWindowLoad("solve")
  450info_Window%=FNWindowLoad("info")
  460savewords_Window%=FNWindowLoad("savewords")
  470display_Window%=FNWindowLoad("display")
  480words_Window%=FNWindowLoad("words")
  490main_Window%=FNWindowLoad("main")
  500savewsq_Window%=FNWindowLoad("savewsq")
  510prefs_Window%=FNWindowLoad("prefs")
  520Bar_Icon%=FNIconBar("!WordSq")
  530FORI%=4TO171:PROCIconPutText(words_Window%,I%,""):NEXT
  540PROCww
  550ENDPROC
  560:
  570DEFFNEvent_Save(window%)
  580CASE window% OF
  590WHEN savewords_Window% :=TRUE
  600WHEN savewsq_Window% :=TRUE
  610OTHERWISE :=FALSE
  620ENDCASE
  630:
  640DEFPROCCreate_Menus
  650DIM prefs_Menu%(1)
  660menu$="WordSq\Info>info_Window%\Edit\Solve\Preferences\Clear\Quit"
  670Bar_Menu%=FNMenuCreate(menu$)
  680menu$ ="Solve\Info>info_Window%\Show Words\"
  690menu$+="Quit"
  700solve_Menu%=FNMenuCreate(menu$)
  710menu$ ="Display\Info>info_Window%\Show Words\Quit"
  720display_Menu%=FNMenuCreate(menu$)
  730menu$ ="Words\Info>info_Window%\Save Words>savewords_Window%\"
  740menu$+="Quit"
  750words_Menu%=FNMenuCreate(menu$)
  760WlMenu%=FNMenuCreate("Colours")
  770SmMenu%=FNMenuCreate("Colours")
  780LMenu%=FNMenuCreate("Colours")
  790ClMenu%=FNMenuCreate("Colours")
  800menu$="Colours\Words list>WlMenu%\Start mark>SmMenu%\Lines>LMenu%\Latest line>ClMenu%"
  810prefs_Menu%(1)=FNMenuCreate(menu$)
  820menu$ ="Prefs\Info>info_Window%\Colours>prefs_Menu%(1)\Quit"
  830prefs_Menu%=FNMenuCreate(menu$)
  840menu$ ="Create\Info>info_Window%\Show Words\"
  850menu$+="Save Words>savewords_Window%\Save Square>savewsq_Window%\Print Words\Print Square\Quit"
  860main_Menu%=FNMenuCreate(menu$)
  870savewsq_Menu%=0:info_Menu%=0:savewords_Menu%=0
  880PROCMenuDisable(main_Menu%,2)
  890PROCMenuDisable(main_Menu%,3)
  900PROCMenuDisable(main_Menu%,4)
  910PROCMenuDisable(main_Menu%,5)
  920PROCMenuDisable(main_Menu%,6)
  930PROCMenuDisable(solve_Menu%,2)
  940PROCMenuDisable(display_Menu%,2)
  950ENDPROC
  960:
  970DEFFNEvent_Menu(window%)
  980CASE window% OF
  990WHEN Bar_Window%:=Bar_Menu%
 1000WHEN solve_Window%:=solve_Menu%
 1010WHEN display_Window%:=display_Menu%
 1020WHEN words_Window%:=words_Menu%
 1030WHEN main_Window%:=main_Menu%
 1040WHEN prefs_Window%:=prefs_Menu%
 1050OTHERWISE:=FALSE
 1060ENDCASE
 1070:
 1080DEFPROCEvent_WindowClose(window%,buttons%)
 1090CASE window% OF
 1100WHEN solve_Window%:solvewind%=0
 1110WHEN info_Window%
 1120WHEN savewords_Window%
 1130WHEN display_Window%:dispwind%=0
 1140WHEN words_Window%:wordswind%=0:PROCMenuTick(main_Menu%,2):PROCMenuTick(solve_Menu%,2):PROCMenuTick(display_Menu%,2)
 1150WHEN main_Window%:mainwind%=0
 1160WHEN savewsq_Window%
 1170WHEN prefs_Window%
 1180ENDCASE
 1190ENDPROC
 1200:
 1210DEFPROCEvent_Draw(window%,x_origin%,y_origin%)
 1220CASE window% OF
 1230WHEN savewsq_Window%:PROCDrawsavewsqWindow
 1240WHEN solve_Window%:PROCDrawsolveWindow
 1250WHEN info_Window%:PROCDrawinfoWindow
 1260WHEN savewords_Window%:PROCDrawsavewordsWindow
 1270WHEN prefs_Window%:PROCDrawprefsWindow
 1280WHEN display_Window%:PROCDrawdisplayWindow
 1290WHEN words_Window%:PROCDrawwordsWindow
 1300WHEN main_Window%:PROCDrawmainWindow
 1310ENDCASE
 1320ENDPROC
 1330:
 1340DEFPROCDrawsavewsqWindow
 1350ENDPROC
 1360:
 1370DEFPROCDrawsolveWindow
 1380ENDPROC
 1390:
 1400DEFPROCDrawinfoWindow
 1410ENDPROC
 1420:
 1430DEFPROCDrawsavewordsWindow
 1440ENDPROC
 1450:
 1460DEFPROCDrawprefsWindow
 1470ENDPROC
 1480:
 1490DEFPROCDrawwordsWindow
 1500ENDPROC
 1510:
 1520DEFPROCDrawmainWindow
 1530ENDPROC
 1540:
 1550DEFPROCDrawdisplayWindow
 1560IFstartx%<>0 AND starty%<>0 SYS"Wimp_SetColour",mcol%:RECTANGLE FILL x_origin%+startx%,y_origin%+starty%,22,32
 1570FORI%=1TOwords%
 1580IFshow%(I%)=0 OR (start%(I%)=0 AND dir%(I%)=0) GOTO1610
 1590IFI%=show% SYS"Wimp_SetColour",lcol% ELSE SYS"Wimp_SetColour",col%
 1600LINE x_origin%+sx%(I%),y_origin%-sy%(I%),x_origin%+ex%(I%),y_origin%-ey%(I%)
 1610NEXT
 1620dispx%=x_origin%-18
 1630ENDPROC
 1640:
 1650DEFPROCEvent_MouseClick(window%,icon%,button%,x%,y%)
 1660CASE window% OF
 1670WHEN Bar_Window%:PROCMouseBar
 1680WHEN solve_Window%:PROCMousesolve(button%,icon%)
 1690WHEN info_Window%:PROCMouseinfo(button%,icon%)
 1700WHEN display_Window%:PROCMousedisplay(button%,icon%)
 1710WHEN prefs_Window%:PROCMouseprefs(button%,icon%)
 1720WHEN words_Window%:PROCMousewords(button%,icon%)
 1730WHEN main_Window%:PROCMousemain(button%,icon%)
 1740ENDCASE
 1750ENDPROC
 1760:
 1770DEFPROCMouseBar
 1780PROCBringToTop(main_Window%):mainwind%=1
 1790ENDPROC
 1800:
 1810DEFPROCMouseprefs(button%,icon%)
 1820CASE icon% OF
 1830WHEN 1:PROCsaveprefs:PROCWindowClose(prefs_Window%)
 1840WHEN 11:PROCgetprefs:PROCWindowClose(prefs_Window%)
 1850WHEN 12:PROCWindowClose(prefs_Window%)
 1860IFtempdbl%<>dbl% PROCSetIcon(prefs_Window%,3):tempdbl%=dbl%
 1870IFtempcaps%<>caps% PROCSetIcon(prefs_Window%,29):PROCSetIcon(prefs_Window%,30):tempcaps%=caps%
 1880IFtempforce%<>force% PROCSetIcon(prefs_Window%,45):PROCSetIcon(prefs_Window%,46):tempforce%=force%
 1890IFtemptitlept%<>titlept% temptitlept%=titlept%
 1900IFtempgridpt%<>gridpt% tempgridpt%=gridpt%
 1910IFtempwordspt%<>wordspt% tempwordspt%=wordspt%
 1920IFtempcol%<>col% tempcol%=col%
 1930IFtempmcol%<>mcol% tempmcol%=mcol%
 1940IFtempwcol%<>wcol% tempwcol%=wcol%
 1950IFtemplcol%<>lcol% templcol%=lcol%
 1960PROCsetprefs
 1970WHEN 3:IF tempdbl%=-1 tempdbl%=0 ELSE tempdbl%=-1
 1980WHEN 29:IFbutton%=1 AND tempcaps%=-1 PROCSetIcon(prefs_Window%,29)
 1990tempcaps%=-1
 2000WHEN 30:IFbutton%=1 AND tempcaps%=0 PROCSetIcon(prefs_Window%,30)
 2010tempcaps%=0
 2020WHEN 31,33:temptitlept%=FNbumppt(icon%-32,temptitlept%,32)
 2030WHEN 34,36:tempgridpt%=FNbumppt(icon%-35,tempgridpt%,35)
 2040WHEN 37,39:tempwordspt%=FNbumppt(icon%-38,tempwordspt%,38)
 2050WHEN 45:IF button%=1 AND tempforce%=-1 PROCSetIcon(prefs_Window%,45)
 2060tempforce%=-1
 2070WHEN 46:IF button%=1 AND tempforce%=0 PROCSetIcon(prefs_Window%,45)
 2080tempforce%=0
 2090OTHERWISE:PROCAlert("WordSq","Invalid Templates file.")
 2100ENDCASE
 2110ENDPROC
 2120:
 2130DEFPROCMousesolve(button%,icon%)
 2140IFbutton%<>1 AND button%<>4 ENDPROC
 2150IFsolveformat$="" PROCAlert("WordSq","No wordsquare is currently available - either create one or load a plain text wordsquare."):ENDPROC
 2160IFicon%=9 AND (selection%=0 AND FNIconText(solve_Window%,17)="") ENDPROC
 2170CASE icon% OF
 2180WHEN 8:PROCBringToTop(display_Window%):dispwind%=1:PROCremovepressed
 2190WHEN 9:PROCBringToTop(display_Window%):dispwind%=1:PROCshowpressed
 2200WHEN 11:PROCBringToTop(display_Window%):dispwind%=1:PROCshowall
 2210WHEN 10:PROCremoveall
 2220OTHERWISE:PROCAlert("WordSq","Invalid Templates file.")
 2230ENDCASE
 2240ENDPROC
 2250:
 2260DEFPROCMousedisplay(button%,icon%)
 2270IFbutton%<>4 AND button%<>1 ENDPROC
 2280IFicon%-1>wsqy ENDPROC
 2290!wimp%=display_Window%:SYS "Wimp_GetWindowState",,wimp%:dispx%=wimp%!4-wimp%!20-2
 2300IFbutton%=4 startpos%=0:startx%=0:starty%=0:endpos%=0 ELSE IFbutton%=1 AND startpos%=0 button%=4:startx%=0:starty%=0:endpos%=0
 2310icon%-=1:i%=((24+((x%-dispx%)/16))/2)-12
 2320IFi%>wsqx ENDPROC
 2330p%=((icon%-1)*wsqx)+i%
 2340CASE button% OF
 2350WHEN 4:startpos%=p%
 2360startx%=22+((i%-1)*32)-8:starty%=-84-((icon%-1)*44)
 2370WHEN 1:endpos%=p%
 2380d$=FNgetword(startpos%,endpos%):PROCIconPutText(solve_Window%,17,d$)
 2390IFstartpos%<>endpos% AND o%=1 AND d$<>"" THEN
 2400PROCcaret((LENd$/2)+1000)
 2410ex%=FNexists(d$):p%=FNpalindrome(d$)
 2420IFex%=0 PROCAlert("WordSq","The word '"+d$+"' does not exist in the current word list."):GOTO2460
 2430IFex%>0 AND startpos%<>0 AND endpos%<>0 AND startpos%<>start%(ex%) AND p%=0 PROCAlert("WordSq","Although the word "+d$+" does exist in the current wordsquare, it is not at this position."):GOTO2460
 2440IFex%>0 AND startpos%<>0 AND endpos%<>0 AND startpos%<>start%(ex%) AND p%=1 SWAP startpos%,endpos%
 2450IFex%>0:IFshow%(ex%)=0 high%+=1:show%(ex%)=2:PROCsic(words_Window%,ex%+3,wcol%):show%=ex%:found%+=1
 2460startx%=0:starty%=0:startpos%=0:endpos%=0
 2470ENDIF
 2480ENDCASE
 2490PROCWindowForceDraw(display_Window%)
 2500PROCupdatesolvestate
 2510IFsolveformat$<>"own" ENDPROC
 2520IFfound%=wsqwords% AND done%=0 ANDwsqwords%=1 PROCAlert("WordSq","Well Done, you've found the word."):done%=1:ENDPROC
 2530IFhigh%=wsqwords% AND found%<wsqwords% AND done%=0 AND wsqwords%=1 AND found%>0 PROCAlert("WordSq","Although you have found the word, you had to seek help with it."):done%=1:ENDPROC
 2540IFfound%=wsqwords% AND done%=0 PROCAlert("WordSq","Well Done, you've found all "+FNoneormore(wsqwords%)+"in the grid."):done%=1
 2550IFhigh%=wsqwords% AND found%<wsqwords% AND done%=0 AND found%>0 PROCAlert("WordSq","Although you have found all "+FNoneormore(wsqwords%)+"in the grid, you had to seek help with "+STR$(wsqwords%-found%)+" of them."):done%=1
 2560ENDPROC
 2570:
 2580DEFPROCshowpressed
 2590IFsolveformat$="" PROCIconPutText(solve_Window%,17,""):ENDPROC
 2600gibbet$=FNIconText(solve_Window%,17):need%=0:F%=0
 2610ex%=FNexists(gibbet$)
 2620IFcaps%=-1 PROCIconPutText(main_Window%,26,FNcaps(gibbet$)):PROCIconPutText(solve_Window%,17,FNcaps(gibbet$))
 2630IFFNlen(gibbet$)<3 AND selection%=0 GOTO2830
 2640IFselection%=0 AND solveformat$="text" AND ex%=0 PROCfind(FNcaps(gibbet$)):PROCIconPutText(main_Window%,20,STR$gaps):GOTO2820
 2650IFselection%=0 AND solveformat$="own" THEN
 2660IFex%=0 PROCAlert("WordSq","The word '"+gibbet$+"' does not exist in the current word list."):GOTO2690
 2670IFex%>0 AND startpos%<>0 AND endpos%<>0 AND startpos%<>start%(ex%) PROCAlert("WordSq","Although the word "+gibbet$+" does exist in the current wordsquare, it is not at this position."):GOTO2690
 2680IFex%>0 need%=1:IFshow%(ex%)=0 high%+=1:show%(ex%)=1:PROCsic(words_Window%,ex%+3,wcol%):show%=ex%
 2690ENDIF
 2700IFselection%=0 AND solveformat$="own" GOTO 2830
 2710IFselection%>0 THEN
 2720o%=0:FORI%=1TOwords%:IFselected%(I%)=1 AND start%(I%)=0 AND dir%(I%)=0 o%+=1 ELSE IFselected%(I%)=1 AND show%(I%)=0 high%+=1:show%(I%)=1:need%=1:PROCsic(words_Window%,I%+3,wcol%)
 2730NEXT
 2740IFselection%>1 show%=0
 2750IFo%>0 THEN
 2760IFo%=1 o$=" does " ELSE o$=" do "
 2770IFo%=1 AND selection%=1 d$="This word does ":ELSE d$=FNoneormore(o%)+"amongst the selection"+o$:o$="they"
 2780IFo%=1 o$="it"
 2790PROCAlert("WordSq",d$+"not appear in the current wordsquare so "+o$+" will not be shown.")
 2800ENDIF
 2810ENDIF
 2820o%=selection%
 2830PROCclearall:PROCIconPutText(main_Window%,26,""):PROCIconPutText(solve_Window%,17,""):PROCcaret(0)
 2840IFwords%=1:PROCMenuEnable(main_Menu%,2):PROCMenuEnable(main_Menu%,3):PROCMenuEnable(main_Menu%,5):PROCMenuEnable(solve_Menu%,2):PROCMenuEnable(words_Menu%,2):PROCMenuEnable(display_Menu%,2)
 2850IFwords%=0 done%=0
 2860startx%=0:starty%=0
 2870PROCWindowForceDraw(display_Window%)
 2880PROCupdatesolvestate:IFsolveformat$<>"own" ORo%>=wsqwords% ORdone%=1 ENDPROC
 2890IFhigh%=wsqwords% AND found%<wsqwords% ANDwsqwords%=1 PROCAlert("WordSq","Although you found the word, you had to seek help with it."):done%=1:ENDPROC
 2900IFhigh%=wsqwords% AND found%<wsqwords% AND found%>0 PROCAlert("WordSq","Although you have found all "+FNoneormore(wsqwords%)+"in the grid, you had to seek help with "+STR$(wsqwords%-found%)+" of them."):done%=1
 2910ENDPROC
 2920:
 2930DEFPROCremovepressed
 2940IFsolveformat$="" PROCIconPutText(solve_Window%,17,""):PROCcaret(0):ENDPROC
 2950IFselection%=0 ENDPROC
 2960need%=0:FORI%=1TOwords%
 2970IFshow%(I%)=2 AND selected%(I%)=1 found%-=1
 2980IFselected%(I%)=1 AND show%(I%)>0 high%-=1:show%(I%)=0:need%=1:PROCsic(words_Window%,I%+3,7):IFI%=show% show%=0
 2990NEXT
 3000done%=0
 3010PROCclearall:PROCIconPutText(main_Window%,26,""):PROCIconPutText(solve_Window%,17,""):PROCcaret(0)
 3020IFneed% PROCWindowForceDraw(display_Window%)
 3030PROCupdatesolvestate
 3040ENDPROC
 3050:
 3060DEFPROCMouseinfo(button%,icon%)
 3070ENDPROC
 3080:
 3090DEFPROCMousewords(button%,icon%)
 3100IFicon%>3 AND icon%<=words%+3 THEN
 3110CASE button% OF
 3120WHEN 4:
 3130FORI%=1TOwords%:IFselected%(I%)=1 PROCSetIcon(words_Window%,I%+3):selected%(I%)=0
 3140NEXT:PROCSetIcon(words_Window%,icon%):selected%(icon%-3)=1:selection%=1:selectedword$=word$(icon%-3):PROCsetbutton
 3150WHEN 1:
 3160PROCSetIcon(words_Window%,icon%)
 3170IFselected%(icon%-3)=0 selected%(icon%-3)=1:selection%+=1:ELSE selected%(icon%-3)=0:selection%-=1:PROCsetbutton
 3180IFselection%<>1 GOTO3200
 3190FORI%=1TOwords%:IFselected%(I%)=1 selectedword$=word$(I%):NEXT:ELSENEXT
 3200ENDCASE
 3210CASE selection% OF
 3220WHEN 0:PROCIconPutText(main_Window%,26,""):PROCIconPutText(solve_Window%,17,""):selectedword$=""
 3230WHEN 1:PROCIconPutText(main_Window%,26,selectedword$):PROCIconPutText(solve_Window%,17,selectedword$)
 3240OTHERWISE:PROCIconPutText(main_Window%,26,""):PROCIconPutText(solve_Window%,17,""):selectedword$=""
 3250ENDCASE
 3260ENDIF
 3270IF icon%=2 PROCselectall
 3280IF icon%=3 PROCclearall
 3290PROCupdatesolvestate
 3300PROCcaret(LENselectedword$/2)
 3310PROCsetbutton
 3320ENDPROC
 3330:
 3340DEFPROCMousemain(button%,icon%)
 3350IF button%<>1 AND button%<>4 ENDPROC
 3360IFicon%=24 AND FNIconText(main_Window%,26)="" ENDPROC
 3370CASE icon% OF
 3380WHEN 24:PROCaddword
 3390WHEN 25:PROCdeleteword
 3400WHEN 28:PROCamendword
 3410WHEN 29:PROCcreate
 3420WHEN 11,13:PROCbumpx(icon%-12)
 3430WHEN 15,17:PROCbumpy(-(icon%-16))
 3440WHEN 19,21:PROCbumpgaps(-(icon%-20))
 3450WHEN 30:IFbutton%=1 AND saveformat$="text" PROCSetIcon(main_Window%,30)
 3460saveformat$="text":d%=FNIconPutSprite(savewsq_Window%,0,"file_fff")
 3470WHEN 32:IFbutton%=1 AND saveformat$="draw" PROCSetIcon(main_Window%,32)
 3480saveformat$="draw":d%=FNIconPutSprite(savewsq_Window%,0,"file_fff")
 3490WHEN 33:IFbutton%=1 AND saveformat$="own" PROCSetIcon(main_Window%,33)
 3500saveformat$="own":d%=FNIconPutSprite(savewsq_Window%,0,"file_03c")
 3510WHEN 34:IFbutton%=1 AND saveformat$="imp" PROCSetIcon(main_Window%,34)
 3520saveformat$="imp":d%=FNIconPutSprite(savewsq_Window%,0,"file_fff")
 3530OTHERWISE:PROCAlert("WordSq","Invalid Templates file.")
 3540ENDCASE
 3550ENDPROC
 3560:
 3570DEFPROCselectall
 3580FORI%=4TOwords%+3:IFselected%(I%-3)=0 PROCSetIcon(words_Window%,I%):selected%(I%-3)=1
 3590NEXT:selection%=words%:PROCsetbutton
 3600ENDPROC
 3610:
 3620DEFPROCclearall
 3630FORI%=4TOwords%+3:IFselected%(I%-3)=1 PROCSetIcon(words_Window%,I%):selected%(I%-3)=0
 3640NEXT:selection%=0:PROCsetbutton
 3650ENDPROC
 3660:
 3670DEFPROCshowall
 3680FORI%=1TOwords%:IFstart%(I%)<>0 AND dir%(I%)<>0 show%(I%)=1:PROCsic(words_Window%,I%+3,wcol%)
 3690NEXT:PROCWindowForceDraw(display_Window%)
 3700high%=wsqwords%:done%=1:show%=0:PROCupdatesolvestate
 3710ENDPROC
 3720:
 3730DEFPROCremoveall
 3740FORI%=1TOwords%:show%(I%)=0:PROCsic(words_Window%,I%+3,7):IFI%=show% show%=0
 3750NEXT
 3760PROCWindowForceDraw(display_Window%)
 3770high%=0:found%=0:done%=0:PROCupdatesolvestate
 3780ENDPROC
 3790:
 3800DEFPROCEvent_KeyPress(window%,icon%,key%)
 3810CASE window% OF
 3820WHEN solve_Window%:PROCKeyPresssolve(icon%,key%)
 3830WHEN info_Window%
 3840WHEN display_Window%
 3850WHEN words_Window%
 3860WHEN main_Window%:PROCKeyPressmain(icon%,key%)
 3870WHEN prefs_Window%:PROCKeyPressprefs(icon%,key%)
 3880ENDCASE
 3890key%=0:wsqtitle$=FNIconText(main_Window%,9)
 3900ENDPROC
 3910:
 3920DEFPROCKeyPresssolve(icon%,key%)
 3930IFkey%<>13 SYS"Wimp_ProcessKey",key%
 3940IFkey%=13 AND icon%=17 AND (selection%<>0 OR FNIconText(solve_Window%,17)<>"") PROCshowpressed
 3950IFkey%=13 AND icon%=17 AND solveformat$="" PROCcaret(0)
 3960ENDPROC
 3970:
 3980DEFPROCKeyPressmain(icon%,key%)
 3990d%=icon%
 4000IFkey%=399 AND icon%=26 icon%=9 ELSE IF key%=398 AND icon%=9 icon%=26
 4010IFd%<>icon% PROCIconCaret(main_Window%,icon%,INT(LENFNIconText(main_Window%,icon%)/2)):ENDPROC
 4020IFkey%=13 AND icon%=26 AND FNIconText(main_Window%,26)<>"" AND solveformat$<>"text" PROCaddword:ENDPROC
 4030SYS"Wimp_ProcessKey",key%
 4040ENDPROC
 4050:
 4060DEFPROCKeyPressprefs(icon%,key%)
 4070d%=icon%
 4080CASE key% OF
 4090WHEN 399
 4100IFicon%=24 OR icon%=25 OR icon%=26 OR icon%=27 icon%-=1 ELSE IF icon%=23 icon%=17 ELSE IF icon%=41 icon%=27 ELSE IF icon%=43 icon%=41 ELSE IF icon%=9 icon%=7 ELSE IF icon%=13 icon%=9 ELSE IF icon%=17 icon%=13
 4110WHEN 398
 4120IFicon%=23 OR icon%=24 OR icon%=25 OR icon%=26 icon%+=1 ELSE IF icon%=41 icon%=43 ELSE IF icon%=27 icon%=41 ELSE IF icon%=17 icon%=23 ELSE IF icon%=7 icon%=9 ELSE IF icon%=9 icon%=13 ELSE IF icon%=13 icon%=17
 4130OTHERWISE SYS"Wimp_ProcessKey",key%
 4140ENDCASE
 4150IFicon%<>d% PROCIconCaret(prefs_Window%,icon%,INT(LENFNIconText(prefs_Window%,icon%)/2))
 4160ENDPROC
 4170:
 4180DEFPROCEvent_MenuChoice(menu%)
 4190CASE menu% OF
 4200WHEN Bar_Menu%:PROCMenuChoiceBar
 4210WHEN savewsq_Menu%
 4220WHEN solve_Menu%:PROCMenuChoicesolve
 4230WHEN info_Menu%
 4240WHEN savewords_Menu%
 4250WHEN prefs_Menu%:PROCMenuChoiceprefs
 4260WHEN display_Menu%:PROCMenuChoicedisplay
 4270WHEN words_Menu%:PROCMenuChoicewords
 4280WHEN main_Menu%:PROCMenuChoicemain
 4290ENDCASE
 4300ENDPROC
 4310:
 4320DEFPROCMenuChoiceBar
 4330CASE FNMenuChoice(0) OF
 4340WHEN 1
 4350WHEN 2:PROCBringToTop(main_Window%):mainwind%=1
 4360WHEN 3:IFsolveformat$<>"" PROCBringToTop(display_Window%):dispwind%=1
 4370PROCBringToTop(solve_Window%):solvewind%=1
 4380WHEN 4:PROCBringToTop(prefs_Window%)
 4390WHEN 5:
 4400IFFNnew("clear all variables")=1 PROCreset
 4410WHEN 6:finished%=TRUE
 4420ENDCASE
 4430ENDPROC
 4440:
 4450DEFPROCMenuChoiceprefs
 4460CASE FNMenuChoice(0) OF
 4470WHEN 1
 4480WHEN 2:CASE FNMenuChoice(1) OF
 4490WHEN 1:IFFNMenuChoice(2)<>0 tempwcol%=FNMenuChoice(2)-1
 4500WHEN 2:IFFNMenuChoice(2)<>0 tempmcol%=FNMenuChoice(2)-1
 4510WHEN 3:IFFNMenuChoice(2)<>0 tempcol%=FNMenuChoice(2)-1
 4520WHEN 4:IFFNMenuChoice(2)<>0 templcol%=FNMenuChoice(2)-1
 4530ENDCASE
 4540WHEN 3:finished%=TRUE
 4550ENDCASE
 4560PROCsib(prefs_Window%,50,tempcol%):PROCsib(prefs_Window%,51,tempmcol%)
 4570PROCsib(prefs_Window%,53,tempwcol%):PROCsib(prefs_Window%,54,templcol%)
 4580ENDPROC
 4590:
 4600DEFPROCMenuChoicesolve
 4610CASE FNMenuChoice(0) OF
 4620WHEN 1
 4630WHEN 2:PROCMenuTick(solve_Menu%,2):PROCMenuTick(main_Menu%,2):PROCMenuTick(display_Menu%,2):IFwordswind%=0 wordswind%=1 ELSE wordswind%=0
 4640WHEN 3:finished%=TRUE
 4650ENDCASE
 4660IF wordswind%=1 PROCBringToTop(words_Window%) ELSE PROCWindowClose(words_Window%)
 4670ENDPROC
 4680:
 4690DEFPROCMenuChoicedisplay
 4700CASE FNMenuChoice(0) OF
 4710WHEN 1
 4720WHEN 2:PROCMenuTick(solve_Menu%,2):PROCMenuTick(main_Menu%,2):PROCMenuTick(display_Menu%,2):IFwordswind%=0 wordswind%=1 ELSE wordswind%=0
 4730WHEN 3:finished%=TRUE
 4740ENDCASE
 4750IF wordswind%=1 PROCBringToTop(words_Window%) ELSE PROCWindowClose(words_Window%)
 4760ENDPROC
 4770:
 4780DEFPROCMenuChoicewords
 4790CASE FNMenuChoice(0) OF
 4800WHEN 1
 4810WHEN 2
 4820WHEN 3:finished%=TRUE
 4830ENDCASE
 4840ENDPROC
 4850:
 4860DEFPROCMenuChoicemain
 4870CASE FNMenuChoice(0) OF
 4880WHEN 1
 4890WHEN 2:PROCMenuTick(main_Menu%,2):PROCMenuTick(solve_Menu%,2):PROCMenuTick(display_Menu%,2):IFwordswind%=0 wordswind%=1:PROCBringToTop(words_Window%) ELSE wordswind%=0:PROCWindowClose(words_Window%)
 4900WHEN 3
 4910WHEN 4
 4920WHEN 5:old$=saveformat$:saveformat$="print":VDU2:PROCpre:PROCsavewords(""):PROCpost:VDU3:saveformat$=old$
 4930WHEN 6:old$=saveformat$:saveformat$="print":VDU2:PROCpre:PROCsavesquare:PROCpost:VDU3:saveformat$=old$
 4940WHEN 7:finished%=TRUE
 4950ENDCASE
 4960ENDPROC
 4970:
 4980DEFPROCEvent_LoadFile(file$,type%)
 4990SYS"Hourglass_On"
 5000CASE type% OF
 5010WHEN &FFF:IFFNnew("load a new file")=1 PROCreset:PROCLoadWords(file$)
 5020WHEN filetype%:IFFNnew("load a new set of words and grid")=1 PROCreset:PROCLoadOwn(file$)
 5030ENDCASE
 5040SYS"Hourglass_Off"
 5050ENDPROC
 5060:
 5070DEFPROCLoadWords(file$)
 5080file=OPENINfile$
 5090dummy$=FNcaps(GET$#file)
 5100IFINSTR(dummy$,"ORD") AND INSTR(dummy$,"UARE"):dimx=LENGET$#file:words%=0:solveformat$="text":PROCloadsquare:ENDPROC
 5110CLOSE#file:file=OPENINfile$
 5120words%=1:REPEAT
 5130dummy$=GET$#file
 5140IFFNlen(dummy$)>2 THEN
 5150word$(words%)=LEFT$(dummy$,18):len%(words%)=FNlen(word$(words%))
 5160IFcaps% word$(words%)=FNcaps(word$(words%))
 5170words%+=1
 5180ENDIF
 5190UNTILEOF#file ORwords%=169
 5200words%-=1:needs%=SUMlen%()
 5210CLOSE#file
 5220IFwords%=0 ENDPROC
 5230PROCsort(1)
 5240PROCMenuDisable(main_Menu%,4):PROCMenuDisable(main_Menu%,6)
 5250PROCrec(2)
 5260PROCafterload
 5270PROCWindowClose(display_Window%)
 5280IFINSTR(file$,"Wimp$Scrap")=0 PROCIconPutText(savewords_Window%,1,file$)
 5290ENDPROC
 5300:
 5310DEFPROCafterload
 5320PROCMenuEnable(main_Menu%,2):PROCMenuEnable(main_Menu%,3):PROCMenuEnable(main_Menu%,5):PROCMenuEnable(solve_Menu%,2):PROCMenuEnable(display_Menu%,2)
 5330FORI%=1TO168:PROCIconPutText(words_Window%,I%+3,word$(I%)):NEXT
 5340wordstatus$=STR$(words%)+" words loaded.":PROCIconPutText(main_Window%,5,wordstatus$)
 5350PROCIconPutText(main_Window%,9,FNGetFileFromPathname(temp$))
 5360high%=0:PROCupdatesolvestate
 5370FORI%=1TO168:IFwords%<I% PROCIconPutText(words_Window%,I%+3,""):NEXT
 5380PROCww
 5390PROCBringToTop(main_Window%):PROCBringToTop(words_Window%)
 5400IFwordswind%=0 PROCMenuTick(main_Menu%,2):PROCMenuTick(solve_Menu%,2):PROCMenuTick(display_Menu%,2)
 5410wordswind%=1:mainwind%=1:len%=FNlong
 5420PROCMenuEnable(words_Menu%,2)
 5430PROCIconPutText(main_Window%,12,STR$dimx):PROCIconPutText(main_Window%,16,STR$dimy):PROCIconPutText(main_Window%,20,STR$gaps)
 5440ENDPROC
 5450:
 5460DEFPROCLoadOwn(file$)
 5470file=OPENINfile$
 5480wsqtitle$=GET$#file:gaps=VALGET$#file:dimx=VALGET$#file:dimy=VALGET$#file
 5490words%=VALGET$#file
 5500FORI%=1TOwords%
 5510word$(I%)=GET$#file:len%(I%)=VALGET$#file
 5520start%(I%)=VALGET$#file:dir%(I%)=VALGET$#file
 5530show%(I%)=VALGET$#file
 5540sx%(I%)=VALGET$#file:sy%(I%)=VALGET$#file
 5550ex%(I%)=VALGET$#file:ey%(I%)=VALGET$#file
 5560NEXT
 5570FORI%=1TOdimx*dimy
 5580grid%(I%)=BGET#file
 5590NEXT
 5600CLOSE#file
 5610solveformat$="own"
 5620PROCafterload
 5630PROCIconPutText(main_Window%,9,wsqtitle$)
 5640PROCMenuEnable(main_Menu%,4):PROCMenuEnable(main_Menu%,6)
 5650PROCIconPutText(main_Window%,6,FNoneormore(words%)+"placed - "+STR$gaps+"% gaps. ")
 5660IFINSTR(file$,"Wimp$Scrap")=0 PROCIconPutText(savewsq_Window%,1,file$)
 5670PROCdisplay:PROCIconPutText(solve_Window%,5,"Using wordsquare from creator program.")
 5680wsqx=dimx:wsqy=dimy:wsqwords%=words%:needs%=SUMlen%()
 5690FORI%=1TOwords%:IFshow%(I%)>0 high%+=1:PROCsic(words_Window%,I%+3,wcol%)
 5700NEXT
 5710PROCupdatesolvestate
 5720ENDPROC
 5730:
 5740DEFPROCloadsquare
 5750CLOSE#file:file=OPENINfile$:d$=GET$#file
 5760dimy=0:d%=0:REPEAT:d$=GET$#file
 5770IFLENd$>0 dimy+=1:FORI%=1TOdimx:d%+=1:grid%(d%)=ASCMID$(d$,I%,1):NEXT
 5780UNTILEOF#file
 5790wsqx=dimx:wsqy=dimy
 5800CLOSE#file
 5810RESTORE:FORI%=1TO10:READd%:PROCIconDisable(main_Window%,d%):NEXT
 5820wordstatus$="No words found.":PROCIconPutText(main_Window%,5,wordstatus$)
 5830FORI%=4TO6STEP2:PROCMenuEnable(main_Menu%,I%):NEXT
 5840high%=0
 5850PROCBringToTop(solve_Window%):PROCBringToTop(display_Window%):PROCWindowClose(words_Window%):wordswind%=0:dispwind%=1
 5860solvewind%=1:PROCIconPutText(main_Window%,12,STR$dimx):PROCIconPutText(main_Window%,16,STR$dimy):PROCIconPutText(main_Window%,20,"100")
 5870PROCdisplay:PROCIconPutText(solve_Window%,5,"Using textfile wordsquare '"+FNGetFileFromPathname(temp$)+"'.")
 5880PROCIconPutText(main_Window%,6,"Using textfile wordsquare '"+FNGetFileFromPathname(temp$)+"'.")
 5890PROCIconPutText(solve_Window%,6,"No words found.")
 5900IFINSTR(file$,"Wimp$Scrap")=0 PROCIconPutText(savewsq_Window%,1,file$)
 5910ENDPROC
 5920:
 5930DEFPROCloadprefs
 5940file=OPENIN"<WordSq$Dir>.Prefs"
 5950dbl%=VALGET$#file:force%=VALGET$#file:caps%=VALGET$#file
 5960REM dbl%=0 for spacing off, -1 for spacing on
 5970REM caps%=0 for preserve case, -1 for capitalise
 5980REM force%=0 for force single column, -1 for automatic selection
 5990col%=VALGET$#file:mcol%=VALGET$#file
 6000wcol%=VALGET$#file:lcol%=VALGET$#file
 6010titlefont$=GET$#file:titlept%=VALGET$#file
 6020gridfont$=GET$#file:gridpt%=VALGET$#file
 6030wordsfont$=GET$#file:wordspt%=VALGET$#file
 6040pre$=GET$#file:post$=GET$#file
 6050overon$=GET$#file:overoff$=GET$#file
 6060underon$=GET$#file:underoff$=GET$#file
 6070emphon$=GET$#file:emphoff$=GET$#file
 6080CLOSE#file
 6090tempdbl%=dbl%:tempcaps%=caps%:tempforce%=force%
 6100tempcol%=col%:tempwcol%=wcol%:templcol%=lcol%:tempmcol%=mcol%
 6110temptitlept%=titlept%:tempgridpt%=gridpt%:tempwordspt%=wordspt%
 6120PROCsetprefs
 6130IFdbl%=0 PROCSetIcon(prefs_Window%,3)
 6140IFcaps%=-1 PROCSetIcon(prefs_Window%,29):PROCSetIcon(prefs_Window%,30)
 6150IFforce%=0 PROCSetIcon(prefs_Window%,45):PROCSetIcon(prefs_Window%,46)
 6160PROCsib(prefs_Window%,50,col%):PROCsib(prefs_Window%,51,mcol%)
 6170PROCsib(prefs_Window%,53,wcol%):PROCsib(prefs_Window%,54,lcol%)
 6180ENDPROC
 6190:
 6200:
 6210DEFPROCsetprefs
 6220PROCIconPutText(prefs_Window%,7,titlefont$):PROCIconPutText(prefs_Window%,32,STR$titlept%+" pt")
 6230PROCIconPutText(prefs_Window%,9,gridfont$):PROCIconPutText(prefs_Window%,35,STR$gridpt%+" pt")
 6240PROCIconPutText(prefs_Window%,13,wordsfont$):PROCIconPutText(prefs_Window%,38,STR$wordspt%+" pt")
 6250PROCIconPutText(prefs_Window%,17,pre$):PROCIconPutText(prefs_Window%,23,post$):PROCIconPutText(prefs_Window%,24,overon$):PROCIconPutText(prefs_Window%,25,overoff$)
 6260PROCIconPutText(prefs_Window%,26,underon$):PROCIconPutText(prefs_Window%,27,underoff$):PROCIconPutText(prefs_Window%,41,emphon$):PROCIconPutText(prefs_Window%,43,emphoff$)
 6270PROCsib(prefs_Window%,50,col%):PROCsib(prefs_Window%,51,mcol%)
 6280PROCsib(prefs_Window%,53,wcol%):PROCsib(prefs_Window%,54,lcol%)
 6290FORI%=1TO168:IFshow%(I%)>0 PROCsic(words_Window%,I%+3,wcol%)
 6300NEXT
 6310PROCWindowForceDraw(display_Window%)
 6320ENDPROC
 6330:
 6340DEFPROCgetprefs
 6350dbl%=tempdbl%:caps%=tempcaps%:force%=tempforce%
 6360col%=tempcol%:mcol%=tempmcol%:wcol%=tempwcol%:lcol%=templcol%
 6370titlefont$=FNIconText(prefs_Window%,7):titlept%=VALFNIconText(prefs_Window%,32)
 6380gridfont$=FNIconText(prefs_Window%,9):gridpt%=VALFNIconText(prefs_Window%,35)
 6390wordsfont$=FNIconText(prefs_Window%,13):wordspt%=VALFNIconText(prefs_Window%,38)
 6400pre$=FNIconText(prefs_Window%,17):post$=FNIconText(prefs_Window%,23)
 6410overon$=FNIconText(prefs_Window%,24):overoff$=FNIconText(prefs_Window%,25)
 6420underon$=FNIconText(prefs_Window%,26):underoff$=FNIconText(prefs_Window%,27)
 6430emphon$=FNIconText(prefs_Window%,41):emphoff$=FNIconText(prefs_Window%,43)
 6440FORI%=1TO168:IFshow%(I%)>0 PROCsic(words_Window%,I%+3,wcol%)
 6450NEXT
 6460PROCWindowForceDraw(display_Window%)
 6470ENDPROC
 6480:
 6490DEFPROCEvent_SaveFile(file$,window%)
 6500CASE window% OF
 6510WHEN savewsq_Window%:PROCsavesquare
 6520WHEN solve_Window%
 6530WHEN info_Window%
 6540WHEN prefs_Window%
 6550WHEN savewords_Window%:PROCsavewords(file$)
 6560WHEN display_Window%
 6570WHEN words_Window%
 6580WHEN main_Window%
 6590ENDCASE
 6600PROCMenuClose
 6610ENDPROC
 6620:
 6630DEFPROCsavewords(file$)
 6640IFsaveformat$<>"print" file=OPENOUTfile$
 6650FORI%=1TOwords%:PROCput(word$(I%),0):NEXT
 6660IFsaveformat$<>"print" CLOSE#file:OSCLI"SETTYPE "+file$+" Text":wordssaved%=1
 6670ENDPROC
 6680:
 6690DEFPROCsaveown(file$)
 6700SWAP dimx,wsqx:SWAP dimy,wsqy:SWAP words%,wsqwords%
 6710file=OPENOUTfile$
 6720BPUT#file,wsqtitle$:BPUT#file,STR$gaps:BPUT#file,STR$dimx:BPUT#file,STR$dimy
 6730BPUT#file,STR$words%
 6740FORI%=1TOwords%
 6750BPUT#file,word$(I%):BPUT#file,STR$len%(I%)
 6760BPUT#file,STR$start%(I%):BPUT#file,STR$dir%(I%)
 6770BPUT#file,STR$show%(I%)
 6780BPUT#file,STR$sx%(I%):BPUT#file,STR$sy%(I%)
 6790BPUT#file,STR$ex%(I%):BPUT#file,STR$ey%(I%)
 6800NEXT
 6810FORI%=1TOdimx*dimy
 6820BPUT#file,grid%(I%)
 6830NEXT
 6840CLOSE#file
 6850OSCLI"SETTYPE "+file$+" 03C"
 6860SWAP dimx,wsqx:SWAP dimy,wsqy:SWAP words%,wsqwords%
 6870gridsaved%=1:wordssaved%=1
 6880ENDPROC
 6890:
 6900DEFPROCsavesquare
 6910IFsaveformat$="own" PROCsaveown(file$):ENDPROC
 6920PROCcopyover
 6930SWAP dimx,wsqx:SWAP dimy,wsqy:SWAP words%,wsqwords%
 6940IFsaveformat$="draw" pad$=CHR$160 ELSE pad$=" "
 6950len%=FNlong:b$()="":dummy%=0:IFdbl%=-1 d%=dimx*2 ELSE d%=dimx
 6960FORI%=1TOdimy:FORJ%=1TOdimx:dummy%+=1
 6970b$(I%)+=CHR$(grid%(dummy%)):IFdbl%=-1 AND J%<>dimx b$(I%)+=pad$
 6980NEXT:NEXT
 6990dimx+=-(dbl%*dimx):IFdbl%=-1 dimx-=1
 7000IFforce%=0 AND words%<=60 c%=1:GOTO7050
 7010IF(words%>(4*dimy) OR words%>120) c%=4:GOTO7050
 7020IFsaveformat$="draw" AND dimx<(len%*2) c%=1:GOTO7050
 7030IFwords%>(1.3*dimy) OR words%>60 c%=2:GOTO7050
 7040c%=1
 7050IFsaveformat$="imp" PROCtabs
 7060IFsaveformat$<>"print" file=OPENOUTfile$:PROCheader
 7070IFsaveformat$<>"print" BPUT#file,wsqtitle$:ELSE PROCprinttitle
 7080CASE c% OF
 7090WHEN 1:PROCformat1
 7100WHEN 2:PROCformat2
 7110WHEN 4:PROCformat3
 7120ENDCASE
 7130IFdbl%=-1 AND dimx/2=INT(dimx/2) dimx=dimx/2:ELSE IFdbl%=-1 AND dimx/2<>INT(dimx/2) dimx=INT(dimx/2)+1
 7140SWAP dimx,wsqx:SWAP dimy,wsqy:SWAP words%,wsqwords%
 7150PROCcopyback
 7160IFsaveformat$<>"print" BPUT#file,CHR$10:CLOSE#file:OSCLI"SETTYPE "+file$+" Text" ELSE PRINT
 7170gridsaved%=1:wordssaved%=1
 7180ENDPROC
 7190:
 7200DEFPROCsaveprefs
 7210PROCgetprefs
 7220file=OPENOUT"<WordSq$Dir>.Prefs"
 7230BPUT#file,STR$dbl%:BPUT#file,STR$force%:BPUT#file,STR$caps%
 7240BPUT#file,STR$col%:BPUT#file,STR$mcol%
 7250BPUT#file,STR$wcol%:BPUT#file,STR$lcol%
 7260BPUT#file,titlefont$:BPUT#file,STR$titlept%
 7270BPUT#file,gridfont$:BPUT#file,STR$gridpt%
 7280BPUT#file,wordsfont$:BPUT#file,STR$wordspt%
 7290BPUT#file,pre$:BPUT#file,post$
 7300BPUT#file,overon$:BPUT#file,overoff$
 7310BPUT#file,underon$:BPUT#file,underoff$
 7320BPUT#file,emphon$:BPUT#file,emphoff$
 7330CLOSE#file
 7340ENDPROC
 7350:
 7360DEFPROCSetIcon(w%,i%)
 7370wimp%!0=w%:wimp%!4=i%:wimp%!8=&200000:wimp%!12=0
 7380SYS "Wimp_SetIconState",,wimp%
 7390ENDPROC
 7400:
 7410DEFPROCrec(type%)
 7420IFwords%<1 dimx=0:dimy=0:ENDPROC
 7430IFtype%=2 gaps=25
 7440needs%=SUMlen%()
 7450a=(1/(1-(gaps/100)))*needs%:dimy=FNround(SQR(a/1.2)):dimx=FNround(a/dimy)
 7460IF words%<=120 maxh=60 ELSE maxh=INT(59-((words%-120)/2))
 7470len%=FNlong
 7480IFlen%>FNmax PROCdrec:ENDPROC
 7490IFdimy<3 dimy=3 ELSE IF dimx>40 dimx=40:dimy=FNround(a/40)
 7500IFmaxh<dimy dimy=maxh
 7510IFFNgaps<10 OR (dimx<len% AND dimy<len%) PROCAlert("WordSq","All of these words will not fit into the largest size grid - you must delete a few, or shorten some of the longer ones.")
 7520IFtype%=2 gaps=FNgaps
 7530IFgaps<0 gaps=0
 7540PROCIconPutText(main_Window%,20,STR$gaps)
 7550ENDPROC
 7560:
 7570DEFPROCdrec
 7580I%=0:REPEAT:I%+=1:UNTILI%*len%>a*0.95:dimx=len%:dimy=I%:IFdimy<3 dimy=3
 7590IFtype%=2 gaps=FNgaps:PROCIconPutText(main_Window%,20,STR$gaps)
 7600ENDPROC
 7610:
 7620DEFFNlen(dummy$)
 7630J%=LENdummy$:FORI%=1TOLENdummy$:C=ASC(MID$(dummy$,I%,1)):IF C<65 OR C>122 OR (C>90 AND C<97) J%-=1
 7640NEXT:=J%
 7650:
 7660DEFFNlong
 7670D=0:FORI%=1TOwords%:IFLENword$(I%)>D D=LENword$(I%)
 7680NEXT:=D
 7690:
 7700DEFFNmax
 7710IFdimx>dimy =dimx ELSE =dimy
 7720:
 7730DEFFNround(num)=INT(num+0.5)
 7740:
 7750DEFPROCaddword
 7760w$=FNIconText(main_Window%,26):IFFNlen(w$)<3 PROCAlert("WordSq","Words must be three alphabetical characters long or more."):ENDPROC
 7770SYS"Hourglass_On"
 7780IFwords%=0 PROCMenuEnable(main_Menu%,2):PROCMenuEnable(main_Menu%,3):PROCMenuEnable(main_Menu%,5):PROCMenuEnable(solve_Menu%,2):PROCMenuEnable(display_Menu%,2)
 7790words%+=1:word$(words%)=w$
 7800PROCclearall
 7810PROCupdatesolvestate:IFcaps% word$(words%)=FNcaps(word$(words%))
 7820len%(words%)=FNlen(word$(words%))
 7830PROCsort(1)
 7840FORI%=1TOwords%:PROCIconPutText(words_Window%,I%+3,word$(I%)):NEXT
 7850PROCww
 7860PROCrec(2):PROCIconPutText(main_Window%,12,STR$dimx):PROCIconPutText(main_Window%,16,STR$dimy)
 7870IFwords%=1 PROCMenuEnable(words_Menu%,2):IFwordswind%=0 wordswind%=1:PROCBringToTop(words_Window%):PROCMenuTick(solve_Menu%,2):PROCMenuTick(main_Menu%,2):PROCMenuTick(display_Menu%,2)
 7880PROCIconPutText(main_Window%,26,""):PROCIconPutText(solve_Window%,17,""):PROCcaret(0)
 7890wordssaved%=0
 7900SYS"Hourglass_Off"
 7910ENDPROC
 7920:
 7930DEFPROCdeleteword
 7940IFselection%=0 ENDPROC
 7950IFsolveformat$<>"own" GOTO8020
 7960o%=-1:number%=0:FORI%=1TOwords%:IFselected%(I%)=1 AND start%(I%)<>0 AND dir%(I%)<>0 number%+=1:NEXT:ELSE NEXT
 7970IFnumber%>0 THEN
 7980IFselection%=1 d$="This word forms " ELSE d$=FNoneormore(number%)+"amongst the selection form "
 7990o%=FNWindowCancel("WordSq",d$+"part of the current wordsquare. Continuing with this operation will cause the wordsquare to be deleted. Click OK to delete.")
 8000ENDIF
 8010IFo%=0 ENDPROC ELSE IFo%=-1 AND number%>0 PROCWindowClose(display_Window%):PROCng
 8020SYS"Hourglass_On"
 8030number%=0:FORI%=1TOwords%:IFselected%(I%)=1 word$(I%)="~~":number%+=1:PROCSetIcon(words_Window%,I%+3):selected%(I%)=0:IFshow%(I%)>0 show%(I%)=0:high%-=1
 8040NEXT:selection%=0:PROCsetbutton
 8050PROCsort(1):PROCrep(0)
 8060FORI%=1TOwords%:PROCIconPutText(words_Window%,I%+3,word$(I%)):NEXT
 8070words%-=number%:IFsolveformat$="text" wsqwords%-=number%
 8080PROCupdatesolvestate:needs%=SUMlen%()
 8090IFwords%=0 THEN
 8100PROCMenuDisable(main_Menu%,3):PROCMenuDisable(main_Menu%,2):PROCMenuDisable(solve_Menu%,2):PROCMenuDisable(main_Menu%,5):PROCMenuDisable(display_Menu%,2):PROCWindowClose(words_Window%)
 8110PROCMenuTick(main_Menu%,2):PROCMenuTick(solve_Menu%,2):PROCMenuTick(display_Menu%,2)
 8120wordswind%=0:wordssaved%=1
 8130ENDIF
 8140IFwords%>0 wordssaved%=0
 8150PROCIconPutText(main_Window%,26,""):PROCIconPutText(solve_Window%,17,""):PROCcaret(0)
 8160PROCww:IFdispwind%=1 PROCWindowForceDraw(display_Window%)
 8170IFsolveformat$="text" gaps=FNgaps:PROCIconPutText(main_Window%,20,STR$gaps):SYS"Hourglass_Off":ENDPROC
 8180gaps=25:PROCIconPutText(main_Window%,20,STR$gaps)
 8190PROCrec(2):PROCIconPutText(main_Window%,12,STR$dimx):PROCIconPutText(main_Window%,16,STR$dimy)
 8200SYS"Hourglass_Off"
 8210ENDPROC
 8220:
 8230DEFPROCamendword
 8240IFselection%<>1 ENDPROC
 8250w$=FNIconText(main_Window%,26):IFFNlen(w$)<3 PROCAlert("WordSq","Words must be three alphabetical characters long or more."):ENDPROC
 8260IFsolveformat$="" GOTO8330
 8270o%=-1:number%=0:FORI%=1TOwords%:IFselected%(I%)=1 AND start%(I%)<>0 AND dir%(I%)<>0 number%+=1:NEXT:ELSE NEXT
 8280IFnumber%>0 THEN
 8290IFselection%=1 d$="This word forms " ELSE d$=FNoneormore(number%)+"amongst the selection form "
 8300o%=FNWindowCancel("WordSq",d$+"part of the current wordsquare. Continuing with this operation will cause the wordsquare to be deleted. Click OK to amend.")
 8310ENDIF
 8320IFo%=0 ENDPROC ELSE IFo%=-1 AND number%>0 PROCWindowClose(display_Window%):PROCng
 8330SYS"Hourglass_On"
 8340FORI%=1TOwords%:IFselected%(I%)=1 dummy%=I%
 8350NEXT:word$(dummy%)=FNIconText(main_Window%,26):len%(dummy%)=FNlen(word$(dummy%))
 8360PROCIconPutText(main_Window%,26,""):PROCIconPutText(solve_Window%,17,""):PROCcaret(0)
 8370PROCSetIcon(words_Window%,dummy%+3)
 8380PROCsort(1):FORI%=1TOwords%:PROCIconPutText(words_Window%,I%+3,word$(I%)):NEXT
 8390PROCww
 8400selected%(dummy%)=0:selection%=0:PROCsetbutton
 8410PROCupdatesolvestate
 8420PROCrec(2):PROCIconPutText(main_Window%,12,STR$dimx):PROCIconPutText(main_Window%,16,STR$dimy)
 8430wordssaved%=0
 8440SYS"Hourglass_Off"
 8450ENDPROC
 8460:
 8470DEFPROCsort(type%)
 8480IFtype%=2 type%=1:r%=1 ELSE r%=0
 8490P%=words%DIV2:IFP%=0ENDPROC
 8500REPEAT:R%=words%-P%:Q%=1
 8510REPEAT:W%=Q%
 8520REPEAT:U%=W%+P%
 8530IFtype%=1ANDword$(W%)<=word$(U%)ef%=1:GOTO8580
 8540IFtype%=0ANDlen%(W%)>=len%(U%)ef%=1:GOTO8580
 8550SWAPword$(W%),word$(U%)
 8560IFr%=0 SWAPlen%(W%),len%(U%):SWAPstart%(W%),start%(U%):SWAPdir%(W%),dir%(U%):SWAPshow%(W%),show%(U%):SWAPsx%(W%),sx%(U%):SWAPsy%(W%),sy%(U%):SWAPex%(W%),ex%(U%):SWAPey%(W%),ey%(U%)
 8570W%-=P%
 8580UNTILW%<1ORef%=1:ef%=0:Q%+=1
 8590UNTILQ%>R%:P%=P%DIV2
 8600UNTILP%=0
 8610ENDPROC
 8620:
 8630DEFPROCrep(type%)
 8640FORI%=1TOwords%:IFword$(I%)="~~" THEN
 8650word$(I%)=""
 8660IFtype%=0 len%(I%)=0:start%(I%)=0:dir%(I%)=0:selected%(I%)=0:show%(I%)=0:sx%(I%)=0:sy%(I%)=0:ex%(I%)=0:ey%(I%)=0
 8670ENDIF
 8680NEXT
 8690ENDPROC
 8700:
 8710DEFPROCbumpx(inc%)
 8720IFwords%=0 ENDPROC
 8730IFbutton%=1 inc%=-inc%
 8740IF (dimx*dimy)<(needs%*1.12) AND inc%=-1 ENDPROC
 8750IF (dimx=40 AND inc%>0) OR (dimx=0 AND inc%<0) ENDPROC
 8760dimx+=inc%:IF FNgaps<10:dimx-=inc%:ENDPROC
 8770PROCIconPutText(main_Window%,12,STR$dimx)
 8780gaps=FNgaps:PROCIconPutText(main_Window%,20,STR$gaps)
 8790ENDPROC
 8800:
 8810DEFPROCbumpy(inc%)
 8820IFwords%=0 ENDPROC
 8830IFbutton%=1 inc%=-inc%
 8840IF (dimx*dimy)<(needs%*(1+(gaps/100))) AND inc%=-1 ENDPROC
 8850IF (dimy=maxh AND inc%>0) OR (dimy=0 AND inc%<0) ENDPROC
 8860dimy+=inc%:IF FNgaps<10:dimy-=inc%:ENDPROC
 8870PROCIconPutText(main_Window%,16,STR$dimy)
 8880gaps=FNgaps:PROCIconPutText(main_Window%,20,STR$gaps)
 8890ENDPROC
 8900:
 8910DEFPROCbumpgaps(inc%)
 8920IFgaps<10 PROCrec(0):ENDPROC
 8930IFbutton%=1 inc%=-inc%
 8940IF (gaps=10 AND inc%=-1) ENDPROC
 8950IF (gaps=maxh AND inc%=1) ENDPROC
 8960gaps+=inc%
 8970PROCIconPutText(main_Window%,20,STR$gaps)
 8980PROCrec(0):PROCIconPutText(main_Window%,12,STR$dimx):PROCIconPutText(main_Window%,16,STR$dimy)
 8990ENDPROC
 9000:
 9010DEFFNbumppt(inc%,dummy%,d%)
 9020IF (dummy%=6 AND inc%=-1) OR (dummy%=24 AND inc%=1):=dummy%
 9030IFbutton%=1 inc%=-inc%
 9040dummy%+=inc%:PROCIconPutText(prefs_Window%,d%,STR$dummy%+" pt")
 9050=dummy%
 9060:
 9070DEFFNgaps
 9080IFdimx*dimy=0 =gaps
 9090=FNround((((dimx*dimy)-needs%)/(dimx*dimy))*100)
 9100:
 9110DEFFNoneormore(dummy%)
 9120IF dummy%=1 ="1 word "
 9130IF dummy%=0 ="No words "
 9140=STR$dummy%+" words "
 9150:
 9160DEFFNnone(dummy%)
 9170IFdummy%=0 ="None " ELSE =STR$dummy%+" "
 9180:
 9190DEFPROCcreate
 9200IF words%<1 PROCAlert("WordSq","There are no words to be placed in a wordsquare!"):ENDPROC
 9210d%=0:IFwords%<121 GOTO9250 ELSE:IF(dbl%=0 AND dimx<((len%*2)+1)) OR (dbl%=-1 AND dimx<(len%+1)) THEN
 9220IF dbl%=0 d%=(len%*2)+1 ELSE d%=len%+1
 9230PROCAlert("WordSq","The number of words means that the grid must be at least "+STR$d%+" characters across.  Please reset this value and try again.")
 9240ENDIF
 9250IFd%>0 ENDPROC
 9260wsqtitle$=FNIconText(main_Window%,9)
 9270IF(dimx*dimy)<(1.1*needs%) OR (dimx<len% AND dimy<len%) PROCAlert("WordSq","All of these words will not fit into the largest size grid - you must delete a few, or shorten some of the longer ones."):ENDPROC
 9280SYS"Hourglass_On"
 9290wsqx=dimx:wsqy=dimy
 9300not%=0:pla%=0:F%=0:startx%=0:starty%=0
 9310grid%()=0:start%()=0:dir%()=0:PROCsort(0)
 9320Z%=0:FORI%=1TOwords%:w$=FNstrip(word$(I%))
 9330A%=0:tr%=0:F%=0
 9340REPEAT:tr%+=1
 9350IFINKEY-113 PROCAlert("WordSq","Creation interrupted."):Z%=1
 9360A%=RND(dimx*dimy)
 9370IF grid%(A%)<>0 AND grid%(A%)<>ASC(LEFT$(w$,1)) GOTO9360
 9380PROCends:PROCfit
 9390UNTILF%=1 OR Z%=1 OR tr%>=(dimx*dimy)+dimx+dimy
 9400IFZ%=1 I%=words%+1:NEXT:PROCng:Z%=0:ENDPROC
 9410IFtr%>=(dimx*dimy)+dimx+dimy not%+=1:start%(I%)=0:dir%(I%)=99:ELSE pla%+=1
 9420PROCIconPutText(main_Window%,6,"Creating - "+FNoneormore(pla%)+"placed so far.")
 9430IFdir%(I%)<>99 PROCpositions(I%,dir%(I%))
 9440SYS"Hourglass_Percentage",FNround((pla%+not%)/words%*100)
 9450NEXT:PROCgaps:PROCsort(1):PROCIconPutText(main_Window%,6,FNoneormore(pla%)+"placed - "+STR$wsqgaps+"% gaps. ")
 9460SYS"Hourglass_Off":wsqwords%=pla%
 9470IF pla%=0 PROCAlert("WordSq","In fact, no words could be placed. Try increasing the grid size."):PROCIconPutText(main_Window%,6,"No grid formed."):ENDPROC
 9480IFnot%>0 THEN
 9490IFnot%=1 d$="It " ELSE d$="They "
 9500PROCAlert("WordSq","When creating the wordsquare, "+FNoneormore(not%)+"could not be placed. "+d$+"will remain in memory and appear selected in the word list window, but will not show up on the wordsquare.")
 9510PROCclearall:selectedword$="":FORI%=1TOwords%
 9520IFdir%(I%)=99 dir%(I%)=0:PROCSetIcon(words_Window%,I%+3):selected%(I%)=1:selection%+=1:selectedword$=word$(I%)
 9530NEXT:PROCsetbutton
 9540IFselection%=1 d$=selectedword$ ELSE d$=""
 9550PROCIconPutText(main_Window%,26,d$):PROCIconPutText(solve_Window%,17,d$):PROCcaret(LENd$/2)
 9560ENDIF
 9570PROCMenuEnable(main_Menu%,4):PROCMenuEnable(main_Menu%,5):PROCMenuEnable(main_Menu%,6)
 9580PROCdisplay:solveformat$="own":PROCupdatesolvestate
 9590PROCIconPutText(solve_Window%,5,"Using wordsquare from creator program.")
 9600IFsolvewind% PROCBringToTop(display_Window%)
 9610wsqx=dimx:wsqy=dimy:gridsaved%=0
 9620ENDPROC
 9630:
 9640DEFFNcaps(d$)
 9650LOCALK%
 9660IFLENd$=0 =""
 9670FORK%=1TOLENd$:ch%=ASC(MID$(d$,K%,1))
 9680IFch%>96 AND ch%<123 MID$(d$,K%,1)=CHR$(ch%AND223)
 9690NEXT
 9700=d$
 9710:
 9720DEFPROCends
 9730po=A%:po-=1:REPEAT:po+=1:UNTILINT(po/dimx)=po/dimx:me%=po:mw%=me%-(dimx-1)
 9740ENDPROC
 9750:
 9760DEFPROCfit
 9770L%=LENw$-1
 9780IFA%-L%>=mw% AND A%-(dimx*L%)>=1 PROCfill(-1,-dimx):dir%(I%)=8:IF F% ENDPROC
 9790IFA%-L%>=mw% AND A%+(dimx*L%)<=dimx*dimy PROCfill(-1,dimx):dir%(I%)=6:IF F% ENDPROC
 9800IFA%+L%<=me% AND A%+(dimx*L%)<=dimx*dimy PROCfill(1,dimx):dir%(I%)=4:IF F% ENDPROC
 9810IFA%+L%<=me% AND A%-(dimx*L%)>=1 PROCfill(1,-dimx):dir%(I%)=2:IF F% ENDPROC
 9820IFA%-L%>=mw% PROCfill(-1,0):dir%(I%)=7:IF F% ENDPROC
 9830IFA%-(dimx*L%)>=1 PROCfill(0,-dimx):dir%(I%)=1:IF F% ENDPROC
 9840IFA%+(dimx*L%)<=dimx*dimy PROCfill(0,dimx):dir%(I%)=5:IF F% ENDPROC
 9850IFA%+L%<=me%:PROCfill(1,0):dir%(I%)=3:IF F% ENDPROC
 9860ENDPROC
 9870:
 9880DEFPROCfill(x,y)
 9890p%=A%:FORK%=2TOLENw$:p%+=(x+y)
 9900IFgrid%(p%)<>ASC(MID$(w$,K%,1))AND grid%(p%)<>0 K%=LENw$+1:NEXT:ENDPROC
 9910NEXT
 9920start%(I%)=A%
 9930p%=A%:FORK%=1TOLENw$:grid%(p%)=ASC(MID$(w$,K%,1)):p%+=(x+y):NEXT:F%=1
 9940ENDPROC
 9950:
 9960DEFPROCgaps
 9970wsqgaps=0:FORI%=1TOdimx*dimy:IFgrid%(I%)=0 grid%(I%)=RND(26)+64:wsqgaps+=1
 9980NEXT:wsqgaps=FNround((wsqgaps/(dimx*dimy))*100)
 9990ENDPROC
10000:
10010DEFPROCformat1
10020FORI%=1TOwords%
10030IFI%=1 PROCunder ELSE IFI%=dimy+1 PROCover:GOTO10070
10040IFsaveformat$="draw" BPUT#file,"\1";:ELSEIFsaveformat$="imp" BPUT#file,"{""Grid"" on}";
10050IFI%<=dimy PROCput(b$(I%),1):ELSE IFsaveformat$<>"imp" PROCput(FNpad(dimx),1)
10060IFsaveformat$="draw" BPUT#file,"\2";:ELSEIFsaveformat$="imp" BPUT#file,"{""Words"" on}";
10070PROCput(FNpad(3),1)
10080PROCput(word$(I%),0):NEXT
10090IFwords%=dimy PROCover:ENDPROC:ELSEIF words%>=dimy ENDPROC
10100FORI%=words%+1 TO dimy:IFsaveformat$="draw" BPUT#file,"\1";:ELSEIFsaveformat$="imp" BPUT#file,"{""Grid"" on}";
10110PROCput(b$(I%),0):NEXT
10120ENDPROC
10130ENDPROC
10140:
10150DEFPROCformat2
10160IFINT(words%/2)<>words%/2 C1=INT(words%/2)+1:C2=words%-C1:ELSE C1=words%/2:C2=C1
10170FORI%=1TOC1
10180IFI%=1 PROCunder ELSE IFI%=dimy+1 PROCover:GOTO10220
10190IFsaveformat$="draw" BPUT#file,"\1";:ELSE IFsaveformat$="imp" BPUT#file,"{""Grid"" on}";
10200IFI%<=dimy PROCput(b$(I%),1):ELSE IFsaveformat$<>"imp" PROCput(FNpad(dimx),1)
10210IFsaveformat$="draw" BPUT#file,"\2";:ELSE IFsaveformat$="imp" BPUT#file,"{""Words"" on}";
10220PROCput(FNpad(3),1):PROCput(word$(I%),1):PROCput(FNpad(len%-LENword$(I%)+1),1):PROCput(word$(C1+I%),0):NEXT
10230IFC1=dimy PROCover:ENDPROC:ELSEIF C1>=dimy ENDPROC
10240IFsaveformat$="draw" BPUT#file,"\1";:ELSE IFsaveformat$="imp" BPUT#file,"{""Grid"" on}";
10250FORI%=C1+1 TO dimy:PROCput(b$(I%),0):NEXT
10260PROCover
10270ENDPROC
10280:
10290DEFPROCformat3
10300C%=words%-((dimy+1)*2):D%=C%+1:REPEAT:D%-=1:UNTILINT(D%/4)=D%/4:E%=C%-D%
10310IF E%=0:E%=4:C1=D%/4:C2=C1:C3=C1:C4=C3
10320IF E%=1:C1=(D%/4)+1:C2=D%/4:C3=C2:C4=C3
10330IF E%=2:C1=(D%/4)+1:C2=(D%/4)+1:C3=D%/4:C4=C3
10340IF E%=3:C1=(D%/4)+1:C2=(D%/4)+1:C3=(D%/4)+1:C4=D%/4
10350FORI%=1TOdimy
10360IFI%=1PROCunder
10370IFsaveformat$="draw" BPUT#file,"\1";:ELSE IFsaveformat$="imp" BPUT#file,"{""Grid"" on}";
10380PROCput(b$(I%),1):PROCput(FNpad(3),1):IFsaveformat$="draw" BPUT#file,"\2";:ELSE IFsaveformat$="imp" BPUT#file,"{""Words"" on}";
10390PROCput(word$(C1+C2+I%),1):PROCput(FNpad(len%+1-LENword$(C1+C2+I%)),1):PROCput(word$(dimy+C1+C2+C3+1+I%),0):NEXT
10400IFsaveformat$="draw" BPUT#file,"\1";:ELSE IFsaveformat$="imp" BPUT#file,"{""Grid"" on}";
10410PROCover:PROCput(FNpad(3),1)
10420IFsaveformat$="draw" BPUT#file,"\2";:ELSE IFsaveformat$="imp" BPUT#file,"{""Words"" on}";
10430PROCput(word$(dimy+C1+C2+1),1):PROCput(FNpad(len%+1-LENword$(dimy+C1+C2+1)),1):PROCput(word$(dimy+dimy+C1+C2+C3+2),0)
10440FORI%=1TOC1
10450IFsaveformat$="draw" BPUT#file,"\2";:ELSE IFsaveformat$="imp" BPUT#file,"{""Words"" on}";
10460PROCput(word$(I%),1):PROCput(FNpad(len%+1-LENword$(I%)),1)
10470IFI%<C1 OR (I%=C1 AND E%>=2) PROCput(word$(C1+I%),1):PROCput(FNpad(dimx+3-(len%+1-LENword$(I%)+LENword$(I%)+LENword$(C1+I%))),1)
10480IFI%<C1 OR (I%=C1 AND E%>=3) PROCput(word$(dimy+C1+C2+1+I%),1):PROCput(FNpad(len%+1-LENword$(dimy+C1+C2+1+I%)),1)
10490IFI%<C1 OR (I%=C1 AND E%>=4) PROCput(word$(dimy+dimy+C1+C2+C3+2+I%),0)
10500NEXT
10510ENDPROC
10520:
10530DEFPROCtabs
10540case%=FNcase
10550IFcase%=0 a=2.7:b=0.44 ELSE a=4:b=0.65
10560CASE c% OF
10570WHEN 1:t1%=(dimx*(3.65+((gridpt%-6)*0.6)))+22:tab$="tabs "+STR$t1%+"pt"
10580WHEN 2:t1%=(dimx*(3.65+((gridpt%-6)*0.6)))+22:t2%=t1%+5+(len%*(a+((wordspt%-6)*b))):tab$="tabs "+STR$t1%+"pt,"+STR$t2%+"pt"
10590WHEN 4:t1%=15+(len%*(a+((wordspt%-6)*b))):t2%=(dimx*(3.65+((gridpt%-6)*0.6)))+22:t3%=t2%+15+(len%*(a+((wordspt%-6)*b))):tab$="tabs "+STR$t1%+"pt,"+STR$t2%+"pt,"+STR$t3%+"pt"
10600ENDCASE
10610ENDPROC
10620:
10630DEFPROCheader
10640CASE saveformat$ OF
10650WHEN "text"
10660WHEN "draw":header$="\! 1"+CHR$10+"\F 0 "+titlefont$+" "+STR$titlept%+CHR$10+"\F 1 "+gridfont$+" "+STR$gridpt%+CHR$10+"\F 2 "+wordsfont$+" "+STR$wordspt%+CHR$10+"\L"+STR$(FNround(gridpt%*1.08))+CHR$10
10670header$+="\P"+STR$(FNround((gridpt%*1.08)/1.75))+CHR$10+"\0"
10680BPUT#file,header$
10690WHEN "imp":header$="{define style ""Title"";font "+titlefont$+";fontsize "+STR$titlept%+"pt;"+tab$+"}{define style ""Grid"";font "+gridfont$+";fontsize "+STR$gridpt%+"pt;"+tab$+"}"
10700header$+="{define style ""Words"";font "+wordsfont$+";fontsize "+STR$wordspt%+"pt;"+tab$+"}{""Title"" on}"
10710BPUT#file,header$;
10720ENDCASE
10730ENDPROC
10740:
10750DEFFNpad(d%)
10760IF saveformat$="imp" ="{tab}"
10770IF saveformat$="draw" =STRING$(d%,CHR$160)
10780=STRING$(d%," ")
10790:
10800DEFPROCput(d$,d%)
10810IFsaveformat$="print" PRINTd$;:IFd%=0 PRINT
10820IFsaveformat$<>"print" BPUT#file,d$;:IFd%=0 BPUT#file,""
10830ENDPROC
10840:
10850DEFPROCover
10860IFsaveformat$="draw" a$="\1":b$=FNpad(dimx):c$="\2"
10870IFsaveformat$="imp" THEN
10880IFc%=4 b$="{tab}" ELSE b$=""
10890a$="{""Grid"" on}":c$="{""Words"" on}"
10900ENDIF
10910IFsaveformat$="text" a$="":b$=FNpad(dimx):c$=""
10920IFsaveformat$<>"print" OR overon$="" OR overoff$="" PROCput(a$+b$+c$,1):ENDPROC
10930PROCgetecho(overon$):PROCput(FNpad(dimx),1):PROCgetecho(overoff$)
10940ENDPROC
10950:
10960DEFPROCunder
10970IFsaveformat$<>"print" OR underon$="" OR underoff$="" PROCput("",0):ENDPROC
10980PROCgetecho(underon$):PROCput(FNpad(dimx),0):PROCgetecho(underoff$)
10990ENDPROC
11000:
11010DEFPROCpre
11020IFsaveformat$<>"print" OR pre$="" ENDPROC
11030PROCgetecho(pre$)
11040ENDPROC
11050:
11060DEFPROCpost
11070IFsaveformat$<>"print" OR post$="" ENDPROC
11080PROCgetecho(post$)
11090ENDPROC
11100:
11110DEFPROCprinttitle
11120IFemphon$="" OR emphoff$="" PRINTwsqtitle$:ENDPROC
11130PROCgetecho(emphon$):PRINTwsqtitle$:PROCgetecho(emphoff$)
11140ENDPROC
11150:
11160DEFPROCgetecho(d$)
11170d%=1
11180FORK%=1TOLENd$:dummy$="":IFMID$(d$,K%,1)="," dummy$=MID$(d$,d%,K%-d%):d%=K%+1:ELSE IF K%=LENd$ dummy$=MID$(d$,d%,K%-d%+1)
11190IFdummy$<>"" PRINTCHR$1;CHR$VALdummy$;
11200NEXT
11210ENDPROC
11220:
11230DEFPROCcaret(c%)
11240IFc%>1000 AND solvewind% c%-=1000:PROCIconCaret(solve_Window%,17,c%):ENDPROC ELSE IFc%>1000 ENDPROC
11250IFsolvewind% PROCIconCaret(solve_Window%,17,c%)
11260IFmainwind% AND solveformat$<>"text" PROCIconCaret(main_Window%,26,c%)
11270ENDPROC
11280:
11290DEFFNnew(extra$)
11300message$="You have not saved your ":IFwordssaved%=0 message$+="words":IFgridsaved%=0 message$+=" or"
11310IFgridsaved%=0 message$+=" grid. " ELSE message$+=". "
11320message$+="Are you sure you want to "+extra$+"?"
11330IFwordssaved%=1 AND gridsaved%=1 message$=""
11340IF message$<>"":IFFNWindowCancel("WordSq",message$)=0 =0
11350=1
11360:
11370DEFPROCreset
11380SYS"Hourglass_On"
11390PROCcloseall
11400selection%=0:word$()="":grid%()=0:start%()=0:dir%()=0:len%()=0:PROCsetbutton
11410words%=0:gaps=25:dimx=0:dimy=0:solveformat$="":high%=0:show%()=0
11420sx%()=0:sy%()=0:ex%()=0:ey%()=0:show%=0:found%=0:done%=0
11430wsqx=0:wsqy=0:wsqwords%=0:wordssaved%=1:gridsaved%=1:startx%=0:starty%=0
11440RESTORE:FORI%=1TO10:READd%:PROCIconEnable(main_Window%,d%):NEXT
11450PROCIconPutText(main_Window%,5,"No words entered."):PROCIconPutText(main_Window%,6,"No grid formed.")
11460PROCIconPutText(main_Window%,12,STR$dimx):PROCIconPutText(main_Window%,16,STR$dimy):PROCIconPutText(main_Window%,20,STR$gaps)
11470PROCIconPutText(solve_Window%,5,"No wordsquare currently available."):PROCIconPutText(solve_Window%,6,"No words available - None shown.")
11480PROCIconPutText(main_Window%,26,""):PROCIconPutText(solve_Window%,17,""):PROCIconPutText(main_Window%,9,"<Untitled>")
11490FORI%=4 TO 171:PROCIconPutText(words_Window%,I%,""):PROCsic(words_Window%,I%,7):IFselected%(I%-3)=1 selected%(I%-3)=0:PROCSetIcon(words_Window%,I%):NEXT:ELSE NEXT
11500PROCww
11510IFwordswind%=1 PROCMenuTick(display_Menu%,2):PROCMenuTick(main_Menu%,2):PROCMenuTick(solve_Menu%,2)
11520PROCMenuDisable(main_Menu%,2):PROCMenuDisable(main_Menu%,3):PROCMenuDisable(main_Menu%,4):PROCMenuDisable(main_Menu%,5):PROCMenuDisable(display_Menu%,2)
11530PROCMenuDisable(solve_Menu%,2)
11540PROCMenuDisable(words_Menu%,2)
11550selected%()=0:mainwind%=0:solvewind%=0:dispwind%=0
11560SYS"Hourglass_Off"
11570ENDPROC
11580:
11590DEFPROCng
11600grid%()=0:start%()=0:dir%()=0:solveformat$="":high%=0:show%()=0
11610wsqx=0:wsqy=0:wsqwords%=0:gridsaved%=1:show%=0:found%=0:done%=0
11620PROCIconPutText(main_Window%,6,"No grid formed.")
11630PROCIconPutText(solve_Window%,5,"No wordsquare currently available."):PROCIconPutText(solve_Window%,6,"No words available - None shown.")
11640PROCMenuDisable(main_Menu%,4):PROCMenuDisable(main_Menu%,5):PROCMenuDisable(main_Menu%,6)
11650FORI%=4TO171:PROCsic(words_Window%,I%,7):NEXT
11660IFZ%=1 SYS"Hourglass_On":PROCsort(1):SYS"Hourglass_Off":ENDPROC
11670gaps=25:dimx=0:dimy=0
11680PROCIconPutText(main_Window%,20,STR$gaps)
11690ENDPROC
11700:
11710DEFPROCcloseall
11720PROCWindowClose(display_Window%):PROCWindowClose(main_Window%):PROCWindowClose(solve_Window%):PROCWindowClose(words_Window%):PROCWindowClose(prefs_Window%)
11730wordswind%=0:solvewind%=0:dispwind%=0
11740ENDPROC
11750:
11760DEFPROCdisplay
11770dummy%=0:FORI%=1TOdimy:dummy$="":FORJ%=1TOdimx:dummy%+=1
11780dummy$+=CHR$(grid%(dummy%)):IFJ%<>dimx dummy$+=" "
11790NEXT:IFLENdummy$<79 dummy$+=STRING$(79-LENdummy$," ")
11800PROCIconPutText(display_Window%,I%+1,dummy$):NEXT
11810IFdimy<60 FORI%=dimy+1TO60:PROCIconPutText(display_Window%,I%+1,STRING$(79," ")):NEXT
11820PROCresize(display_Window%,0,-84-(dimy*44),54+(dimx*32),0)
11830ENDPROC
11840:
11850DEFPROCupdatesolvestate
11860CASE solveformat$ OF
11870WHEN "own"
11880wordstatus$=FNoneormore(wsqwords%)+"in the grid - "+FNnone(high%)+"shown - "+FNnone(selection%)+"selected.":PROCIconPutText(solve_Window%,6,wordstatus$)
11890wordstatus$=FNoneormore(words%)+"entered - "+FNnone(selection%)+"selected.":PROCIconPutText(main_Window%,5,wordstatus$)
11900WHEN "text"
11910wordstatus$=FNoneormore(wsqwords%)+"in the grid - "+FNnone(high%)+"shown - "+FNnone(selection%)+"selected.":PROCIconPutText(solve_Window%,6,wordstatus$)
11920wordstatus$=FNoneormore(wsqwords%)+"found - "+FNnone(selection%)+"selected.":PROCIconPutText(main_Window%,5,wordstatus$)
11930WHEN ""
11940wordstatus$=FNoneormore(words%)+"entered - "+FNnone(selection%)+"selected.":PROCIconPutText(main_Window%,5,wordstatus$)
11950ENDCASE
11960ENDPROC
11970:
11980DEFPROCsetbutton
11990IFselection%<2 d$=" Word" ELSE d$=" Selection"
12000PROCIconPutText(main_Window%,25,"Delete"+d$)
12010PROCIconPutText(solve_Window%,8,"Remove"+d$)
12020PROCIconPutText(solve_Window%,9,"Show"+d$)
12030ENDPROC
12040:
12050DEFPROCfind(d$)
12060SYS"Hourglass_On"
12070w$=FNstrip(d$)
12080F%=0:I%=words%+1
12090FORA%=1TOdimx*dimy
12100SYS"Hourglass_Percentage",A%/(dimx*dimy)*100
12110IFgrid%(A%)=ASCLEFT$(d$,1) PROCnextstep
12120NEXT
12130SYS"Hourglass_Off"
12140IFF%=0 PROCAlert("WordSq","The word '"+d$+"' does not exist in the currently loaded wordsquare."):ENDPROC
12150IFF%>1 AND FNpalindrome(d$)=0 PROCAlert("WordSq","More than one occurrence of "+gibbet$+" has been found, so it will be ignored"):ENDPROC
12160SYS"Hourglass_On"
12170d$=FNIconText(solve_Window%,17):IFcaps%=-1 d$=FNcaps(d$)
12180words%+=1:wsqwords%+=1:word$(words%)=d$:len%(words%)=FNlen(d$):dir%(words%)=d%:needs%=SUMlen%():gaps=FNgaps
12190PROCpositions(words%,dir%(words%))
12200high%+=1:show%(words%)=1:PROCsort(1):FORI%=1TOwords%:PROCIconPutText(words_Window%,I%+3,word$(I%)):NEXT
12210PROCww
12220need%=1:wordssaved%=0
12230SYS"Hourglass_Off"
12240ENDPROC
12250:
12260DEFPROCnextstep
12270PROCends:L%=LENd$-1
12280IFA%-L%>=mw%ANDA%-(dimx*L%)>=1:dir%(I%)=8:PROCgetstring(-1,-dimx)
12290IFA%-L%>=mw%ANDA%+(dimx*L%)<=dimx*dimy:dir%(I%)=6:PROCgetstring(-1,dimx)
12300IFA%+L%<=me% AND A%+(dimx*L%)<=dimx*dimy:dir%(I%)=4:PROCgetstring(1,dimx)
12310IFA%+L%<=me% AND A%-(dimx*L%)>=1:dir%(I%)=2:PROCgetstring(1,-dimx)
12320IFA%-L%>=mw%:dir%(I%)=7:PROCgetstring(-1,0)
12330IFA%-(dimx*L%)>=1:dir%(I%)=1:PROCgetstring(0,-dimx)
12340IFA%+(dimx*L%)<=dimx*dimy:dir%(I%)=5:PROCgetstring(0,dimx)
12350IFA%+L%<=me%:dir%(I%)=3:PROCgetstring(1,0)
12360ENDPROC
12370:
12380DEFPROCgetstring(x,y)
12390dummy$=LEFT$(d$,1):p%=A%:FORJ%=2TOLENd$:p%+=x+y:dummy$+=CHR$grid%(p%):NEXT
12400IF dummy$=d$ F%+=1:start%(I%)=A%:d%=dir%(I%)
12410ENDPROC
12420:
12430DEFFNexists(d$)
12440SYS"Hourglass_On"
12450e%=0:FORW%=1TOwords%:IF d$=FNstrip(FNcaps(word$(W%))) e%=W%
12460NEXT
12470SYS"Hourglass_Off"
12480=e%
12490:
12500DEFFNpalindrome(o$)
12510dummy$="":FORo%=LENo$TO1 STEP-1:dummy$+=MID$(o$,o%,1):NEXT
12520IFo$=dummy$ =1 ELSE =0
12530:
12540DEFPROCcopyover
12550temp$()=""
12560FORI%=1TOwords%:temp$(I%)=word$(I%)
12570IFstart%(I%)=0 AND dir%(I%)=0 word$(I%)="~~"
12580NEXT:PROCsort(2):PROCrep(1)
12590ENDPROC
12600:
12610DEFPROCcopyback
12620word$()=""
12630FORI%=1TOwords%:SWAPtemp$(I%),word$(I%):NEXT
12640ENDPROC
12650:
12660DEFPROCautoload
12670SYS "OS_GetEnv" TO d$
12680d$=RIGHT$(d$,LENd$-20)
12690WHILE LEFT$(d$,1)<>" " AND LENd$<>0
12700d$=RIGHT$(d$,LENd$-1)
12710ENDWHILE
12720IFd$=" " d$=""
12730ENDPROC
12740:
12750DEFPROCcrossout(d%)
12760xpos%=x_origin%+14:ypos%=y_origin%-((d%-2)*36)-252+6
12770MOVE xpos%,ypos%:DRAW xpos%+(len%(d%)*16)+2,ypos%
12780ENDPROC
12790:
12800DEFPROCsic(w%,i%,c%)
12810!wimp%=w%:wimp%!4=i%:wimp%!8=c%<<24:wimp%!12=&0F000000
12820SYS"Wimp_SetIconState",0,wimp%
12830ENDPROC
12840:
12850DEFPROCsib(w%,i%,c%)
12860!wimp%=w%:wimp%!4=i%:wimp%!8=c%<<28:wimp%!12=&F0000000
12870SYS"Wimp_SetIconState",0,wimp%
12880ENDPROC
12890:
12900DEFFNgetword(startpos%,endpos%)
12910A%=startpos%:SWAPwsqx,dimx:SWAPwsqy,dimy:PROCends:SWAPwsqx,dimx:SWAPwsqy,dimy
12920scol%=startpos%MODwsqx:IFscol%=0 scol%=wsqx
12930ecol%=endpos%MODwsqx:IFecol%=0 ecol%=wsqx
12940srow%=((startpos%-1)DIVwsqx):erow%=((endpos%-1)DIVwsqx)
12950IFsrow%>erow% AND scol%=ecol% dx%=0:dy%=-wsqx:GOTO13030
12960IFsrow%>erow% AND scol%<ecol% dx%=1:dy%=-wsqx:GOTO13030
12970IFsrow%=erow% AND scol%<ecol% dx%=1:dy%=0:GOTO13030
12980IFsrow%<erow% AND scol%<ecol% dx%=1:dy%=wsqx:GOTO13030
12990IFsrow%<erow% AND scol%=ecol% dx%=0:dy%=wsqx:GOTO13030
13000IFsrow%<erow% AND scol%>ecol% dx%=-1:dy%=wsqx:GOTO13030
13010IFsrow%=erow% AND scol%>ecol% dx%=-1:dy%=0:GOTO13030
13020IFsrow%>erow% AND scol%>ecol% dx%=-1:dy%=-wsqx
13030dummy$="":p%=startpos%:o%=0
13040REPEAT
13050dummy$+=CHR$grid%(p%)
13060p%+=dx%+dy%
13070IFp%=endpos% o%=1:dummy$+=CHR$grid%(p%):p%=-1
13080UNTIL p%<0 OR p%>(wsqx*wsqy)
13090IFo%=1 ANDLENdummy$<19 AND LENdummy$>2 =dummy$ ELSE =""
13100:
13110DEFFNstrip(o$)
13120c$=FNcaps(o$):o%=LENc$:o$="":FORJ%=1TOo%:e$=MID$(c$,J%,1):IFe$<="Z"ANDe$>="A" o$+=e$
13130NEXT
13140=o$
13150:
13160DEFPROCpositions(d%,dir%)
13170IFstart%(d%)MODwsqx=0 xpos%=wsqx-1 ELSE xpos%=(start%(d%)MODwsqx)-1
13180ypos%=(start%(d%)DIVwsqx)
13190IFstart%(d%)/wsqx=INT(start%(d%)/wsqx) ypos%-=1
13200xpos%=(xpos%*32)+25:ypos%=(ypos%*44)+68
13210CASE dir% OF
13220WHEN 1:dx%=0:dy%=44
13230WHEN 2:dx%=32:dy%=44
13240WHEN 3:dx%=32:dy%=0
13250WHEN 4:dx%=32:dy%=-44
13260WHEN 5:dx%=0:dy%=-44
13270WHEN 6:dx%=-32:dy%=-44
13280WHEN 7:dx%=-32:dy%=0
13290WHEN 8:dx%=-32:dy%=44
13300ENDCASE
13310dy%=-dy%
13320sx%(d%)=xpos%:sy%(d%)=ypos%:ex%(d%)=xpos%+((len%(d%)-1)*dx%):ey%(d%)=ypos%+((len%(d%)-1)*dy%)
13330ENDPROC
13340:
13350DEFFNcase
13360d%=0
13370FORI%=1TOwords%:FORJ%=1TOLENword$(I%):d$=MID$(word$(I%),J%,1):IF d$>="A"  AND d$<="Z" d%+=1
13380NEXT:NEXT
13390IFd%>(words%*2.5) =1 ELSE =0
13400:
13410DEFFNorigin
13420=16+wimp%!4-wimp%!20-18
13430:
13440DATA 11,13,15,17,19,21,24,26,28,29
13450:
13460DEFPROCAlert(title$,message$)
13470PROCAlertBox(title$,message$,0)
13480ENDPROC
13490:
13500DEFPROCAlertBox(title$,message$,button%)
13510LOCALresponse%:$(wimp%+4)=message$:CASE button% OF
13520WHEN 1:response%=15
13530WHEN 2:response%=1
13540WHEN 3:response%=(1<<5)+16
13550WHEN 4:response%=(1<<6)+16
13560OTHERWISE:response%=16
13570ENDCASE
13580SYS "Wimp_ReportError",wimp%,response%,title$ TO ,response%
13590ENDPROC
13600:
13610DEFFNWindowCancel(title$,message$)
13620$(wimp%+4)=message$:response%=23
13630SYS "Wimp_ReportError",wimp%,response%,title$ TO ,response%
13640=response%-2
13650:
13660DEFFNWindowTitle(window%)
13670wimp%!0=window%
13680SYS "Wimp_GetWindInfo",,wimp%
13690IF ((wimp%!60)AND&100)=0 ERROR 1,"Title isn't indirected"
13700=$(wimp%!76)
13710:
13720DEFFNWindowLoad(window$)
13730=FNWindowLoadFrom(window$,"<WordSq$Dir>.Templates")
13740:
13750DEFFNWindowLoadFrom(window$,template$)
13760LOCAL c%,i%,n%,j%,sp$,sp2$
13770SYS "Wimp_OpenTemplate",,template$
13780SYS "Wimp_LoadTemplate",,wimp%,icons%,icon_memory%,-1,window$,0 TO ,,icons%
13790CASE sprites% OF
13800WHEN 1:wimp%!64=sprites%
13810OTHERWISE:wimp%!64=sprites%
13820ENDCASE
13830SYS "Wimp_CreateWindow",,wimp% TO c%
13840SYS "Wimp_CloseTemplate"
13850SYS "Wimp_WhichIcon",c%,wimp%+40,1+2+(1<<8),2+(1<<8)
13860CASE wimp%!40 OF
13870WHEN -1
13880OTHERWISE:i%=40
13890REPEAT
13900wimp%!4=wimp%!i%:wimp%!0=c%
13910SYS "Wimp_GetIconState",,wimp%
13920sp$=FNGetStringAtAddress(wimp%!28)
13930SYS "Wimp_DeleteIcon",,wimp%
13940CASE sprites% OF
13950WHEN 1:wimp%!32=1
13960OTHERWISE
13970SYS "OS_SpriteOp",&108,sprites% TO ,,,n%
13980j%=0
13990REPEAT:j%+=1
14000SYS "OS_SpriteOp",&10D,sprites%,pointer_block%,20,j%
14010sp2$=FNGetStringAtAddress(pointer_block%)
14020UNTIL j%=n% OR sp$=sp2$
14030IF sp$=sp2$ THEN wimp%!32=sprites% ELSE wimp%!32=1
14040ENDCASE
14050wimp%!4=c%
14060SYS "Wimp_CreateIcon",,wimp%+4 TO handle%
14070i%+=4
14080UNTIL (wimp%!i%)=-1
14090ENDCASE
14100=c%
14110:
14120DEFPROCBringToTop(window%)
14130!wimp%=window%
14140SYS "Wimp_GetWindowState",,wimp%
14150wimp%!28=-1
14160SYS "Wimp_OpenWindow",,wimp%
14170IFwindow%=display_Window% dispwind%=1
14180ENDPROC
14190:
14200DEFPROCWindowClose(window%)
14210!wimp%=window%
14220SYS "Wimp_CloseWindow",,wimp%
14230IFwindow%=display_Window% dispwind%=0
14240ENDPROC
14250:
14260DEFPROCWindowForceDraw(window%)
14270CASE window% OF
14280WHEN -1:SYS "Wimp_ForceRedraw",-1,0,0,2*1280,2*1024
14290OTHERWISE:SYS "Wimp_ForceRedraw",window%,0,-2*1024,2*1280,0
14300ENDCASE
14310ENDPROC
14320:
14330DEFPROCWindowOpen(window%)
14340!wimp%=window%
14350SYS "Wimp_GetWindowState",,wimp%
14360SYS "Wimp_OpenWindow",,wimp%
14370ENDPROC
14380:
14390PROCWindowInterface
14400SYS"Wimp_BorderWindow",,wimp%
14410ENDPROC
14420:
14430DEFFNIconBar(Sprite$)
14440LOCAL icon%
14450wimp%!0=-1
14460wimp%!4=0:wimp%!8=0
14470wimp%!12=68:wimp%!16=68
14480wimp%!20=&3002
14490$(wimp%+24)=Sprite$
14500SYS "Wimp_CreateIcon",,wimp% TO icon%
14510=icon%
14520:
14530DEFPROCIconCaret(window%,icon%,chars%)
14540SYS "Wimp_SetCaretPosition",window%,icon%,,,-1,chars%
14550ENDPROC
14560:
14570DEFFNIconText(window%,icon%)
14580wimp%!0=window%:wimp%!4=icon%
14590SYS "Wimp_GetIconState",,wimp%
14600IF ((wimp%!24) AND &100)=0 ERROR 1,"Icon "+STR$icon%+" in window "+STR$window%+" isn't indirected"
14610=$(wimp%!28)
14620:
14630DEFFNIconValidation(window%,icon%)
14640wimp%!0=window%:wimp%!4=icon%
14650SYS "Wimp_GetIconState",,wimp%
14660IF ((wimp%!24) AND &100)=0 ERROR 1,"Icon "+STR$icon%+" in window "+STR$window%+" isn't indirected"
14670=$(wimp%!32)
14680:
14690DEFPROCIconDisable(window%,icon%)
14700wimp%!0=window%:wimp%!4=icon%
14710wimp%!8=1<<22:wimp%!12=1<<22
14720SYS "Wimp_SetIconState",,wimp%
14730ENDPROC
14740:
14750DEFPROCIconEnable(window%,icon%)
14760wimp%!0=window%:wimp%!4=icon%
14770wimp%!8=0:wimp%!12=1<<22
14780SYS "Wimp_SetIconState",,wimp%
14790ENDPROC
14800:
14810DEFFNIconPutSprite(window%,icon%,sprite$)
14820wimp%!0=window%:wimp%!4=icon%
14830SYS "Wimp_GetIconState",,wimp%
14840SYS "Wimp_DeleteIcon",,wimp%
14850wimp%!4=wimp%!8:wimp%!8=wimp%!12:wimp%!12=wimp%!16
14860wimp%!16=wimp%!20:wimp%!20=wimp%!24:$(wimp%+24)=sprite$
14870SYS "Wimp_CreateIcon",,wimp% TO icon%
14880=icon%
14890:
14900DEFPROCIconPutText(window%,icon%,text$)
14910wimp%!0=window% : wimp%!4=icon%
14920SYS "Wimp_GetIconState",,wimp%
14930IF ((wimp%!24) AND &100)=0 ERROR 1,"Icon "+STR$icon%+" in window "+STR$window%+" isn't indirected"
14940$(wimp%!28)=text$
14950wimp%!0=window%:wimp%!4=icon%
14960wimp%!8=0:wimp%!12=0
14970SYS "Wimp_SetIconState",,wimp%
14980ENDPROC
14990:
15000DEFPROCIconInterfaceStart
15010SYS"Wimp_BorderIcon",,wimp%
15020ENDPROC
15030:
15040DEFPROCIconInterfaceFinish
15050wimp%!8=0
15060SYS"Wimp_BorderIcon",,wimp%
15070ENDPROC
15080:
15090DEFPROCMenuAdjustOn(menu%)
15100SYS "Wimp_GetPointerInfo",,pointer_block%
15110IF ((pointer_block%!8)AND1)=1 THEN SYS "Wimp_CreateMenu",,menu%,pointer_block%!0,pointer_block%!4
15120ENDPROC
15130:
15140DEFFNMenuChoice(level%)
15150=(wimp%!(4*level%))+1
15160:
15170DEFFNMenuCreate(menu$)
15180IF menu$="Colours" THEN=FNMenuCreateColours(" ")
15190LOCAL menu%,index%,width%,length%,k%,s%
15200DIM menu% 28+FNMenuNoOfEntries(menu$)*24
15210menu%?12=7:menu%?13=2:menu%?14=7:menu%?15=0
15220menu%!16=140:menu%!20=44:menu%!24=0
15230index%=menu%+28
15240$menu%=LEFT$(menu$,INSTR(menu$,"\")-1)
15250width%=LEN(LEFT$(menu$,INSTR(menu$,"\")-1))
15260menu$+="\":Menu_NoOfEntries%=0
15270WHILE menu$<>""
15280menu$=MID$(menu$,INSTR(menu$,"\")+1)
15290CASE menu$ OF
15300WHEN ""
15310OTHERWISE
15320!index%=0:index%!4=-1:index%!8=&7000021
15330length%=INSTR(menu$,"\")-1
15340k%=INSTR(LEFT$(menu$,length%),">")
15350CASE k% OF
15360WHEN 0
15370OTHERWISE
15380s%=EVAL(MID$(menu$,k%+1,length%-k%))
15390index%!4=s%
15400length%=k%-1
15410ENDCASE
15420$(index%+12)=LEFT$(menu$,length%)
15430IF length%>width% THEN width%=length%
15440index%+=24
15450ENDCASE
15460ENDWHILE
15470menu%!16=16*(width%+1)
15480index%!-24=index%!-24 OR &80:=menu%
15490:
15500DEFFNMenuNoOfEntries(menu$)
15510LOCAL n%,j%:n%=0:j%=0
15520REPEAT
15530j%=INSTR(menu$,"\",j%+1)
15540IF j%<>0 THEN n%+=1
15550UNTIL j%=0
15560=n%
15570:
15580DEFPROCMenuClose
15590SYS "Wimp_CreateMenu",-1
15600ENDPROC
15610:
15620DEFPROCMenuDisable(menu%,item%)
15630menu%!(36+(item%-1)*24)=menu%!(36+(item%-1)*24)OR(1<<22)
15640ENDPROC
15650:
15660DEFPROCMenuEnable(menu%,item%)
15670PROCMenuDisable(menu%,item%)
15680menu%!(36+(item%-1)*24)=menu%!(36+(item%-1)*24)EOR(1<<22)
15690ENDPROC
15700:
15710DEFPROCMenuTick(menu%,item%)
15720menu%!(28+(item%-1)*24)=(menu%!(28+(item%-1)*24))EOR1
15730ENDPROC
15740:
15750DEFPROCSpritesLoad
15760PROCSpritesPathLoad("<WordSq$Dir>.Sprites")
15770direct_sprites%=sprites%
15780ENDPROC
15790:
15800DEFPROCSpritesPathLoad(pathname$)
15810LOCALS%,T%
15820S%=OPENIN"<WordSq$Dir>.Sprites":T%=EXT#S%+16:CLOSE#S%
15830DIMsprites%T%,spname%12
15840!sprites%=T%:sprites%!8=0
15850SYS"OS_SpriteOp",&109,sprites%
15860SYS"OS_SpriteOp",&10A,sprites%,pathname$
15870ENDPROC
15880:
15890DEFFNGetFilePathName
15900=FNGetStringAtAddress(wimp%+44)
15910:
15920DEFFNGetStringAtAddress(array%)
15930LOCALs$:s$=""
15940WHILE(?array%<>13)AND(?array%<>0):s$+=CHR$(?array%):array%+=1:ENDWHILE:
15950=s$
15960:
15970DEFFNGetFileFromPathname(f$)
15980CASE INSTR(f$,".") OF
15990WHEN 0:=f$
16000OTHERWISE:=FNGetFileFromPathname(RIGHT$(f$,LEN(f$)-INSTR(f$,".")))
16010ENDCASE
16020:
16030DEFPROCStart(TaskName$,wimp_memory%,icon%)
16040DIM wimp% wimp_memory%,icons% icon%
16050IF wimp_memory%<256 THEN wimp_memory%=256
16060icon_memory%=icons%+icon%
16070task$=TaskName$
16080indirect_sprites%=1:direct_sprites%=1
16090PROCSetEventVariables
16100SYS"Wimp_Initialise",200,&4B534154,TaskName$ TO version%,task%
16110ENDPROC
16120:
16130DEFPROCSetEventVariables
16140DIM pointer_block% 20
16150null%=1:draw%=2:pointer_leaving%=1<<4
16160pointer_entering%=1<<5:mouse%=1<<6:drag%=1<<7
16170key%=1<<8:menu%=1<<9:scroll%=1<<10
16180lose_caret%=1<<11:gain_caret%=1<<12:message%=(1<<17)+(1<<18)
16190recorder%=1<<18:acknowledge%=1<<19:window%=0
16200sprites%=1:version%=0:task%=0
16210Bar_Window%=-2:Bar_Icon%=0:Bar_Menu%=0
16220x_origin%=0:y_origin%=0:SaveWindow%=-3
16230message_quit%=0:message_save%=2:message_load%=3
16240mouse_button%=2:save_event%=0
16250top_line%=0:bottom_line%=0
16260ENDPROC
16270:
16280DEFPROCError
16290LOCALX$,x%
16300VDU3
16310ON ERROR OFF
16320SYS"Hourglass_Smash"
16330PROCMenuClose
16340x%=ERL
16350DIMErrorMsg%36
16360ErrorMsg%!0=36:ErrorMsg%!12=0:ErrorMsg%!16=&81080:ErrorMsg%!20=x%
16370$(ErrorMsg%+24)="!RunImage"
16380SYS"Wimp_SendMessage",17,ErrorMsg%
16390PROCAlert(task$,REPORT$+STR$ERL)
16400ENDCASE
16410ENDPROC
16420:
16430DEFPROCCloseDown
16440VDU3:SYS"Hourglass_Smash"
16450SYS"Wimp_CloseDown",task%,"TASK"
16460ENDPROC
16470:
16480DEFPROCQuit
16490finished%=TRUE
16500ENDPROC
16510:
16520DEFPROCpoll
16530LOCAL mask%,event%
16540finished%=FALSE
16550mask%=%111000011001
16560REPEAT
16570SYS"Wimp_Poll",mask%,wimp% TO event%
16580CASE event% OF
16590WHEN0
16600WHEN1:PROCPollDrawWindow
16610WHEN2:SYS "Wimp_OpenWindow",,wimp%
16620WHEN3:PROCPollCloseWindow
16630WHEN4
16640WHEN5
16650WHEN6:PROCPollMouseClick
16660WHEN7:PROCPollSaveMessage
16670WHEN8:PROCPollKeyPress
16680WHEN9:PROCEvent_MenuChoice(menu%)
16690WHEN10
16700WHEN11
16710WHEN12
16720WHEN17,18:PROCPollMessages
16730WHEN19
16740ENDCASE
16750UNTIL finished%
16760ENDPROC
16770:
16780DEFPROCPollDrawWindow
16790LOCAL more%
16800SYS"Wimp_RedrawWindow",,wimp%TOmore%
16810window%=wimp%!0
16820x_origin%=16+wimp%!4-wimp%!20:y_origin%=-16+wimp%!16-wimp%!24
16830WHILEmore%
16840SYS"Wimp_BorderWindow",,wimp%
16850PROCEvent_Draw(window%,x_origin%,y_origin%)
16860SYS"Wimp_GetRectangle",,wimp%TOmore%
16870ENDWHILE
16880ENDPROC
16890:
16900DEFPROCPollCloseWindow
16910SYS "Wimp_GetPointerInfo",,wimp%
16920window%=wimp%!12:buttons%=wimp%!8
16930PROCEvent_WindowClose(window%,buttons%)
16940!wimp%=window%:SYS "Wimp_CloseWindow",,wimp%
16950ENDPROC
16960:
16970DEFPROCPollMouseClick
16980button%=wimp%!8:window%=wimp%!12:icon%=wimp%!16:x%=wimp%!0:y%=wimp%!4
16990x_origin%=wimp%!4-wimp%!20+16
17000CASE button% OF
17010WHEN2:PROCPollMenuPopUp
17020OTHERWISE:CASE FNEvent_Save(window%) OF
17030WHEN TRUE:PROCPollMouseSave
17040WHEN FALSE:PROCPollEventMouseClick
17050ENDCASE
17060ENDCASE
17070ENDPROC
17080:
17090DEFPROCPollMenuPopUp
17100menu%=FNEvent_Menu(window%)
17110CASE menu%  OF
17120WHEN FALSE
17130OTHERWISE
17140CASE window% OF
17150WHEN -2:n%=0
17160WHILE ((Bar_Menu%!(28+n%*24))AND%10000000)=0
17170n%+=1
17180ENDWHILE
17190SYS "Wimp_CreateMenu",,Bar_Menu%,x%-64,96+n%*44+44
17200OTHERWISE:SYS"Wimp_CreateMenu",,menu%,x%-64,y%+20
17210ENDCASE
17220ENDCASE
17230wsqtitle$=FNIconText(main_Window%,9)
17240ENDPROC
17250:
17260DEFPROCPollMouseSave
17270CASE icon% OF
17280WHEN 0:IF button% AND &50 THEN PROCPollDragBox(window%)
17290WHEN 2:IF button% AND 5 THEN  PROCPollSaveFile(window%)
17300ENDCASE
17310ENDPROC
17320:
17330DEFPROCPollEventMouseClick
17340SYS"Wimp_BorderIcon",,wimp%
17350PROCEvent_MouseClick(window%,icon%,button%,x%,y%)
17360wimp%!0=x%:wimp%!4=y%:wimp%!8=0
17370wimp%!12=window%:wimp%!16=icon%
17380SYS"Wimp_BorderIcon",,wimp%
17390ENDPROC
17400:
17410DEFPROCPollSaveFile(window%)
17420LOCALfile$
17430wimp%!0=window%:wimp%!4=1:SYS "Wimp_GetIconState",,wimp%
17440file$=$(wimp%!28)
17450CASE INSTR(file$,".") OF
17460WHEN 0
17470$(wimp%+4)="To save, drag the icon to a directory window"
17480SYS "Wimp_ReportError",wimp%,16,task$
17490OTHERWISE
17500PROCEvent_SaveFile(file$,window%)
17510ENDCASE
17520SYS"Wimp_CreateMenu",-1
17530ENDPROC
17540:
17550DEFPROCPollDragBox(window%)
17560LOCALx%,y%
17570save%=window%
17580!wimp%=window%
17590SYS"Wimp_GetWindowState",,wimp%
17600x%=wimp%!4-wimp%!20:y%=wimp%!16-wimp%!24
17610wimp%!4=0
17620SYS"Wimp_GetIconState",,wimp%
17630!wimp%=window%
17640wimp%!4=5
17650wimp%!8=x%+wimp%!8:wimp%!12=y%+wimp%!12
17660wimp%!16=x%+wimp%!16:wimp%!20=y%+wimp%!20
17670wimp%!24=0:wimp%!28=0
17680wimp%!32=&7FFFFFFF:wimp%!36=&7FFFFFFF
17690SYS"Wimp_DragBox",,wimp%
17700ENDPROC
17710:
17720DEFPROCPollKeyPress
17730window%=wimp%!0:icon%=wimp%!4:key%=wimp%!24
17740CASE FNEvent_Save(window%) OF
17750WHEN TRUE:PROCWimpPoll_SaveFile(window%)
17760WHEN FALSE:PROCEvent_KeyPress(window%,icon%,key%)
17770ENDCASE
17780ENDPROC
17790:
17800DEFPROCPollSaveMessage
17810LOCALfile$,window%,icon%,x%,y%
17820SYS"Wimp_GetPointerInfo",,wimp%
17830window%=wimp%!12:icon%=wimp%!16:x%=wimp%!0:y%=wimp%!4
17840wimp%!0=save%:wimp%!4=1:SYS "Wimp_GetIconState",,wimp%
17850file$=$(wimp%!28)
17860file$=FNGetFileFromPathname(file$)
17870wimp%!20=window%
17880wimp%!24=icon%
17890wimp%!28=x%:wimp%!32=y%
17900wimp%!36=length%
17910wimp%!0=64
17920wimp%!12=0
17930wimp%!16=1
17940wimp%!40=&FFF
17950$(wimp%+44)=file$
17960SYS"Wimp_SendMessage",17,wimp%,wimp%!20,wimp%!24
17970ENDPROC
17980:
17990DEFPROCPollMessages
18000LOCAL file$
18010file$=FNGetStringAtAddress(wimp%+44)
18020block%=wimp%!16:CASE block% OF
18030WHEN 0:finished%=TRUE
18040WHEN 1
18050!wimp%=(48+16) ANDNOT3:wimp%!12=wimp%!8:wimp%!16=2:wimp%!36=-1
18060temp$=file$:$(wimp%+44)="<Wimp$Scrap>"+CHR$0
18070SYS"Wimp_SendMessage",17,wimp%,wimp%!4
18080GOTO18200
18090WHEN 2
18100PROCEvent_SaveFile(file$,save%)
18110wimp%!12=wimp%!8:wimp%!16=3
18120SYS"Wimp_SendMessage",17,wimp%,wimp%!20,wimp%!24
18130IFINSTR(file$,"Wimp$Scrap")=0 PROCIconPutText(save%,1,file$)
18140WHEN 3
18150IFtemp$="" temp$=file$
18160type%=wimp%!40:PROCEvent_LoadFile(file$,type%)
18170OSCLI"REMOVE <Wimp$Scrap>"
18180temp$=""
18190WHEN &502:PROChelp
18200ENDCASE
18210ENDPROC
18220:
18230DEFPROChelp
18240window%=wimp%!32:icon%=wimp%!36
18250IFwindow%=-2 PROCsend("This is the WordSq icon.|MClick SELECT to create or edit a wordsquare.|MClick MENU to edit a wordsquare, solve a wordsquare, set your preferences or clear all words and grid from memory."):ENDPROC
18260IFwindow%=display_Window% PROCsend("This is the display window.|MThe positions of any highlighted words will be shown."):ENDPROC
18270IFwindow%=words_Window% AND icon%<>2 AND icon%<>3 PROCsend("This is the words window.|MIt shows a complete list of all the words in memory."):ENDPROC
18280SYS "Wimp_SendInformation",,wimp%
18290ENDPROC
18300:
18310DEFPROCsend(d$)
18320wimp%!12=wimp%!8:wimp%!16=&503:$(wimp%+20)=d$+CHR$0
18330!wimp%=(25+LENd$)ANDNOT3
18340SYS"Wimp_SendMessage",17,wimp%,wimp%!4
18350ENDPROC
18360:
18370DEF FNMenuCreateColours(title$)
18380LOCAL x$,men%,j%,i%
18390x$=title$+"\0\1\2\3\4\5\6\7\8\9\10\11\12\13\14\15"
18400men%=FNMenuCreate(x$)
18410FOR i%=0 TO 15
18420CASE TRUE OF
18430WHEN i%<4,i%=9,i%=12,i%=14,i%=15 : j%=7
18440OTHERWISE : j%=0
18450ENDCASE
18460men%?(39+i%*24)=i%*16+j%
18470PROCMenuCentre(men%,i%+1)
18480NEXT
18490=men%
18500:
18510DEF PROCMenuCentre(menu%,item%)
18520menu%!(36+(item%-1)*24)=menu%!(36+(item%-1)*24)OR(1<<3)
18530ENDPROC
18540:
18550DEFPROCresize(w%,a%,b%,c%,d%)
18560!wimp%=a%:wimp%!4=b%:wimp%!8=c%:wimp%!12=d%
18570SYS"Wimp_SetExtent",w%,wimp%
18580wimp%!0=display_Window%:wimp%!4=dispbox%:SYS"Wimp_DeleteIcon",,wimp%
18590wimp%!0=display_Window%:wimp%!4=22:wimp%!8=b%+24
18600wimp%!12=c%-24:wimp%!16=-36:wimp%!20=&17000101:wimp%!24=text%
18610wimp%!28=valid%:wimp%!32=12
18620SYS"Wimp_CreateIcon",,wimp% TO dispbox%
18630PROCWindowForceDraw(display_Window%)
18640IFdispwind% PROCBringToTop(display_Window%)
18650ENDPROC
18660:
18670DEFPROCww
18680a%=-240-(words%*36):b%=352
18690!wimp%=0:wimp%!4=a%:wimp%!8=b%:wimp%!12=0
18700SYS"Wimp_SetExtent",words_Window%,wimp%
18710wimp%!0=words_Window%:wimp%!4=wordsbox%:SYS"Wimp_DeleteIcon",,wimp%
18720wimp%!0=words_Window%:wimp%!4=22:wimp%!8=a%+24
18730wimp%!12=b%-24:wimp%!16=-36:wimp%!20=&17000101:wimp%!24=text%
18740wimp%!28=valid%:wimp%!32=12
18750SYS"Wimp_CreateIcon",,wimp% TO wordsbox%
18760PROCWindowForceDraw(words_Window%)
18770IFwordswind% PROCBringToTop(words_Window%)
18780ENDPROC

� >WordSq$Dir.!RunImage
-� WordSquare Creation and Solving program
� By Matthew Eglise
(�
21� Copyright held by Archimedes World magazine
<'� This program is NOT Public Domain
F�
P(� Version 3.12 - 26th September 1992
Z�
d)mem1%=9042:mem2%=17100:filetype%=&03C
n
�autoload
xș"Hourglass_On"
� �Start("WordSq",mem1%,mem2%)
�	�init
��Create_Windows
��Create_Menus
��loadprefs
��d$<>"" �LoadOwn(d$)
�ș"Hourglass_Off"
�� � �Error:�dH@
��
�	�poll
�� �new("quit")<>0
��CloseDown
��
:

��init
8� word$(168),len%(168),grid%(2400),show%(168),b$(60)
"5� selected%(168),start%(168),dir%(168),temp$(168)
,)� sx%(168),sy%(168),ex%(168),ey%(168)
6-� valid% 32:$valid%="b1,0,15,4,0,1,14,12"
@� text% 8:$text%=""
J<wordswind%=0:words%=0:grid%=0:selection%=0:ef%=0:high%=0
T=nofit%=0:dimx=0:dimy=0:maxh=0:a=0:needs%=0:gaps=25:len%=0
^Mwsqtitle$="":selectedword$="":saveformat$="text":solveformat$="":temp$=""
hBmainwind%=0:solvewind%=0:dispwind%=0:wsqx=0:wsqy=0:wsqwords%=0
r?wordssaved%=1:gridsaved%=1:flag%=0:show%=0:found%=0:done%=0
| startx%=0:starty%=0:dispx%=0
�dispbox%=0:wordsbox%=0
��
�:
���Create_Windows
��SpritesLoad
�&solve_Window%=�WindowLoad("solve")
�$info_Window%=�WindowLoad("info")
�.savewords_Window%=�WindowLoad("savewords")
�*display_Window%=�WindowLoad("display")
�&words_Window%=�WindowLoad("words")
�$main_Window%=�WindowLoad("main")
�*savewsq_Window%=�WindowLoad("savewsq")
�&prefs_Window%=�WindowLoad("prefs")
!Bar_Icon%=�IconBar("!WordSq")
1�I%=4�171:�IconPutText(words_Window%,I%,""):�
�ww
&�
0:
:ݤEvent_Save(window%)
DȎ window% �
N� savewords_Window% :=�
X� savewsq_Window% :=�
b	 :=�
l�
v:
���Create_Menus
�� prefs_Menu%(1)
�Fmenu$="WordSq\Info>info_Window%\Edit\Solve\Preferences\Clear\Quit"
� Bar_Menu%=�MenuCreate(menu$)
�0menu$ ="Solve\Info>info_Window%\Show Words\"
�menu$+="Quit"
�"solve_Menu%=�MenuCreate(menu$)
�6menu$ ="Display\Info>info_Window%\Show Words\Quit"
�$display_Menu%=�MenuCreate(menu$)
�Bmenu$ ="Words\Info>info_Window%\Save Words>savewords_Window%\"
�menu$+="Quit"
�"words_Menu%=�MenuCreate(menu$)
�"WlMenu%=�MenuCreate("Colours")
"SmMenu%=�MenuCreate("Colours")
!LMenu%=�MenuCreate("Colours")
"ClMenu%=�MenuCreate("Colours")
 Zmenu$="Colours\Words list>WlMenu%\Start mark>SmMenu%\Lines>LMenu%\Latest line>ClMenu%"
*%prefs_Menu%(1)=�MenuCreate(menu$)
4@menu$ ="Prefs\Info>info_Window%\Colours>prefs_Menu%(1)\Quit"
>"prefs_Menu%=�MenuCreate(menu$)
H1menu$ ="Create\Info>info_Window%\Show Words\"
Rcmenu$+="Save Words>savewords_Window%\Save Square>savewsq_Window%\Print Words\Print Square\Quit"
\!main_Menu%=�MenuCreate(menu$)
f2savewsq_Menu%=0:info_Menu%=0:savewords_Menu%=0
p�MenuDisable(main_Menu%,2)
z�MenuDisable(main_Menu%,3)
��MenuDisable(main_Menu%,4)
��MenuDisable(main_Menu%,5)
��MenuDisable(main_Menu%,6)
��MenuDisable(solve_Menu%,2)
�!�MenuDisable(display_Menu%,2)
��
�:
�ݤEvent_Menu(window%)
�Ȏ window% �
�� Bar_Window%:=Bar_Menu%
� � solve_Window%:=solve_Menu%
�$� display_Window%:=display_Menu%
� � words_Window%:=words_Menu%
� main_Window%:=main_Menu%
 � prefs_Window%:=prefs_Menu%
:=�
$�
.:
8)��Event_WindowClose(window%,buttons%)
BȎ window% �
L � solve_Window%:solvewind%=0
V� info_Window%
`� savewords_Window%
j!� display_Window%:dispwind%=0
tl� words_Window%:wordswind%=0:�MenuTick(main_Menu%,2):�MenuTick(solve_Menu%,2):�MenuTick(display_Menu%,2)
~� main_Window%:mainwind%=0
�� savewsq_Window%
�� prefs_Window%
��
��
�:
�-��Event_Draw(window%,x_origin%,y_origin%)
�Ȏ window% �
�(� savewsq_Window%:�DrawsavewsqWindow
�$� solve_Window%:�DrawsolveWindow
�"� info_Window%:�DrawinfoWindow
�,� savewords_Window%:�DrawsavewordsWindow
�$� prefs_Window%:�DrawprefsWindow
(� display_Window%:�DrawdisplayWindow

$� words_Window%:�DrawwordsWindow
"� main_Window%:�DrawmainWindow
�
(�
2:
<��DrawsavewsqWindow
F�
P:
Z��DrawsolveWindow
d�
n:
x��DrawinfoWindow
��
�:
���DrawsavewordsWindow
��
�:
���DrawprefsWindow
��
�:
���DrawwordsWindow
��
�:
���DrawmainWindow
��
:
��DrawdisplayWindow
e�startx%<>0 � starty%<>0 ș"Wimp_SetColour",mcol%:ȓ Ȑ x_origin%+startx%,y_origin%+starty%,22,32
"�I%=1�words%
,4�show%(I%)=0 � (start%(I%)=0 � dir%(I%)=0) �DJF
6@�I%=show% ș"Wimp_SetColour",lcol% � ș"Wimp_SetColour",col%
@M� x_origin%+sx%(I%),y_origin%-sy%(I%),x_origin%+ex%(I%),y_origin%-ey%(I%)
J�
Tdispx%=x_origin%-18
^�
h:
r3��Event_MouseClick(window%,icon%,button%,x%,y%)
|Ȏ window% �
�� Bar_Window%:�MouseBar
�.� solve_Window%:�Mousesolve(button%,icon%)
�,� info_Window%:�Mouseinfo(button%,icon%)
�2� display_Window%:�Mousedisplay(button%,icon%)
�.� prefs_Window%:�Mouseprefs(button%,icon%)
�.� words_Window%:�Mousewords(button%,icon%)
�,� main_Window%:�Mousemain(button%,icon%)
��
��
�:
���MouseBar
�)�BringToTop(main_Window%):mainwind%=1
��
:
��Mouseprefs(button%,icon%)
Ȏ icon% �
&.� 1:�saveprefs:�WindowClose(prefs_Window%)
0.� 11:�getprefs:�WindowClose(prefs_Window%)
:$� 12:�WindowClose(prefs_Window%)
D;�tempdbl%<>dbl% �SetIcon(prefs_Window%,3):tempdbl%=dbl%
N[�tempcaps%<>caps% �SetIcon(prefs_Window%,29):�SetIcon(prefs_Window%,30):tempcaps%=caps%
X_�tempforce%<>force% �SetIcon(prefs_Window%,45):�SetIcon(prefs_Window%,46):tempforce%=force%
b1�temptitlept%<>titlept% temptitlept%=titlept%
l-�tempgridpt%<>gridpt% tempgridpt%=gridpt%
v1�tempwordspt%<>wordspt% tempwordspt%=wordspt%
�!�tempcol%<>col% tempcol%=col%
�%�tempmcol%<>mcol% tempmcol%=mcol%
�%�tempwcol%<>wcol% tempwcol%=wcol%
�%�templcol%<>lcol% templcol%=lcol%
�
�setprefs
�.� 3:� tempdbl%=-1 tempdbl%=0 � tempdbl%=-1
�=� 29:�button%=1 � tempcaps%=-1 �SetIcon(prefs_Window%,29)
�tempcaps%=-1
�<� 30:�button%=1 � tempcaps%=0 �SetIcon(prefs_Window%,30)
�tempcaps%=0
�:� 31,33:temptitlept%=�bumppt(icon%-32,temptitlept%,32)
�8� 34,36:tempgridpt%=�bumppt(icon%-35,tempgridpt%,35)
�:� 37,39:tempwordspt%=�bumppt(icon%-38,tempwordspt%,38)
?� 45:� button%=1 � tempforce%=-1 �SetIcon(prefs_Window%,45)
tempforce%=-1
>� 46:� button%=1 � tempforce%=0 �SetIcon(prefs_Window%,45)
 tempforce%=0
*0:�Alert("WordSq","Invalid Templates file.")
4�
>�
H:
R��Mousesolve(button%,icon%)
\�button%<>1 � button%<>4 �
f��solveformat$="" �Alert("WordSq","No wordsquare is currently available - either create one or load a plain text wordsquare."):�
p@�icon%=9 � (selection%=0 � �IconText(solve_Window%,17)="") �
zȎ icon% �
�?� 8:�BringToTop(display_Window%):dispwind%=1:�removepressed
�=� 9:�BringToTop(display_Window%):dispwind%=1:�showpressed
�:� 11:�BringToTop(display_Window%):dispwind%=1:�showall
�� 10:�removeall
�0:�Alert("WordSq","Invalid Templates file.")
��
��
�:
�!��Mousedisplay(button%,icon%)
��button%<>4 � button%<>1 �
��icon%-1>wsqy �
�T!wimp%=display_Window%:ș "Wimp_GetWindowState",,wimp%:dispx%=wimp%!4-wimp%!20-2
�{�button%=4 startpos%=0:startx%=0:starty%=0:endpos%=0 � �button%=1 � startpos%=0 button%=4:startx%=0:starty%=0:endpos%=0
	,icon%-=1:i%=((24+((x%-dispx%)/16))/2)-12
	�i%>wsqx �
	p%=((icon%-1)*wsqx)+i%
	$Ȏ button% �
	.� 4:startpos%=p%
	87startx%=22+((i%-1)*32)-8:starty%=-84-((icon%-1)*44)
	B� 1:endpos%=p%
	LDd$=�getword(startpos%,endpos%):�IconPutText(solve_Window%,17,d$)
	V)�startpos%<>endpos% � o%=1 � d$<>"" �
	`�caret((�d$/2)+1000)
	j&ex%=�exists(d$):p%=�palindrome(d$)
	t^�ex%=0 �Alert("WordSq","The word '"+d$+"' does not exist in the current word list."):�t\I
	~��ex%>0 � startpos%<>0 � endpos%<>0 � startpos%<>start%(ex%) � p%=0 �Alert("WordSq","Although the word "+d$+" does exist in the current wordsquare, it is not at this position."):�t\I
	�[�ex%>0 � startpos%<>0 � endpos%<>0 � startpos%<>start%(ex%) � p%=1 Ȕ startpos%,endpos%
	�b�ex%>0:�show%(ex%)=0 high%+=1:show%(ex%)=2:�sic(words_Window%,ex%+3,wcol%):show%=ex%:found%+=1
	�-startx%=0:starty%=0:startpos%=0:endpos%=0
	��
	��
	�%�WindowForceDraw(display_Window%)
	��updatesolvestate
	��solveformat$<>"own" �
	�k�found%=wsqwords% � done%=0 �wsqwords%=1 �Alert("WordSq","Well Done, you've found the word."):done%=1:�
	��high%=wsqwords% � found%<wsqwords% � done%=0 � wsqwords%=1 � found%>0 �Alert("WordSq","Although you have found the word, you had to seek help with it."):done%=1:�
	�|�found%=wsqwords% � done%=0 �Alert("WordSq","Well Done, you've found all "+�oneormore(wsqwords%)+"in the grid."):done%=1
	���high%=wsqwords% � found%<wsqwords% � done%=0 � found%>0 �Alert("WordSq","Although you have found all "+�oneormore(wsqwords%)+"in the grid, you had to seek help with "+�(wsqwords%-found%)+" of them."):done%=1
�

:
��showpressed
8�solveformat$="" �IconPutText(solve_Window%,17,""):�
(4gibbet$=�IconText(solve_Window%,17):need%=0:F%=0
2ex%=�exists(gibbet$)
<h�caps%=-1 �IconPutText(main_Window%,26,�caps(gibbet$)):�IconPutText(solve_Window%,17,�caps(gibbet$))
F)�len(gibbet$)<3 � selection%=0 �TNK
Po�selection%=0 � solveformat$="text" � ex%=0 �find(�caps(gibbet$)):�IconPutText(main_Window%,20,�gaps):�TDK
Z(�selection%=0 � solveformat$="own" �
dc�ex%=0 �Alert("WordSq","The word '"+gibbet$+"' does not exist in the current word list."):�tBJ
n��ex%>0 � startpos%<>0 � endpos%<>0 � startpos%<>start%(ex%) �Alert("WordSq","Although the word "+gibbet$+" does exist in the current wordsquare, it is not at this position."):�tBJ
x`�ex%>0 need%=1:�show%(ex%)=0 high%+=1:show%(ex%)=1:�sic(words_Window%,ex%+3,wcol%):show%=ex%
��
�-�selection%=0 � solveformat$="own" � �TNK
��selection%>0 �
��o%=0:�I%=1�words%:�selected%(I%)=1 � start%(I%)=0 � dir%(I%)=0 o%+=1 � �selected%(I%)=1 � show%(I%)=0 high%+=1:show%(I%)=1:need%=1:�sic(words_Window%,I%+3,wcol%)
��
��selection%>1 show%=0
��o%>0 �
�!�o%=1 o$=" does " � o$=" do "
�f�o%=1 � selection%=1 d$="This word does ":� d$=�oneormore(o%)+"amongst the selection"+o$:o$="they"
��o%=1 o$="it"
�[�Alert("WordSq",d$+"not appear in the current wordsquare so "+o$+" will not be shown.")
��
��
o%=selection%
Z�clearall:�IconPutText(main_Window%,26,""):�IconPutText(solve_Window%,17,""):�caret(0)
��words%=1:�MenuEnable(main_Menu%,2):�MenuEnable(main_Menu%,3):�MenuEnable(main_Menu%,5):�MenuEnable(solve_Menu%,2):�MenuEnable(words_Menu%,2):�MenuEnable(display_Menu%,2)
"�words%=0 done%=0
,startx%=0:starty%=0
6%�WindowForceDraw(display_Window%)
@D�updatesolvestate:�solveformat$<>"own" �o%>=wsqwords% �done%=1 �
J��high%=wsqwords% � found%<wsqwords% �wsqwords%=1 �Alert("WordSq","Although you found the word, you had to seek help with it."):done%=1:�
T��high%=wsqwords% � found%<wsqwords% � found%>0 �Alert("WordSq","Although you have found all "+�oneormore(wsqwords%)+"in the grid, you had to seek help with "+�(wsqwords%-found%)+" of them."):done%=1
^�
h:
r��removepressed
|B�solveformat$="" �IconPutText(solve_Window%,17,""):�caret(0):�
��selection%=0 �
�need%=0:�I%=1�words%
�,�show%(I%)=2 � selected%(I%)=1 found%-=1
�l�selected%(I%)=1 � show%(I%)>0 high%-=1:show%(I%)=0:need%=1:�sic(words_Window%,I%+3,7):�I%=show% show%=0
��
�done%=0
�Z�clearall:�IconPutText(main_Window%,26,""):�IconPutText(solve_Window%,17,""):�caret(0)
�,�need% �WindowForceDraw(display_Window%)
��updatesolvestate
��
�:
���Mouseinfo(button%,icon%)
��
:
��Mousewords(button%,icon%)
 �icon%>3 � icon%<=words%+3 �
&Ȏ button% �
0� 4:
:N�I%=1�words%:�selected%(I%)=1 �SetIcon(words_Window%,I%+3):selected%(I%)=0
Dm�:�SetIcon(words_Window%,icon%):selected%(icon%-3)=1:selection%=1:selectedword$=word$(icon%-3):�setbutton
N� 1:
X!�SetIcon(words_Window%,icon%)
bl�selected%(icon%-3)=0 selected%(icon%-3)=1:selection%+=1:� selected%(icon%-3)=0:selection%-=1:�setbutton
l�selection%<>1 �t@L
v>�I%=1�words%:�selected%(I%)=1 selectedword$=word$(I%):�:��
��
�Ȏ selection% �
�[� 0:�IconPutText(main_Window%,26,""):�IconPutText(solve_Window%,17,""):selectedword$=""
�`� 1:�IconPutText(main_Window%,26,selectedword$):�IconPutText(solve_Window%,17,selectedword$)
�Y:�IconPutText(main_Window%,26,""):�IconPutText(solve_Window%,17,""):selectedword$=""
��
��
�� icon%=2 �selectall
�� icon%=3 �clearall
��updatesolvestate
��caret(�selectedword$/2)
��setbutton
��

:

��Mousemain(button%,icon%)

� button%<>1 � button%<>4 �

 /�icon%=24 � �IconText(main_Window%,26)="" �

*Ȏ icon% �

4� 24:�addword

>� 25:�deleteword

H� 28:�amendword

R� 29:�create

\� 11,13:�bumpx(icon%-12)

f� 15,17:�bumpy(-(icon%-16))

p"� 19,21:�bumpgaps(-(icon%-20))

zB� 30:�button%=1 � saveformat$="text" �SetIcon(main_Window%,30)

�Fsaveformat$="text":d%=�IconPutSprite(savewsq_Window%,0,"file_fff")

�B� 32:�button%=1 � saveformat$="draw" �SetIcon(main_Window%,32)

�Fsaveformat$="draw":d%=�IconPutSprite(savewsq_Window%,0,"file_fff")

�A� 33:�button%=1 � saveformat$="own" �SetIcon(main_Window%,33)

�Esaveformat$="own":d%=�IconPutSprite(savewsq_Window%,0,"file_03c")

�A� 34:�button%=1 � saveformat$="imp" �SetIcon(main_Window%,34)

�Esaveformat$="imp":d%=�IconPutSprite(savewsq_Window%,0,"file_fff")

�0:�Alert("WordSq","Invalid Templates file.")

��

��

�:

���selectall

�R�I%=4�words%+3:�selected%(I%-3)=0 �SetIcon(words_Window%,I%):selected%(I%-3)=1
"�:selection%=words%:�setbutton
�
:
$��clearall
.R�I%=4�words%+3:�selected%(I%-3)=1 �SetIcon(words_Window%,I%):selected%(I%-3)=0
8�:selection%=0:�setbutton
B�
L:
V
��showall
`X�I%=1�words%:�start%(I%)<>0 � dir%(I%)<>0 show%(I%)=1:�sic(words_Window%,I%+3,wcol%)
j'�:�WindowForceDraw(display_Window%)
t5high%=wsqwords%:done%=1:show%=0:�updatesolvestate
~�
�:
���removeall
�I�I%=1�words%:show%(I%)=0:�sic(words_Window%,I%+3,7):�I%=show% show%=0
��
�%�WindowForceDraw(display_Window%)
�.high%=0:found%=0:done%=0:�updatesolvestate
��
�:
�(��Event_KeyPress(window%,icon%,key%)
�Ȏ window% �
�.� solve_Window%:�KeyPresssolve(icon%,key%)
�� info_Window%
� display_Window%

� words_Window%
,� main_Window%:�KeyPressmain(icon%,key%)
.� prefs_Window%:�KeyPressprefs(icon%,key%)
(�
2.key%=0:wsqtitle$=�IconText(main_Window%,9)
<�
F:
P��KeyPresssolve(icon%,key%)
Z&�key%<>13 ș"Wimp_ProcessKey",key%
dX�key%=13 � icon%=17 � (selection%<>0 � �IconText(solve_Window%,17)<>"") �showpressed
n3�key%=13 � icon%=17 � solveformat$="" �caret(0)
x�
�:
���KeyPressmain(icon%,key%)
�d%=icon%
�@�key%=399 � icon%=26 icon%=9 � � key%=398 � icon%=9 icon%=26
�S�d%<>icon% �IconCaret(main_Window%,icon%,�(��IconText(main_Window%,icon%)/2)):�
�Z�key%=13 � icon%=26 � �IconText(main_Window%,26)<>"" � solveformat$<>"text" �addword:�
�ș"Wimp_ProcessKey",key%
��
�:
���KeyPressprefs(icon%,key%)
�d%=icon%
�
Ȏ key% �
�	� 399
��icon%=24 � icon%=25 � icon%=26 � icon%=27 icon%-=1 � � icon%=23 icon%=17 � � icon%=41 icon%=27 � � icon%=43 icon%=41 � � icon%=9 icon%=7 � � icon%=13 icon%=9 � � icon%=17 icon%=13
	� 398
��icon%=23 � icon%=24 � icon%=25 � icon%=26 icon%+=1 � � icon%=41 icon%=43 � � icon%=27 icon%=41 � � icon%=17 icon%=23 � � icon%=7 icon%=9 � � icon%=9 icon%=13 � � icon%=13 icon%=17
" ș"Wimp_ProcessKey",key%
,�
6S�icon%<>d% �IconCaret(prefs_Window%,icon%,�(��IconText(prefs_Window%,icon%)/2))
@�
J:
T��Event_MenuChoice(menu%)
^Ȏ menu% �
h� Bar_Menu%:�MenuChoiceBar
r� savewsq_Menu%
|"� solve_Menu%:�MenuChoicesolve
�� info_Menu%
�� savewords_Menu%
�"� prefs_Menu%:�MenuChoiceprefs
�&� display_Menu%:�MenuChoicedisplay
�"� words_Menu%:�MenuChoicewords
� � main_Menu%:�MenuChoicemain
��
��
�:
���MenuChoiceBar
�Ȏ �MenuChoice(0) �
�� 1
�-� 2:�BringToTop(main_Window%):mainwind%=1
B� 3:�solveformat$<>"" �BringToTop(display_Window%):dispwind%=1
+�BringToTop(solve_Window%):solvewind%=1
"� 4:�BringToTop(prefs_Window%)
&� 5:
0)�new("clear all variables")=1 �reset
:� 6:finished%=�
D�
N�
X:
b��MenuChoiceprefs
lȎ �MenuChoice(0) �
v� 1
�� 2:Ȏ �MenuChoice(1) �
�5� 1:�MenuChoice(2)<>0 tempwcol%=�MenuChoice(2)-1
�5� 2:�MenuChoice(2)<>0 tempmcol%=�MenuChoice(2)-1
�4� 3:�MenuChoice(2)<>0 tempcol%=�MenuChoice(2)-1
�5� 4:�MenuChoice(2)<>0 templcol%=�MenuChoice(2)-1
��
�� 3:finished%=�
��
�D�sib(prefs_Window%,50,tempcol%):�sib(prefs_Window%,51,tempmcol%)
�E�sib(prefs_Window%,53,tempwcol%):�sib(prefs_Window%,54,templcol%)
��
�:
���MenuChoicesolve
Ȏ �MenuChoice(0) �
� 1
}� 2:�MenuTick(solve_Menu%,2):�MenuTick(main_Menu%,2):�MenuTick(display_Menu%,2):�wordswind%=0 wordswind%=1 � wordswind%=0
 � 3:finished%=�
*�
4K� wordswind%=1 �BringToTop(words_Window%) � �WindowClose(words_Window%)
>�
H:
R��MenuChoicedisplay
\Ȏ �MenuChoice(0) �
f� 1
p}� 2:�MenuTick(solve_Menu%,2):�MenuTick(main_Menu%,2):�MenuTick(display_Menu%,2):�wordswind%=0 wordswind%=1 � wordswind%=0
z� 3:finished%=�
��
�K� wordswind%=1 �BringToTop(words_Window%) � �WindowClose(words_Window%)
��
�:
���MenuChoicewords
�Ȏ �MenuChoice(0) �
�� 1
�� 2
�� 3:finished%=�
��
��
�:
���MenuChoicemain
Ȏ �MenuChoice(0) �
� 1
�� 2:�MenuTick(main_Menu%,2):�MenuTick(solve_Menu%,2):�MenuTick(display_Menu%,2):�wordswind%=0 wordswind%=1:�BringToTop(words_Window%) � wordswind%=0:�WindowClose(words_Window%)
$� 3
.� 4
8]� 5:old$=saveformat$:saveformat$="print":�2:�pre:�savewords(""):�post:�3:saveformat$=old$
BZ� 6:old$=saveformat$:saveformat$="print":�2:�pre:�savesquare:�post:�3:saveformat$=old$
L� 7:finished%=�
V�
`�
j:
t!��Event_LoadFile(file$,type%)
~ș"Hourglass_On"
�Ȏ type% �
�>� &FFF:�new("load a new file")=1 �reset:�LoadWords(file$)
�R� filetype%:�new("load a new set of words and grid")=1 �reset:�LoadOwn(file$)
��
�ș"Hourglass_Off"
��
�:
���LoadWords(file$)
�file=�file$
�dummy$=�caps(�#file)
�]�dummy$,"ORD") � �dummy$,"UARE"):dimx=��#file:words%=0:solveformat$="text":�loadsquare:�
��#file:file=�file$
words%=1:�

dummy$=�#file
�len(dummy$)>2 �
>word$(words%)=�dummy$,18):len%(words%)=�len(word$(words%))
(-�caps% word$(words%)=�caps(word$(words%))
2
words%+=1
<�
F��#file �words%=169
Pwords%-=1:needs%=Ǝlen%()
Z
�#file
d�words%=0 �
n�sort(1)
x9�MenuDisable(main_Menu%,4):�MenuDisable(main_Menu%,6)
��rec(2)
��afterload
�!�WindowClose(display_Window%)
�C�file$,"Wimp$Scrap")=0 �IconPutText(savewords_Window%,1,file$)
��
�:
���afterload
ȉ�MenuEnable(main_Menu%,2):�MenuEnable(main_Menu%,3):�MenuEnable(main_Menu%,5):�MenuEnable(solve_Menu%,2):�MenuEnable(display_Menu%,2)
�:�I%=1�168:�IconPutText(words_Window%,I%+3,word$(I%)):�
�Swordstatus$=�(words%)+" words loaded.":�IconPutText(main_Window%,5,wordstatus$)
�<�IconPutText(main_Window%,9,�GetFileFromPathname(temp$))
�high%=0:�updatesolvestate
�>�I%=1�168:�words%<I% �IconPutText(words_Window%,I%+3,""):�
�ww
8�BringToTop(main_Window%):�BringToTop(words_Window%)
]�wordswind%=0 �MenuTick(main_Menu%,2):�MenuTick(solve_Menu%,2):�MenuTick(display_Menu%,2)
"'wordswind%=1:mainwind%=1:len%=�long
,�MenuEnable(words_Menu%,2)
6o�IconPutText(main_Window%,12,�dimx):�IconPutText(main_Window%,16,�dimy):�IconPutText(main_Window%,20,�gaps)
@�
J:
T��LoadOwn(file$)
^file=�file$
h;wsqtitle$=�#file:gaps=��#file:dimx=��#file:dimy=��#file
rwords%=��#file
|�I%=1�words%
�%word$(I%)=�#file:len%(I%)=��#file
�'start%(I%)=��#file:dir%(I%)=��#file
�show%(I%)=��#file
�#sx%(I%)=��#file:sy%(I%)=��#file
�#ex%(I%)=��#file:ey%(I%)=��#file
��
��I%=1�dimx*dimy
�grid%(I%)=�#file
��
�
�#file
�solveformat$="own"
��afterload
�*�IconPutText(main_Window%,9,wsqtitle$)
7�MenuEnable(main_Menu%,4):�MenuEnable(main_Menu%,6)
P�IconPutText(main_Window%,6,�oneormore(words%)+"placed - "+�gaps+"% gaps. ")
A�file$,"Wimp$Scrap")=0 �IconPutText(savewsq_Window%,1,file$)
&S�display:�IconPutText(solve_Window%,5,"Using wordsquare from creator program.")
08wsqx=dimx:wsqy=dimy:wsqwords%=words%:needs%=Ǝlen%()
:E�I%=1�words%:�show%(I%)>0 high%+=1:�sic(words_Window%,I%+3,wcol%)
D�
N�updatesolvestate
X�
b:
l��loadsquare
v �#file:file=�file$:d$=�#file
�dimy=0:d%=0:�:d$=�#file
�:�d$>0 dimy+=1:�I%=1�dimx:d%+=1:grid%(d%)=��d$,I%,1):�
���#file
�wsqx=dimx:wsqy=dimy
�
�#file
�2�:�I%=1�10:�d%:�IconDisable(main_Window%,d%):�
�Jwordstatus$="No words found.":�IconPutText(main_Window%,5,wordstatus$)
�*�I%=4�6�2:�MenuEnable(main_Menu%,I%):�
�high%=0
�p�BringToTop(solve_Window%):�BringToTop(display_Window%):�WindowClose(words_Window%):wordswind%=0:dispwind%=1
�|solvewind%=1:�IconPutText(main_Window%,12,�dimx):�IconPutText(main_Window%,16,�dimy):�IconPutText(main_Window%,20,"100")
�i�display:�IconPutText(solve_Window%,5,"Using textfile wordsquare '"+�GetFileFromPathname(temp$)+"'.")
�_�IconPutText(main_Window%,6,"Using textfile wordsquare '"+�GetFileFromPathname(temp$)+"'.")
3�IconPutText(solve_Window%,6,"No words found.")
A�file$,"Wimp$Scrap")=0 �IconPutText(savewsq_Window%,1,file$)
�
 :
*��loadprefs
4file=�"<WordSq$Dir>.Prefs"
>-dbl%=��#file:force%=��#file:caps%=��#file
H/� dbl%=0 for spacing off, -1 for spacing on
R2� caps%=0 for preserve case, -1 for capitalise
\B� force%=0 for force single column, -1 for automatic selection
fcol%=��#file:mcol%=��#file
pwcol%=��#file:lcol%=��#file
z&titlefont$=�#file:titlept%=��#file
�$gridfont$=�#file:gridpt%=��#file
�&wordsfont$=�#file:wordspt%=��#file
�pre$=�#file:post$=�#file
�"overon$=�#file:overoff$=�#file
�$underon$=�#file:underoff$=�#file
�"emphon$=�#file:emphoff$=�#file
�
�#file
�3tempdbl%=dbl%:tempcaps%=caps%:tempforce%=force%
�Atempcol%=col%:tempwcol%=wcol%:templcol%=lcol%:tempmcol%=mcol%
�Ctemptitlept%=titlept%:tempgridpt%=gridpt%:tempwordspt%=wordspt%
�
�setprefs
�%�dbl%=0 �SetIcon(prefs_Window%,3)
�C�caps%=-1 �SetIcon(prefs_Window%,29):�SetIcon(prefs_Window%,30)
C�force%=0 �SetIcon(prefs_Window%,45):�SetIcon(prefs_Window%,46)
<�sib(prefs_Window%,50,col%):�sib(prefs_Window%,51,mcol%)
=�sib(prefs_Window%,53,wcol%):�sib(prefs_Window%,54,lcol%)
$�
.:
8:
B��setprefs
L[�IconPutText(prefs_Window%,7,titlefont$):�IconPutText(prefs_Window%,32,�titlept%+" pt")
VY�IconPutText(prefs_Window%,9,gridfont$):�IconPutText(prefs_Window%,35,�gridpt%+" pt")
`\�IconPutText(prefs_Window%,13,wordsfont$):�IconPutText(prefs_Window%,38,�wordspt%+" pt")
j��IconPutText(prefs_Window%,17,pre$):�IconPutText(prefs_Window%,23,post$):�IconPutText(prefs_Window%,24,overon$):�IconPutText(prefs_Window%,25,overoff$)
t��IconPutText(prefs_Window%,26,underon$):�IconPutText(prefs_Window%,27,underoff$):�IconPutText(prefs_Window%,41,emphon$):�IconPutText(prefs_Window%,43,emphoff$)
~<�sib(prefs_Window%,50,col%):�sib(prefs_Window%,51,mcol%)
�=�sib(prefs_Window%,53,wcol%):�sib(prefs_Window%,54,lcol%)
�9�I%=1�168:�show%(I%)>0 �sic(words_Window%,I%+3,wcol%)
��
�%�WindowForceDraw(display_Window%)
��
�:
���getprefs
�3dbl%=tempdbl%:caps%=tempcaps%:force%=tempforce%
�Acol%=tempcol%:mcol%=tempmcol%:wcol%=tempwcol%:lcol%=templcol%
�Otitlefont$=�IconText(prefs_Window%,7):titlept%=��IconText(prefs_Window%,32)
�Mgridfont$=�IconText(prefs_Window%,9):gridpt%=��IconText(prefs_Window%,35)
�Pwordsfont$=�IconText(prefs_Window%,13):wordspt%=��IconText(prefs_Window%,38)
Fpre$=�IconText(prefs_Window%,17):post$=�IconText(prefs_Window%,23)

Loveron$=�IconText(prefs_Window%,24):overoff$=�IconText(prefs_Window%,25)
Nunderon$=�IconText(prefs_Window%,26):underoff$=�IconText(prefs_Window%,27)
Lemphon$=�IconText(prefs_Window%,41):emphoff$=�IconText(prefs_Window%,43)
(9�I%=1�168:�show%(I%)>0 �sic(words_Window%,I%+3,wcol%)
2�
<%�WindowForceDraw(display_Window%)
F�
P:
Z#��Event_SaveFile(file$,window%)
dȎ window% �
n!� savewsq_Window%:�savesquare
x� solve_Window%
�� info_Window%
�� prefs_Window%
�)� savewords_Window%:�savewords(file$)
�� display_Window%
�� words_Window%
�� main_Window%
��
��MenuClose
��
�:
���savewords(file$)
�%�saveformat$<>"print" file=�file$
�$�I%=1�words%:�put(word$(I%),0):�
H�saveformat$<>"print" �#file:�"SETTYPE "+file$+" Text":wordssaved%=1
�
:
"��saveown(file$)
,1Ȕ dimx,wsqx:Ȕ dimy,wsqy:Ȕ words%,wsqwords%
6file=�file$
@;�#file,wsqtitle$:�#file,�gaps:�#file,�dimx:�#file,�dimy
J�#file,�words%
T�I%=1�words%
^%�#file,word$(I%):�#file,�len%(I%)
h'�#file,�start%(I%):�#file,�dir%(I%)
r�#file,�show%(I%)
|#�#file,�sx%(I%):�#file,�sy%(I%)
�#�#file,�ex%(I%):�#file,�ey%(I%)
��
��I%=1�dimx*dimy
��#file,grid%(I%)
��
�
�#file
��"SETTYPE "+file$+" 03C"
�1Ȕ dimx,wsqx:Ȕ dimy,wsqy:Ȕ words%,wsqwords%
�gridsaved%=1:wordssaved%=1
��
�:
���savesquare
�(�saveformat$="own" �saveown(file$):�

�copyover
1Ȕ dimx,wsqx:Ȕ dimy,wsqy:Ȕ words%,wsqwords%
,�saveformat$="draw" pad$=�160 � pad$=" "
&<len%=�long:b$()="":dummy%=0:�dbl%=-1 d%=dimx*2 � d%=dimx
0#�I%=1�dimy:�J%=1�dimx:dummy%+=1
:=b$(I%)+=�(grid%(dummy%)):�dbl%=-1 � J%<>dimx b$(I%)+=pad$
D�:�
N'dimx+=-(dbl%*dimx):�dbl%=-1 dimx-=1
X%�force%=0 � words%<=60 c%=1:�tJ[
b.�(words%>(4*dimy) � words%>120) c%=4:�tJ[
l2�saveformat$="draw" � dimx<(len%*2) c%=1:�tJ[
v-�words%>(1.3*dimy) � words%>60 c%=2:�tJ[
�c%=1
��saveformat$="imp" �tabs
�-�saveformat$<>"print" file=�file$:�header
�8�saveformat$<>"print" �#file,wsqtitle$:� �printtitle
�Ȏ c% �
�� 1:�format1
�� 2:�format2
�� 4:�format3
��
�[�dbl%=-1 � dimx/2=�(dimx/2) dimx=dimx/2:� �dbl%=-1 � dimx/2<>�(dimx/2) dimx=�(dimx/2)+1
�1Ȕ dimx,wsqx:Ȕ dimy,wsqy:Ȕ words%,wsqwords%
�
�copyback
�I�saveformat$<>"print" �#file,�10:�#file:�"SETTYPE "+file$+" Text" � �
gridsaved%=1:wordssaved%=1
�
:
 ��saveprefs
*
�getprefs
4file=�"<WordSq$Dir>.Prefs"
>-�#file,�dbl%:�#file,�force%:�#file,�caps%
H�#file,�col%:�#file,�mcol%
R�#file,�wcol%:�#file,�lcol%
\&�#file,titlefont$:�#file,�titlept%
f$�#file,gridfont$:�#file,�gridpt%
p&�#file,wordsfont$:�#file,�wordspt%
z�#file,pre$:�#file,post$
�"�#file,overon$:�#file,overoff$
�$�#file,underon$:�#file,underoff$
�"�#file,emphon$:�#file,emphoff$
�
�#file
��
�:
���SetIcon(w%,i%)
�4wimp%!0=w%:wimp%!4=i%:wimp%!8=&200000:wimp%!12=0
�!ș "Wimp_SetIconState",,wimp%
��
�:
���rec(type%)
��words%<1 dimx=0:dimy=0:�
�type%=2 gaps=25
needs%=Ǝlen%()
Ia=(1/(1-(gaps/100)))*needs%:dimy=�round(�(a/1.2)):dimx=�round(a/dimy)
$7� words%<=120 maxh=60 � maxh=�(59-((words%-120)/2))
.len%=�long
8�len%>�max �drec:�
B8�dimy<3 dimy=3 � � dimx>40 dimx=40:dimy=�round(a/40)
L�maxh<dimy dimy=maxh
V��gaps<10 � (dimx<len% � dimy<len%) �Alert("WordSq","All of these words will not fit into the largest size grid - you must delete a few, or shorten some of the longer ones.")
`�type%=2 gaps=�gaps
j�gaps<0 gaps=0
t'�IconPutText(main_Window%,20,�gaps)
~�
�:
�
��drec
�AI%=0:�:I%+=1:�I%*len%>a*0.95:dimx=len%:dimy=I%:�dimy<3 dimy=3
�;�type%=2 gaps=�gaps:�IconPutText(main_Window%,20,�gaps)
��
�:
�ݤlen(dummy$)
�TJ%=�dummy$:�I%=1��dummy$:C=�(�dummy$,I%,1)):� C<65 � C>122 � (C>90 � C<97) J%-=1
�	�:=J%
�:
�
ݤlong
�/D=0:�I%=1�words%:�word$(I%)>D D=�word$(I%)
�:=D

:
	ݤmax
�dimx>dimy =dimx � =dimy
(:
2ݤround(num)=�(num+0.5)
<:
F
��addword
P|w$=�IconText(main_Window%,26):�len(w$)<3 �Alert("WordSq","Words must be three alphabetical characters long or more."):�
Zș"Hourglass_On"
d��words%=0 �MenuEnable(main_Menu%,2):�MenuEnable(main_Menu%,3):�MenuEnable(main_Menu%,5):�MenuEnable(solve_Menu%,2):�MenuEnable(display_Menu%,2)
nwords%+=1:word$(words%)=w$
x
�clearall
�?�updatesolvestate:�caps% word$(words%)=�caps(word$(words%))
�$len%(words%)=�len(word$(words%))
��sort(1)
�=�I%=1�words%:�IconPutText(words_Window%,I%+3,word$(I%)):�
��ww
�S�rec(2):�IconPutText(main_Window%,12,�dimx):�IconPutText(main_Window%,16,�dimy)
���words%=1 �MenuEnable(words_Menu%,2):�wordswind%=0 wordswind%=1:�BringToTop(words_Window%):�MenuTick(solve_Menu%,2):�MenuTick(main_Menu%,2):�MenuTick(display_Menu%,2)
�P�IconPutText(main_Window%,26,""):�IconPutText(solve_Window%,17,""):�caret(0)
�wordssaved%=0
�ș"Hourglass_Off"
��
�:
���deleteword
�selection%=0 �
�solveformat$<>"own" �DT_
`o%=-1:number%=0:�I%=1�words%:�selected%(I%)=1 � start%(I%)<>0 � dir%(I%)<>0 number%+=1:�:� �
"�number%>0 �
,^�selection%=1 d$="This word forms " � d$=�oneormore(number%)+"amongst the selection form "
6�o%=�WindowCancel("WordSq",d$+"part of the current wordsquare. Continuing with this operation will cause the wordsquare to be deleted. Click OK to delete.")
@�
JB�o%=0 � � �o%=-1 � number%>0 �WindowClose(display_Window%):�ng
Tș"Hourglass_On"
^�number%=0:�I%=1�words%:�selected%(I%)=1 word$(I%)="~~":number%+=1:�SetIcon(words_Window%,I%+3):selected%(I%)=0:�show%(I%)>0 show%(I%)=0:high%-=1
h�:selection%=0:�setbutton
r�sort(1):�rep(0)
|=�I%=1�words%:�IconPutText(words_Window%,I%+3,word$(I%)):�
�;words%-=number%:�solveformat$="text" wsqwords%-=number%
�%�updatesolvestate:needs%=Ǝlen%()
��words%=0 �
���MenuDisable(main_Menu%,3):�MenuDisable(main_Menu%,2):�MenuDisable(solve_Menu%,2):�MenuDisable(main_Menu%,5):�MenuDisable(display_Menu%,2):�WindowClose(words_Window%)
�O�MenuTick(main_Menu%,2):�MenuTick(solve_Menu%,2):�MenuTick(display_Menu%,2)
�wordswind%=0:wordssaved%=1
��
��words%>0 wordssaved%=0
�P�IconPutText(main_Window%,26,""):�IconPutText(solve_Window%,17,""):�caret(0)
�6�ww:�dispwind%=1 �WindowForceDraw(display_Window%)
�[�solveformat$="text" gaps=�gaps:�IconPutText(main_Window%,20,�gaps):ș"Hourglass_Off":�
�/gaps=25:�IconPutText(main_Window%,20,�gaps)
�S�rec(2):�IconPutText(main_Window%,12,�dimx):�IconPutText(main_Window%,16,�dimy)
 ș"Hourglass_Off"
 �
 :
 &��amendword
 0�selection%<>1 �
 :|w$=�IconText(main_Window%,26):�len(w$)<3 �Alert("WordSq","Words must be three alphabetical characters long or more."):�
 D�solveformat$="" �tJ`
 N`o%=-1:number%=0:�I%=1�words%:�selected%(I%)=1 � start%(I%)<>0 � dir%(I%)<>0 number%+=1:�:� �
 X�number%>0 �
 b^�selection%=1 d$="This word forms " � d$=�oneormore(number%)+"amongst the selection form "
 l�o%=�WindowCancel("WordSq",d$+"part of the current wordsquare. Continuing with this operation will cause the wordsquare to be deleted. Click OK to amend.")
 v�
 �B�o%=0 � � �o%=-1 � number%>0 �WindowClose(display_Window%):�ng
 �ș"Hourglass_On"
 �+�I%=1�words%:�selected%(I%)=1 dummy%=I%
 �O�:word$(dummy%)=�IconText(main_Window%,26):len%(dummy%)=�len(word$(dummy%))
 �P�IconPutText(main_Window%,26,""):�IconPutText(solve_Window%,17,""):�caret(0)
 �$�SetIcon(words_Window%,dummy%+3)
 �F�sort(1):�I%=1�words%:�IconPutText(words_Window%,I%+3,word$(I%)):�
 ��ww
 �/selected%(dummy%)=0:selection%=0:�setbutton
 ��updatesolvestate
 �S�rec(2):�IconPutText(main_Window%,12,�dimx):�IconPutText(main_Window%,16,�dimy)
 �wordssaved%=0
 �ș"Hourglass_Off"
!�
!:
!��sort(type%)
!  �type%=2 type%=1:r%=1 � r%=0
!*P%=words%�2:�P%=0�
!4�:R%=words%-P%:Q%=1
!>�:W%=Q%
!H�:U%=W%+P%
!R,�type%=1�word$(W%)<=word$(U%)ef%=1:�tDa
!\*�type%=0�len%(W%)>=len%(U%)ef%=1:�tDa
!fȔword$(W%),word$(U%)
!p��r%=0 Ȕlen%(W%),len%(U%):Ȕstart%(W%),start%(U%):Ȕdir%(W%),dir%(U%):Ȕshow%(W%),show%(U%):Ȕsx%(W%),sx%(U%):Ȕsy%(W%),sy%(U%):Ȕex%(W%),ex%(U%):Ȕey%(W%),ey%(U%)
!z
W%-=P%
!��W%<1�ef%=1:ef%=0:Q%+=1
!��Q%>R%:P%=P%�2
!�	�P%=0
!��
!�:
!���rep(type%)
!�"�I%=1�words%:�word$(I%)="~~" �
!�word$(I%)=""
!�s�type%=0 len%(I%)=0:start%(I%)=0:dir%(I%)=0:selected%(I%)=0:show%(I%)=0:sx%(I%)=0:sy%(I%)=0:ex%(I%)=0:ey%(I%)=0
!��
!��
!��
!�:
"��bumpx(inc%)
"�words%=0 �
"�button%=1 inc%=-inc%
"$+� (dimx*dimy)<(needs%*1.12) � inc%=-1 �
"..� (dimx=40 � inc%>0) � (dimx=0 � inc%<0) �
"8&dimx+=inc%:� �gaps<10:dimx-=inc%:�
"B'�IconPutText(main_Window%,12,�dimx)
"L2gaps=�gaps:�IconPutText(main_Window%,20,�gaps)
"V�
"`:
"j��bumpy(inc%)
"t�words%=0 �
"~�button%=1 inc%=-inc%
"�5� (dimx*dimy)<(needs%*(1+(gaps/100))) � inc%=-1 �
"�0� (dimy=maxh � inc%>0) � (dimy=0 � inc%<0) �
"�&dimy+=inc%:� �gaps<10:dimy-=inc%:�
"�'�IconPutText(main_Window%,16,�dimy)
"�2gaps=�gaps:�IconPutText(main_Window%,20,�gaps)
"��
"�:
"���bumpgaps(inc%)
"��gaps<10 �rec(0):�
"��button%=1 inc%=-inc%
"�� (gaps=10 � inc%=-1) �
"�� (gaps=maxh � inc%=1) �
#gaps+=inc%
#
'�IconPutText(main_Window%,20,�gaps)
#S�rec(0):�IconPutText(main_Window%,12,�dimx):�IconPutText(main_Window%,16,�dimy)
#�
#(:
#2ݤbumppt(inc%,dummy%,d%)
#<9� (dummy%=6 � inc%=-1) � (dummy%=24 � inc%=1):=dummy%
#F�button%=1 inc%=-inc%
#P=dummy%+=inc%:�IconPutText(prefs_Window%,d%,�dummy%+" pt")
#Z=dummy%
#d:
#n
ݤgaps
#x�dimx*dimy=0 =gaps
#�3=�round((((dimx*dimy)-needs%)/(dimx*dimy))*100)
#�:
#�ݤoneormore(dummy%)
#�� dummy%=1 ="1 word "
#�� dummy%=0 ="No words "
#�=�dummy%+" words "
#�:
#�ݤnone(dummy%)
#�%�dummy%=0 ="None " � =�dummy%+" "
#�:
#���create
#�T� words%<1 �Alert("WordSq","There are no words to be placed in a wordsquare!"):�
#�Xd%=0:�words%<121 �Tbd �:�(dbl%=0 � dimx<((len%*2)+1)) � (dbl%=-1 � dimx<(len%+1)) �
$&� dbl%=0 d%=(len%*2)+1 � d%=len%+1
$��Alert("WordSq","The number of words means that the grid must be at least "+�d%+" characters across.  Please reset this value and try again.")
$�
$"�d%>0 �
$,'wsqtitle$=�IconText(main_Window%,9)
$6��(dimx*dimy)<(1.1*needs%) � (dimx<len% � dimy<len%) �Alert("WordSq","All of these words will not fit into the largest size grid - you must delete a few, or shorten some of the longer ones."):�
$@ș"Hourglass_On"
$Jwsqx=dimx:wsqy=dimy
$T*not%=0:pla%=0:F%=0:startx%=0:starty%=0
$^*grid%()=0:start%()=0:dir%()=0:�sort(0)
$h*Z%=0:�I%=1�words%:w$=�strip(word$(I%))
$rA%=0:tr%=0:F%=0
$|�:tr%+=1
$�8�-113 �Alert("WordSq","Creation interrupted."):Z%=1
$�A%=�(dimx*dimy)
$�/� grid%(A%)<>0 � grid%(A%)<>�(�w$,1)) �tPd
$��ends:�fit
$�-�F%=1 � Z%=1 � tr%>=(dimx*dimy)+dimx+dimy
$�"�Z%=1 I%=words%+1:�:�ng:Z%=0:�
$�J�tr%>=(dimx*dimy)+dimx+dimy not%+=1:start%(I%)=0:dir%(I%)=99:� pla%+=1
$�P�IconPutText(main_Window%,6,"Creating - "+�oneormore(pla%)+"placed so far.")
$�)�dir%(I%)<>99 �positions(I%,dir%(I%))
$�;ș"Hourglass_Percentage",�round((pla%+not%)/words%*100)
$�b�:�gaps:�sort(1):�IconPutText(main_Window%,6,�oneormore(pla%)+"placed - "+�wsqgaps+"% gaps. ")
$�$ș"Hourglass_Off":wsqwords%=pla%
$��� pla%=0 �Alert("WordSq","In fact, no words could be placed. Try increasing the grid size."):�IconPutText(main_Window%,6,"No grid formed."):�
%
�not%>0 �
%!�not%=1 d$="It " � d$="They "
%��Alert("WordSq","When creating the wordsquare, "+�oneormore(not%)+"could not be placed. "+d$+"will remain in memory and appear selected in the word list window, but will not show up on the wordsquare.")
%&+�clearall:selectedword$="":�I%=1�words%
%0n�dir%(I%)=99 dir%(I%)=0:�SetIcon(words_Window%,I%+3):selected%(I%)=1:selection%+=1:selectedword$=word$(I%)
%:�:�setbutton
%D*�selection%=1 d$=selectedword$ � d$=""
%NT�IconPutText(main_Window%,26,d$):�IconPutText(solve_Window%,17,d$):�caret(�d$/2)
%X�
%bQ�MenuEnable(main_Menu%,4):�MenuEnable(main_Menu%,5):�MenuEnable(main_Menu%,6)
%l1�display:solveformat$="own":�updatesolvestate
%vJ�IconPutText(solve_Window%,5,"Using wordsquare from creator program.")
%�,�solvewind% �BringToTop(display_Window%)
%�$wsqx=dimx:wsqy=dimy:gridsaved%=0
%��
%�:
%�ݤcaps(d$)
%��K%
%��d$=0 =""
%��K%=1��d$:ch%=�(�d$,K%,1))
%�*�ch%>96 � ch%<123 �d$,K%,1)=�(ch%�223)
%��
%�=d$
%�:
%�
��ends
&Cpo=A%:po-=1:�:po+=1:��(po/dimx)=po/dimx:me%=po:mw%=me%-(dimx-1)
&�
&:
& 	��fit
&*L%=�w$-1
&4C�A%-L%>=mw% � A%-(dimx*L%)>=1 �fill(-1,-dimx):dir%(I%)=8:� F% �
&>J�A%-L%>=mw% � A%+(dimx*L%)<=dimx*dimy �fill(-1,dimx):dir%(I%)=6:� F% �
&HI�A%+L%<=me% � A%+(dimx*L%)<=dimx*dimy �fill(1,dimx):dir%(I%)=4:� F% �
&RB�A%+L%<=me% � A%-(dimx*L%)>=1 �fill(1,-dimx):dir%(I%)=2:� F% �
&\-�A%-L%>=mw% �fill(-1,0):dir%(I%)=7:� F% �
&f5�A%-(dimx*L%)>=1 �fill(0,-dimx):dir%(I%)=1:� F% �
&p<�A%+(dimx*L%)<=dimx*dimy �fill(0,dimx):dir%(I%)=5:� F% �
&z,�A%+L%<=me%:�fill(1,0):dir%(I%)=3:� F% �
&��
&�:
&���fill(x,y)
&�p%=A%:�K%=2��w$:p%+=(x+y)
&�7�grid%(p%)<>�(�w$,K%,1))� grid%(p%)<>0 K%=�w$+1:�:�
&��
&�start%(I%)=A%
&�;p%=A%:�K%=1��w$:grid%(p%)=�(�w$,K%,1)):p%+=(x+y):�:F%=1
&��
&�:
&�
��gaps
&�Hwsqgaps=0:�I%=1�dimx*dimy:�grid%(I%)=0 grid%(I%)=�(26)+64:wsqgaps+=1
&�/�:wsqgaps=�round((wsqgaps/(dimx*dimy))*100)
'�
':
'
��format1
'$�I%=1�words%
'.)�I%=1 �under � �I%=dimy+1 �over:�DVg
'8P�saveformat$="draw" �#file,"\1";:��saveformat$="imp" �#file,"{""Grid"" on}";
'BE�I%<=dimy �put(b$(I%),1):� �saveformat$<>"imp" �put(�pad(dimx),1)
'LQ�saveformat$="draw" �#file,"\2";:��saveformat$="imp" �#file,"{""Words"" on}";
'V�put(�pad(3),1)
'`�put(word$(I%),0):�
'j*�words%=dimy �over:�:�� words%>=dimy �
'td�I%=words%+1 � dimy:�saveformat$="draw" �#file,"\1";:��saveformat$="imp" �#file,"{""Grid"" on}";
'~�put(b$(I%),0):�
'��
'��
'�:
'�
��format2
'�L�(words%/2)<>words%/2 C1=�(words%/2)+1:C2=words%-C1:� C1=words%/2:C2=C1
'��I%=1�C1
'�)�I%=1 �under � �I%=dimy+1 �over:�dlg
'�Q�saveformat$="draw" �#file,"\1";:� �saveformat$="imp" �#file,"{""Grid"" on}";
'�E�I%<=dimy �put(b$(I%),1):� �saveformat$<>"imp" �put(�pad(dimx),1)
'�R�saveformat$="draw" �#file,"\2";:� �saveformat$="imp" �#file,"{""Words"" on}";
'�\�put(�pad(3),1):�put(word$(I%),1):�put(�pad(len%-�word$(I%)+1),1):�put(word$(C1+I%),0):�
'�"�C1=dimy �over:�:�� C1>=dimy �
(Q�saveformat$="draw" �#file,"\1";:� �saveformat$="imp" �#file,"{""Grid"" on}";
(
$�I%=C1+1 � dimy:�put(b$(I%),0):�
(	�over
(�
((:
(2
��format3
(<AC%=words%-((dimy+1)*2):D%=C%+1:�:D%-=1:��(D%/4)=D%/4:E%=C%-D%
(F)� E%=0:E%=4:C1=D%/4:C2=C1:C3=C1:C4=C3
(P*� E%=1:C1=(D%/4)+1:C2=D%/4:C3=C2:C4=C3
(Z0� E%=2:C1=(D%/4)+1:C2=(D%/4)+1:C3=D%/4:C4=C3
(d6� E%=3:C1=(D%/4)+1:C2=(D%/4)+1:C3=(D%/4)+1:C4=D%/4
(n�I%=1�dimy
(x�I%=1�under
(�Q�saveformat$="draw" �#file,"\1";:� �saveformat$="imp" �#file,"{""Grid"" on}";
(�q�put(b$(I%),1):�put(�pad(3),1):�saveformat$="draw" �#file,"\2";:� �saveformat$="imp" �#file,"{""Words"" on}";
(�e�put(word$(C1+C2+I%),1):�put(�pad(len%+1-�word$(C1+C2+I%)),1):�put(word$(dimy+C1+C2+C3+1+I%),0):�
(�Q�saveformat$="draw" �#file,"\1";:� �saveformat$="imp" �#file,"{""Grid"" on}";
(��over:�put(�pad(3),1)
(�R�saveformat$="draw" �#file,"\2";:� �saveformat$="imp" �#file,"{""Words"" on}";
(�m�put(word$(dimy+C1+C2+1),1):�put(�pad(len%+1-�word$(dimy+C1+C2+1)),1):�put(word$(dimy+dimy+C1+C2+C3+2),0)
(��I%=1�C1
(�R�saveformat$="draw" �#file,"\2";:� �saveformat$="imp" �#file,"{""Words"" on}";
(�5�put(word$(I%),1):�put(�pad(len%+1-�word$(I%)),1)
(�s�I%<C1 � (I%=C1 � E%>=2) �put(word$(C1+I%),1):�put(�pad(dimx+3-(len%+1-�word$(I%)+�word$(I%)+�word$(C1+I%))),1)
(�h�I%<C1 � (I%=C1 � E%>=3) �put(word$(dimy+C1+C2+1+I%),1):�put(�pad(len%+1-�word$(dimy+C1+C2+1+I%)),1)
(�C�I%<C1 � (I%=C1 � E%>=4) �put(word$(dimy+dimy+C1+C2+C3+2+I%),0)
)�
)�
):
)"
��tabs
),case%=�case
)6&�case%=0 a=2.7:b=0.44 � a=4:b=0.65
)@Ȏ c% �
)JE� 1:t1%=(dimx*(3.65+((gridpt%-6)*0.6)))+22:tab$="tabs "+�t1%+"pt"
)Tv� 2:t1%=(dimx*(3.65+((gridpt%-6)*0.6)))+22:t2%=t1%+5+(len%*(a+((wordspt%-6)*b))):tab$="tabs "+�t1%+"pt,"+�t2%+"pt"
)^�� 4:t1%=15+(len%*(a+((wordspt%-6)*b))):t2%=(dimx*(3.65+((gridpt%-6)*0.6)))+22:t3%=t2%+15+(len%*(a+((wordspt%-6)*b))):tab$="tabs "+�t1%+"pt,"+�t2%+"pt,"+�t3%+"pt"
)h�
)r�
)|:
)���header
)�Ȏ saveformat$ �
)�� "text"
)��� "draw":header$="\! 1"+�10+"\F 0 "+titlefont$+" "+�titlept%+�10+"\F 1 "+gridfont$+" "+�gridpt%+�10+"\F 2 "+wordsfont$+" "+�wordspt%+�10+"\L"+�(�round(gridpt%*1.08))+�10
)�9header$+="\P"+�(�round((gridpt%*1.08)/1.75))+�10+"\0"
)��#file,header$
)¯� "imp":header$="{define style ""Title"";font "+titlefont$+";fontsize "+�titlept%+"pt;"+tab$+"}{define style ""Grid"";font "+gridfont$+";fontsize "+�gridpt%+"pt;"+tab$+"}"
)�kheader$+="{define style ""Words"";font "+wordsfont$+";fontsize "+�wordspt%+"pt;"+tab$+"}{""Title"" on}"
)��#file,header$;
)��
)��
)�:
)�
ݤpad(d%)
* � saveformat$="imp" ="{tab}"
*#� saveformat$="draw" =�d%,�160)
*
=�d%," ")
*&:
*0��put(d$,d%)
*:%�saveformat$="print" �d$;:�d%=0 �
*D4�saveformat$<>"print" �#file,d$;:�d%=0 �#file,""
*N�
*X:
*b
��over
*l5�saveformat$="draw" a$="\1":b$=�pad(dimx):c$="\2"
*v�saveformat$="imp" �
*��c%=4 b$="{tab}" � b$=""
*�*a$="{""Grid"" on}":c$="{""Words"" on}"
*��
*�1�saveformat$="text" a$="":b$=�pad(dimx):c$=""
*�G�saveformat$<>"print" � overon$="" � overoff$="" �put(a$+b$+c$,1):�
*�;�getecho(overon$):�put(�pad(dimx),1):�getecho(overoff$)
*��
*�:
*���under
*�C�saveformat$<>"print" � underon$="" � underoff$="" �put("",0):�
*�=�getecho(underon$):�put(�pad(dimx),0):�getecho(underoff$)
*��
*�:
+	��pre
+%�saveformat$<>"print" � pre$="" �
+�getecho(pre$)
+ �
+*:
+4
��post
+>&�saveformat$<>"print" � post$="" �
+H�getecho(post$)
+R�
+\:
+f��printtitle
+p*�emphon$="" � emphoff$="" �wsqtitle$:�
+z3�getecho(emphon$):�wsqtitle$:�getecho(emphoff$)
+��
+�:
+���getecho(d$)
+�d%=1
+�e�K%=1��d$:dummy$="":�d$,K%,1)="," dummy$=�d$,d%,K%-d%):d%=K%+1:� � K%=�d$ dummy$=�d$,d%,K%-d%+1)
+��dummy$<>"" �1;��dummy$;
+��
+��
+�:
+���caret(c%)
+�Q�c%>1000 � solvewind% c%-=1000:�IconCaret(solve_Window%,17,c%):� � �c%>1000 �
+�/�solvewind% �IconCaret(solve_Window%,17,c%)
+�D�mainwind% � solveformat$<>"text" �IconCaret(main_Window%,26,c%)
,�
,:
,ݤnew(extra$)
,$fmessage$="You have not saved your ":�wordssaved%=0 message$+="words":�gridsaved%=0 message$+=" or"
,.6�gridsaved%=0 message$+=" grid. " � message$+=". "
,84message$+="Are you sure you want to "+extra$+"?"
,B-�wordssaved%=1 � gridsaved%=1 message$=""
,L9� message$<>"":�WindowCancel("WordSq",message$)=0 =0
,V=1
,`:
,j��reset
,tș"Hourglass_On"
,~
�closeall
,�Mselection%=0:word$()="":grid%()=0:start%()=0:dir%()=0:len%()=0:�setbutton
,�Dwords%=0:gaps=25:dimx=0:dimy=0:solveformat$="":high%=0:show%()=0
,�<sx%()=0:sy%()=0:ex%()=0:ey%()=0:show%=0:found%=0:done%=0
,�Lwsqx=0:wsqy=0:wsqwords%=0:wordssaved%=1:gridsaved%=1:startx%=0:starty%=0
,�1�:�I%=1�10:�d%:�IconEnable(main_Window%,d%):�
,�c�IconPutText(main_Window%,5,"No words entered."):�IconPutText(main_Window%,6,"No grid formed.")
,�o�IconPutText(main_Window%,12,�dimx):�IconPutText(main_Window%,16,�dimy):�IconPutText(main_Window%,20,�gaps)
,·�IconPutText(solve_Window%,5,"No wordsquare currently available."):�IconPutText(solve_Window%,6,"No words available - None shown.")
,�p�IconPutText(main_Window%,26,""):�IconPutText(solve_Window%,17,""):�IconPutText(main_Window%,9,"<Untitled>")
,��I%=4 � 171:�IconPutText(words_Window%,I%,""):�sic(words_Window%,I%,7):�selected%(I%-3)=1 selected%(I%-3)=0:�SetIcon(words_Window%,I%):�:� �
,��ww
,�]�wordswind%=1 �MenuTick(display_Menu%,2):�MenuTick(main_Menu%,2):�MenuTick(solve_Menu%,2)
-��MenuDisable(main_Menu%,2):�MenuDisable(main_Menu%,3):�MenuDisable(main_Menu%,4):�MenuDisable(main_Menu%,5):�MenuDisable(display_Menu%,2)
-
�MenuDisable(solve_Menu%,2)
-�MenuDisable(words_Menu%,2)
-6selected%()=0:mainwind%=0:solvewind%=0:dispwind%=0
-(ș"Hourglass_Off"
-2�
-<:
-F��ng
-PCgrid%()=0:start%()=0:dir%()=0:solveformat$="":high%=0:show%()=0
-ZCwsqx=0:wsqy=0:wsqwords%=0:gridsaved%=1:show%=0:found%=0:done%=0
-d2�IconPutText(main_Window%,6,"No grid formed.")
-n��IconPutText(solve_Window%,5,"No wordsquare currently available."):�IconPutText(solve_Window%,6,"No words available - None shown.")
-xT�MenuDisable(main_Menu%,4):�MenuDisable(main_Menu%,5):�MenuDisable(main_Menu%,6)
-�(�I%=4�171:�sic(words_Window%,I%,7):�
-�7�Z%=1 ș"Hourglass_On":�sort(1):ș"Hourglass_Off":�
-�gaps=25:dimx=0:dimy=0
-�'�IconPutText(main_Window%,20,�gaps)
-��
-�:
-���closeall
-Ȑ�WindowClose(display_Window%):�WindowClose(main_Window%):�WindowClose(solve_Window%):�WindowClose(words_Window%):�WindowClose(prefs_Window%)
-�)wordswind%=0:solvewind%=0:dispwind%=0
-��
-�:
-�
��display
-�6dummy%=0:�I%=1�dimy:dummy$="":�J%=1�dimx:dummy%+=1
.2dummy$+=�(grid%(dummy%)):�J%<>dimx dummy$+=" "
.*�:�dummy$<79 dummy$+=�79-�dummy$," ")
./�IconPutText(display_Window%,I%+1,dummy$):�
."H�dimy<60 �I%=dimy+1�60:�IconPutText(display_Window%,I%+1,�79," ")):�
.,;�resize(display_Window%,0,-84-(dimy*44),54+(dimx*32),0)
.6�
.@:
.J��updatesolvestate
.TȎ solveformat$ �
.^� "own"
.h�wordstatus$=�oneormore(wsqwords%)+"in the grid - "+�none(high%)+"shown - "+�none(selection%)+"selected.":�IconPutText(solve_Window%,6,wordstatus$)
.rvwordstatus$=�oneormore(words%)+"entered - "+�none(selection%)+"selected.":�IconPutText(main_Window%,5,wordstatus$)
.|� "text"
.��wordstatus$=�oneormore(wsqwords%)+"in the grid - "+�none(high%)+"shown - "+�none(selection%)+"selected.":�IconPutText(solve_Window%,6,wordstatus$)
.�wwordstatus$=�oneormore(wsqwords%)+"found - "+�none(selection%)+"selected.":�IconPutText(main_Window%,5,wordstatus$)
.�� ""
.�vwordstatus$=�oneormore(words%)+"entered - "+�none(selection%)+"selected.":�IconPutText(main_Window%,5,wordstatus$)
.��
.��
.�:
.���setbutton
.�.�selection%<2 d$=" Word" � d$=" Selection"
.�-�IconPutText(main_Window%,25,"Delete"+d$)
.�-�IconPutText(solve_Window%,8,"Remove"+d$)
.�+�IconPutText(solve_Window%,9,"Show"+d$)
.��
/:
/��find(d$)
/ș"Hourglass_On"
/&w$=�strip(d$)
/0F%=0:I%=words%+1
/:�A%=1�dimx*dimy
/D/ș"Hourglass_Percentage",A%/(dimx*dimy)*100
/N �grid%(A%)=��d$,1) �nextstep
/X�
/bș"Hourglass_Off"
/lc�F%=0 �Alert("WordSq","The word '"+d$+"' does not exist in the currently loaded wordsquare."):�
/v��F%>1 � �palindrome(d$)=0 �Alert("WordSq","More than one occurrence of "+gibbet$+" has been found, so it will be ignored"):�
/�ș"Hourglass_On"
/�9d$=�IconText(solve_Window%,17):�caps%=-1 d$=�caps(d$)
/�lwords%+=1:wsqwords%+=1:word$(words%)=d$:len%(words%)=�len(d$):dir%(words%)=d%:needs%=Ǝlen%():gaps=�gaps
/�#�positions(words%,dir%(words%))
/�_high%+=1:show%(words%)=1:�sort(1):�I%=1�words%:�IconPutText(words_Window%,I%+3,word$(I%)):�
/��ww
/�need%=1:wordssaved%=0
/�ș"Hourglass_Off"
/��
/�:
/���nextstep
/��ends:L%=�d$-1
/�?�A%-L%>=mw%�A%-(dimx*L%)>=1:dir%(I%)=8:�getstring(-1,-dimx)
0F�A%-L%>=mw%�A%+(dimx*L%)<=dimx*dimy:dir%(I%)=6:�getstring(-1,dimx)
0G�A%+L%<=me% � A%+(dimx*L%)<=dimx*dimy:dir%(I%)=4:�getstring(1,dimx)
0@�A%+L%<=me% � A%-(dimx*L%)>=1:dir%(I%)=2:�getstring(1,-dimx)
0 +�A%-L%>=mw%:dir%(I%)=7:�getstring(-1,0)
0*3�A%-(dimx*L%)>=1:dir%(I%)=1:�getstring(0,-dimx)
04:�A%+(dimx*L%)<=dimx*dimy:dir%(I%)=5:�getstring(0,dimx)
0>*�A%+L%<=me%:dir%(I%)=3:�getstring(1,0)
0H�
0R:
0\��getstring(x,y)
0f>dummy$=�d$,1):p%=A%:�J%=2��d$:p%+=x+y:dummy$+=�grid%(p%):�
0p/� dummy$=d$ F%+=1:start%(I%)=A%:d%=dir%(I%)
0z�
0�:
0�ݤexists(d$)
0�ș"Hourglass_On"
0�9e%=0:�W%=1�words%:� d$=�strip(�caps(word$(W%))) e%=W%
0��
0�ș"Hourglass_Off"
0�=e%
0�:
0�ݤpalindrome(o$)
0�/dummy$="":�o%=�o$�1 �-1:dummy$+=�o$,o%,1):�
0��o$=dummy$ =1 � =0
0�:
0���copyover
1temp$()=""
1$�I%=1�words%:temp$(I%)=word$(I%)
1-�start%(I%)=0 � dir%(I%)=0 word$(I%)="~~"
1$�:�sort(2):�rep(1)
1.�
18:
1B��copyback
1Lword$()=""
1V(�I%=1�words%:Ȕtemp$(I%),word$(I%):�
1`�
1j:
1t��autoload
1~ș "OS_GetEnv" � d$
1�d$=�d$,�d$-20)
1�ȕ �d$,1)<>" " � �d$<>0
1�d$=�d$,�d$-1)
1��
1��d$=" " d$=""
1��
1�:
1���crossout(d%)
1�8xpos%=x_origin%+14:ypos%=y_origin%-((d%-2)*36)-252+6
1�/� xpos%,ypos%:� xpos%+(len%(d%)*16)+2,ypos%
1��
1�:
2��sic(w%,i%,c%)
2
:!wimp%=w%:wimp%!4=i%:wimp%!8=c%<<24:wimp%!12=&0F000000
2!ș"Wimp_SetIconState",0,wimp%
2�
2(:
22��sib(w%,i%,c%)
2<:!wimp%=w%:wimp%!4=i%:wimp%!8=c%<<28:wimp%!12=&F0000000
2F!ș"Wimp_SetIconState",0,wimp%
2P�
2Z:
2d ݤgetword(startpos%,endpos%)
2nFA%=startpos%:Ȕwsqx,dimx:Ȕwsqy,dimy:�ends:Ȕwsqx,dimx:Ȕwsqy,dimy
2x,scol%=startpos%�wsqx:�scol%=0 scol%=wsqx
2�*ecol%=endpos%�wsqx:�ecol%=0 ecol%=wsqx
2�7srow%=((startpos%-1)�wsqx):erow%=((endpos%-1)�wsqx)
2�4�srow%>erow% � scol%=ecol% dx%=0:dy%=-wsqx:�dfr
2�4�srow%>erow% � scol%<ecol% dx%=1:dy%=-wsqx:�dfr
2�0�srow%=erow% � scol%<ecol% dx%=1:dy%=0:�dfr
2�3�srow%<erow% � scol%<ecol% dx%=1:dy%=wsqx:�dfr
2�3�srow%<erow% � scol%=ecol% dx%=0:dy%=wsqx:�dfr
2�4�srow%<erow% � scol%>ecol% dx%=-1:dy%=wsqx:�dfr
2�1�srow%=erow% � scol%>ecol% dx%=-1:dy%=0:�dfr
2�/�srow%>erow% � scol%>ecol% dx%=-1:dy%=-wsqx
2�dummy$="":p%=startpos%:o%=0
2��
2�dummy$+=�grid%(p%)
3p%+=dx%+dy%
3-�p%=endpos% o%=1:dummy$+=�grid%(p%):p%=-1
3� p%<0 � p%>(wsqx*wsqy)
3"/�o%=1 ��dummy$<19 � �dummy$>2 =dummy$ � =""
3,:
36ݤstrip(o$)
3@Kc$=�caps(o$):o%=�c$:o$="":�J%=1�o%:e$=�c$,J%,1):�e$<="Z"�e$>="A" o$+=e$
3J�
3T=o$
3^:
3h��positions(d%,dir%)
3r?�start%(d%)�wsqx=0 xpos%=wsqx-1 � xpos%=(start%(d%)�wsqx)-1
3|ypos%=(start%(d%)�wsqx)
3�0�start%(d%)/wsqx=�(start%(d%)/wsqx) ypos%-=1
3�+xpos%=(xpos%*32)+25:ypos%=(ypos%*44)+68
3�
Ȏ dir% �
3�� 1:dx%=0:dy%=44
3�� 2:dx%=32:dy%=44
3�� 3:dx%=32:dy%=0
3�� 4:dx%=32:dy%=-44
3�� 5:dx%=0:dy%=-44
3�� 6:dx%=-32:dy%=-44
3�� 7:dx%=-32:dy%=0
3�� 8:dx%=-32:dy%=44
3��
3�dy%=-dy%
4asx%(d%)=xpos%:sy%(d%)=ypos%:ex%(d%)=xpos%+((len%(d%)-1)*dx%):ey%(d%)=ypos%+((len%(d%)-1)*dy%)
4�
4:
4&
ݤcase
40d%=0
4:P�I%=1�words%:�J%=1��word$(I%):d$=�word$(I%),J%,1):� d$>="A"  � d$<="Z" d%+=1
4D�:�
4N�d%>(words%*2.5) =1 � =0
4X:
4bݤorigin
4l=16+wimp%!4-wimp%!20-18
4v:
4�#� 11,13,15,17,19,21,24,26,28,29
4�:
4���Alert(title$,message$)
4� �AlertBox(title$,message$,0)
4��
4�:
4�'��AlertBox(title$,message$,button%)
4�/�response%:$(wimp%+4)=message$:Ȏ button% �
4�� 1:response%=15
4�� 2:response%=1
4�� 3:response%=(1<<5)+16
4�� 4:response%=(1<<6)+16
4�:response%=16
5�
5=ș "Wimp_ReportError",wimp%,response%,title$ � ,response%
5�
5 :
5*#ݤWindowCancel(title$,message$)
54$$(wimp%+4)=message$:response%=23
5>=ș "Wimp_ReportError",wimp%,response%,title$ � ,response%
5H=response%-2
5R:
5\ݤWindowTitle(window%)
5fwimp%!0=window%
5p ș "Wimp_GetWindInfo",,wimp%
5z6� ((wimp%!60)�&100)=0 � 1,"Title isn't indirected"
5�=$(wimp%!76)
5�:
5�ݤWindowLoad(window$)
5�6=�WindowLoadFrom(window$,"<WordSq$Dir>.Templates")
5�:
5�'ݤWindowLoadFrom(window$,template$)
5�� c%,i%,n%,j%,sp$,sp2$
5�%ș "Wimp_OpenTemplate",,template$
5�Mș "Wimp_LoadTemplate",,wimp%,icons%,icon_memory%,-1,window$,0 � ,,icons%
5�Ȏ sprites% �
5�� 1:wimp%!64=sprites%
5�:wimp%!64=sprites%
5��
6&ș "Wimp_CreateWindow",,wimp% � c%
6ș "Wimp_CloseTemplate"
67ș "Wimp_WhichIcon",c%,wimp%+40,1+2+(1<<8),2+(1<<8)
6$Ȏ wimp%!40 �
6.� -1
68:i%=40
6B�
6Lwimp%!4=wimp%!i%:wimp%!0=c%
6V!ș "Wimp_GetIconState",,wimp%
6`%sp$=�GetStringAtAddress(wimp%!28)
6jș "Wimp_DeleteIcon",,wimp%
6tȎ sprites% �
6~� 1:wimp%!32=1
6�
6�*ș "OS_SpriteOp",&108,sprites% � ,,,n%
6�j%=0
6��:j%+=1
6�7ș "OS_SpriteOp",&10D,sprites%,pointer_block%,20,j%
6�,sp2$=�GetStringAtAddress(pointer_block%)
6�� j%=n% � sp$=sp2$
6�/� sp$=sp2$ � wimp%!32=sprites% � wimp%!32=1
6��
6�wimp%!4=c%
6�+ș "Wimp_CreateIcon",,wimp%+4 � handle%
6�	i%+=4
7� (wimp%!i%)=-1
7
�
7=c%
7:
7(��BringToTop(window%)
72!wimp%=window%
7<#ș "Wimp_GetWindowState",,wimp%
7Fwimp%!28=-1
7Pș "Wimp_OpenWindow",,wimp%
7Z(�window%=display_Window% dispwind%=1
7d�
7n:
7x��WindowClose(window%)
7�!wimp%=window%
7� ș "Wimp_CloseWindow",,wimp%
7�(�window%=display_Window% dispwind%=0
7��
7�:
7���WindowForceDraw(window%)
7�Ȏ window% �
7�3� -1:ș "Wimp_ForceRedraw",-1,0,0,2*1280,2*1024
7�6:ș "Wimp_ForceRedraw",window%,0,-2*1024,2*1280,0
7��
7��
7�:
7���WindowOpen(window%)
8!wimp%=window%
8#ș "Wimp_GetWindowState",,wimp%
8ș "Wimp_OpenWindow",,wimp%
8"�
8,:
86�WindowInterface
8@ ș"Wimp_BorderWindow",,wimp%
8J�
8T:
8^ݤIconBar(Sprite$)
8h� icon%
8rwimp%!0=-1
8|wimp%!4=0:wimp%!8=0
8�wimp%!12=68:wimp%!16=68
8�wimp%!20=&3002
8�$(wimp%+24)=Sprite$
8�'ș "Wimp_CreateIcon",,wimp% � icon%
8�
=icon%
8�:
8�%��IconCaret(window%,icon%,chars%)
8�8ș "Wimp_SetCaretPosition",window%,icon%,,,-1,chars%
8��
8�:
8�ݤIconText(window%,icon%)
8�!wimp%!0=window%:wimp%!4=icon%
8�!ș "Wimp_GetIconState",,wimp%
9Y� ((wimp%!24) � &100)=0 � 1,"Icon "+�icon%+" in window "+�window%+" isn't indirected"
9=$(wimp%!28)
9:
9&#ݤIconValidation(window%,icon%)
90!wimp%!0=window%:wimp%!4=icon%
9:!ș "Wimp_GetIconState",,wimp%
9DY� ((wimp%!24) � &100)=0 � 1,"Icon "+�icon%+" in window "+�window%+" isn't indirected"
9N=$(wimp%!32)
9X:
9b ��IconDisable(window%,icon%)
9l!wimp%!0=window%:wimp%!4=icon%
9v wimp%!8=1<<22:wimp%!12=1<<22
9�!ș "Wimp_SetIconState",,wimp%
9��
9�:
9���IconEnable(window%,icon%)
9�!wimp%!0=window%:wimp%!4=icon%
9�wimp%!8=0:wimp%!12=1<<22
9�!ș "Wimp_SetIconState",,wimp%
9��
9�:
9�*ݤIconPutSprite(window%,icon%,sprite$)
9�!wimp%!0=window%:wimp%!4=icon%
9�!ș "Wimp_GetIconState",,wimp%
9�ș "Wimp_DeleteIcon",,wimp%
:6wimp%!4=wimp%!8:wimp%!8=wimp%!12:wimp%!12=wimp%!16
:;wimp%!16=wimp%!20:wimp%!20=wimp%!24:$(wimp%+24)=sprite$
:'ș "Wimp_CreateIcon",,wimp% � icon%
: 
=icon%
:*:
:4&��IconPutText(window%,icon%,text$)
:>#wimp%!0=window% : wimp%!4=icon%
:H!ș "Wimp_GetIconState",,wimp%
:RY� ((wimp%!24) � &100)=0 � 1,"Icon "+�icon%+" in window "+�window%+" isn't indirected"
:\$(wimp%!28)=text$
:f!wimp%!0=window%:wimp%!4=icon%
:pwimp%!8=0:wimp%!12=0
:z!ș "Wimp_SetIconState",,wimp%
:��
:�:
:���IconInterfaceStart
:�ș"Wimp_BorderIcon",,wimp%
:��
:�:
:���IconInterfaceFinish
:�
wimp%!8=0
:�ș"Wimp_BorderIcon",,wimp%
:��
:�:
:���MenuAdjustOn(menu%)
:�,ș "Wimp_GetPointerInfo",,pointer_block%
;^� ((pointer_block%!8)�1)=1 � ș "Wimp_CreateMenu",,menu%,pointer_block%!0,pointer_block%!4
;�
;:
;$ݤMenuChoice(level%)
;.=(wimp%!(4*level%))+1
;8:
;BݤMenuCreate(menu$)
;L/� menu$="Colours" �=�MenuCreateColours(" ")
;V'� menu%,index%,width%,length%,k%,s%
;`)� menu% 28+�MenuNoOfEntries(menu$)*24
;j/menu%?12=7:menu%?13=2:menu%?14=7:menu%?15=0
;t'menu%!16=140:menu%!20=44:menu%!24=0
;~index%=menu%+28
;� $menu%=�menu$,�menu$,"\")-1)
;�#width%=�(�menu$,�menu$,"\")-1))
;�"menu$+="\":Menu_NoOfEntries%=0
;�ȕ menu$<>""
;�menu$=�menu$,�menu$,"\")+1)
;�Ȏ menu$ �
;�� ""
;�
;�+!index%=0:index%!4=-1:index%!8=&7000021
;�length%=�menu$,"\")-1
;�k%=��menu$,length%),">")
;�Ȏ k% �
<� 0
<

<!s%=�(�menu$,k%+1,length%-k%))
<index%!4=s%
<(length%=k%-1
<2�
<< $(index%+12)=�menu$,length%)
<F%� length%>width% � width%=length%
<Pindex%+=24
<Z�
<d�
<nmenu%!16=16*(width%+1)
<x&index%!-24=index%!-24 � &80:=menu%
<�:
<�ݤMenuNoOfEntries(menu$)
<�� n%,j%:n%=0:j%=0
<��
<�j%=�menu$,"\",j%+1)
<�� j%<>0 � n%+=1
<�
� j%=0
<�=n%
<�:
<���MenuClose
<�ș "Wimp_CreateMenu",-1
<��
<�:
=��MenuDisable(menu%,item%)
=;menu%!(36+(item%-1)*24)=menu%!(36+(item%-1)*24)�(1<<22)
=�
=":
=,��MenuEnable(menu%,item%)
=6�MenuDisable(menu%,item%)
=@;menu%!(36+(item%-1)*24)=menu%!(36+(item%-1)*24)�(1<<22)
=J�
=T:
=^��MenuTick(menu%,item%)
=h7menu%!(28+(item%-1)*24)=(menu%!(28+(item%-1)*24))�1
=r�
=|:
=���SpritesLoad
=�,�SpritesPathLoad("<WordSq$Dir>.Sprites")
=�direct_sprites%=sprites%
=��
=�:
=� ��SpritesPathLoad(pathname$)
=�
�S%,T%
=�.S%=�"<WordSq$Dir>.Sprites":T%=�#S%+16:�#S%
=��sprites%T%,spname%12
=�!sprites%=T%:sprites%!8=0
=�!ș"OS_SpriteOp",&109,sprites%
=�+ș"OS_SpriteOp",&10A,sprites%,pathname$
=��
>:
>ݤGetFilePathName
>"=�GetStringAtAddress(wimp%+44)
>&:
>0 ݤGetStringAtAddress(array%)
>:
�s$:s$=""
>D<ȕ(?array%<>13)�(?array%<>0):s$+=�(?array%):array%+=1:�:
>N=s$
>X:
>bݤGetFileFromPathname(f$)
>lȎ �f$,".") �
>v� 0:=f$
>�0:=�GetFileFromPathname(�f$,�(f$)-�f$,".")))
>��
>�:
>�)��Start(TaskName$,wimp_memory%,icon%)
>�%� wimp% wimp_memory%,icons% icon%
>�)� wimp_memory%<256 � wimp_memory%=256
>�icon_memory%=icons%+icon%
>�task$=TaskName$
>�)indirect_sprites%=1:direct_sprites%=1
>��SetEventVariables
>�@ș"Wimp_Initialise",200,&4B534154,TaskName$ � version%,task%
>��
>�:
?��SetEventVariables
?� pointer_block% 20
?)null%=1:draw%=2:pointer_leaving%=1<<4
? 1pointer_entering%=1<<5:mouse%=1<<6:drag%=1<<7
?*&key%=1<<8:menu%=1<<9:scroll%=1<<10
?4@lose_caret%=1<<11:gain_caret%=1<<12:message%=(1<<17)+(1<<18)
?>0recorder%=1<<18:acknowledge%=1<<19:window%=0
?H!sprites%=1:version%=0:task%=0
?R*Bar_Window%=-2:Bar_Icon%=0:Bar_Menu%=0
?\*x_origin%=0:y_origin%=0:SaveWindow%=-3
?f3message_quit%=0:message_save%=2:message_load%=3
?p!mouse_button%=2:save_event%=0
?ztop_line%=0:bottom_line%=0
?��
?�:
?���Error
?�
�X$,x%
?��3
?�	� � �
?�ș"Hourglass_Smash"
?��MenuClose
?�x%=�
?��ErrorMsg%36
?�EErrorMsg%!0=36:ErrorMsg%!12=0:ErrorMsg%!16=&81080:ErrorMsg%!20=x%
?�$(ErrorMsg%+24)="!RunImage"
?�%ș"Wimp_SendMessage",17,ErrorMsg%
@�Alert(task$,�$+Þ)
@�
@�
@$:
@.��CloseDown
@8�3:ș"Hourglass_Smash"
@B#ș"Wimp_CloseDown",task%,"TASK"
@L�
@V:
@`
��Quit
@jfinished%=�
@t�
@~:
@�
��poll
@�� mask%,event%
@�finished%=�
@�mask%=%111000011001
@��
@�&ș"Wimp_Poll",mask%,wimp% � event%
@�Ȏ event% �
@��0
@��1:�PollDrawWindow
@�"�2:ș "Wimp_OpenWindow",,wimp%
@��3:�PollCloseWindow
@��4
A�5
A
�6:�PollMouseClick
A�7:�PollSaveMessage
A�8:�PollKeyPress
A(�9:�Event_MenuChoice(menu%)
A2�10
A<�11
AF�12
AP�17,18:�PollMessages
AZ�19
Ad�
An� finished%
Ax�
A�:
A���PollDrawWindow
A�� more%
A�&ș"Wimp_RedrawWindow",,wimp%�more%
A�window%=wimp%!0
A�Ax_origin%=16+wimp%!4-wimp%!20:y_origin%=-16+wimp%!16-wimp%!24
A�ȕmore%
A� ș"Wimp_BorderWindow",,wimp%
A�,�Event_Draw(window%,x_origin%,y_origin%)
A�&ș"Wimp_GetRectangle",,wimp%�more%
A��
A��
A�:
B��PollCloseWindow
B#ș "Wimp_GetPointerInfo",,wimp%
B%window%=wimp%!12:buttons%=wimp%!8
B"(�Event_WindowClose(window%,buttons%)
B,/!wimp%=window%:ș "Wimp_CloseWindow",,wimp%
B6�
B@:
BJ��PollMouseClick
BTIbutton%=wimp%!8:window%=wimp%!12:icon%=wimp%!16:x%=wimp%!0:y%=wimp%!4
B^!x_origin%=wimp%!4-wimp%!20+16
BhȎ button% �
Br�2:�PollMenuPopUp
B|:Ȏ �Event_Save(window%) �
B�� �:�PollMouseSave
B�� �:�PollEventMouseClick
B��
B��
B��
B�:
B���PollMenuPopUp
B�menu%=�Event_Menu(window%)
B�Ȏ menu%  �
B�� �
B�
B�Ȏ window% �
B�
� -2:n%=0
C+ȕ ((Bar_Menu%!(28+n%*24))�%10000000)=0
C	n%+=1
C�
C&5ș "Wimp_CreateMenu",,Bar_Menu%,x%-64,96+n%*44+44
C0,:ș"Wimp_CreateMenu",,menu%,x%-64,y%+20
C:�
CD�
CN'wsqtitle$=�IconText(main_Window%,9)
CX�
Cb:
Cl��PollMouseSave
CvȎ icon% �
C�/� 0:� button% � &50 � �PollDragBox(window%)
C�/� 2:� button% � 5 �  �PollSaveFile(window%)
C��
C��
C�:
C���PollEventMouseClick
C�ș"Wimp_BorderIcon",,wimp%
C�2�Event_MouseClick(window%,icon%,button%,x%,y%)
C�#wimp%!0=x%:wimp%!4=y%:wimp%!8=0
C�#wimp%!12=window%:wimp%!16=icon%
C�ș"Wimp_BorderIcon",,wimp%
C��
C�:
D��PollSaveFile(window%)
D
�file$
D;wimp%!0=window%:wimp%!4=1:ș "Wimp_GetIconState",,wimp%
D file$=$(wimp%!28)
D*Ȏ �file$,".") �
D4� 0
D>=$(wimp%+4)="To save, drag the icon to a directory window"
DH(ș "Wimp_ReportError",wimp%,16,task$
DR
D\"�Event_SaveFile(file$,window%)
Df�
Dpș"Wimp_CreateMenu",-1
Dz�
D�:
D���PollDragBox(window%)
D�
�x%,y%
D�save%=window%
D�!wimp%=window%
D�"ș"Wimp_GetWindowState",,wimp%
D�,x%=wimp%!4-wimp%!20:y%=wimp%!16-wimp%!24
D�
wimp%!4=0
D� ș"Wimp_GetIconState",,wimp%
D�!wimp%=window%
D�
wimp%!4=5
D�+wimp%!8=x%+wimp%!8:wimp%!12=y%+wimp%!12
D�-wimp%!16=x%+wimp%!16:wimp%!20=y%+wimp%!20
Ewimp%!24=0:wimp%!28=0
E)wimp%!32=&7FFFFFFF:wimp%!36=&7FFFFFFF
Eș"Wimp_DragBox",,wimp%
E$�
E.:
E8��PollKeyPress
EB/window%=wimp%!0:icon%=wimp%!4:key%=wimp%!24
ELȎ �Event_Save(window%) �
EV#� �:�WimpPoll_SaveFile(window%)
E`+� �:�Event_KeyPress(window%,icon%,key%)
Ej�
Et�
E~:
E���PollSaveMessage
E��file$,window%,icon%,x%,y%
E�"ș"Wimp_GetPointerInfo",,wimp%
E�9window%=wimp%!12:icon%=wimp%!16:x%=wimp%!0:y%=wimp%!4
E�9wimp%!0=save%:wimp%!4=1:ș "Wimp_GetIconState",,wimp%
E�file$=$(wimp%!28)
E�%file$=�GetFileFromPathname(file$)
E�wimp%!20=window%
E�wimp%!24=icon%
E�wimp%!28=x%:wimp%!32=y%
E�wimp%!36=length%
E�wimp%!0=64
Fwimp%!12=0
F
wimp%!16=1
Fwimp%!40=&FFF
F$(wimp%+44)=file$
F(3ș"Wimp_SendMessage",17,wimp%,wimp%!20,wimp%!24
F2�
F<:
FF��PollMessages
FP� file$
FZ'file$=�GetStringAtAddress(wimp%+44)
Fdblock%=wimp%!16:Ȏ block% �
Fn� 0:finished%=�
Fx� 1
F�>!wimp%=(48+16) ��3:wimp%!12=wimp%!8:wimp%!16=2:wimp%!36=-1
F�-temp$=file$:$(wimp%+44)="<Wimp$Scrap>"+�0
F�)ș"Wimp_SendMessage",17,wimp%,wimp%!4
F�	�PXG
F�� 2
F� �Event_SaveFile(file$,save%)
F�wimp%!12=wimp%!8:wimp%!16=3
F�3ș"Wimp_SendMessage",17,wimp%,wimp%!20,wimp%!24
F�7�file$,"Wimp$Scrap")=0 �IconPutText(save%,1,file$)
F�� 3
F��temp$="" temp$=file$
F�/type%=wimp%!40:�Event_LoadFile(file$,type%)
F��"REMOVE <Wimp$Scrap>"
Gtemp$=""
G� &502:�help
G�
G"�
G,:
G6
��help
G@#window%=wimp%!32:icon%=wimp%!36
GJ��window%=-2 �send("This is the WordSq icon.|MClick SELECT to create or edit a wordsquare.|MClick MENU to edit a wordsquare, solve a wordsquare, set your preferences or clear all words and grid from memory."):�
GTz�window%=display_Window% �send("This is the display window.|MThe positions of any highlighted words will be shown."):�
G^��window%=words_Window% � icon%<>2 � icon%<>3 �send("This is the words window.|MIt shows a complete list of all the words in memory."):�
Gh$ș "Wimp_SendInformation",,wimp%
Gr�
G|:
G���send(d$)
G�4wimp%!12=wimp%!8:wimp%!16=&503:$(wimp%+20)=d$+�0
G�!wimp%=(25+�d$)��3
G�)ș"Wimp_SendMessage",17,wimp%,wimp%!4
G��
G�:
G� � �MenuCreateColours(title$)
G�� x$,men%,j%,i%
G�6x$=title$+"\0\1\2\3\4\5\6\7\8\9\10\11\12\13\14\15"
G�men%=�MenuCreate(x$)
G�� i%=0 � 15
G�
Ȏ � �
G�(� i%<4,i%=9,i%=12,i%=14,i%=15 : j%=7
H : j%=0
H�
Hmen%?(39+i%*24)=i%*16+j%
H&�MenuCentre(men%,i%+1)
H0�
H:	=men%
HD:
HN� �MenuCentre(menu%,item%)
HX:menu%!(36+(item%-1)*24)=menu%!(36+(item%-1)*24)�(1<<3)
Hb�
Hl:
Hv��resize(w%,a%,b%,c%,d%)
H�/!wimp%=a%:wimp%!4=b%:wimp%!8=c%:wimp%!12=d%
H�ș"Wimp_SetExtent",w%,wimp%
H�Gwimp%!0=display_Window%:wimp%!4=dispbox%:ș"Wimp_DeleteIcon",,wimp%
H�4wimp%!0=display_Window%:wimp%!4=22:wimp%!8=b%+24
H�Awimp%!12=c%-24:wimp%!16=-36:wimp%!20=&17000101:wimp%!24=text%
H�wimp%!28=valid%:wimp%!32=12
H�)ș"Wimp_CreateIcon",,wimp% � dispbox%
H�%�WindowForceDraw(display_Window%)
H�+�dispwind% �BringToTop(display_Window%)
H��
H�:
H���ww
H�a%=-240-(words%*36):b%=352
I-!wimp%=0:wimp%!4=a%:wimp%!8=b%:wimp%!12=0
I*ș"Wimp_SetExtent",words_Window%,wimp%
IFwimp%!0=words_Window%:wimp%!4=wordsbox%:ș"Wimp_DeleteIcon",,wimp%
I 2wimp%!0=words_Window%:wimp%!4=22:wimp%!8=a%+24
I*Awimp%!12=b%-24:wimp%!16=-36:wimp%!20=&17000101:wimp%!24=text%
I4wimp%!28=valid%:wimp%!32=12
I>*ș"Wimp_CreateIcon",,wimp% � wordsbox%
IH#�WindowForceDraw(words_Window%)
IR*�wordswind% �BringToTop(words_Window%)
I\�
�
00000000  0d 00 0a 1b f4 20 3e 57  6f 72 64 53 71 24 44 69  |..... >WordSq$Di|
00000010  72 2e 21 52 75 6e 49 6d  61 67 65 0d 00 14 2d f4  |r.!RunImage...-.|
00000020  20 57 6f 72 64 53 71 75  61 72 65 20 43 72 65 61  | WordSquare Crea|
00000030  74 69 6f 6e 20 61 6e 64  20 53 6f 6c 76 69 6e 67  |tion and Solving|
00000040  20 70 72 6f 67 72 61 6d  0d 00 1e 17 f4 20 42 79  | program..... By|
00000050  20 4d 61 74 74 68 65 77  20 45 67 6c 69 73 65 0d  | Matthew Eglise.|
00000060  00 28 05 f4 0d 00 32 31  f4 20 43 6f 70 79 72 69  |.(....21. Copyri|
00000070  67 68 74 20 68 65 6c 64  20 62 79 20 41 72 63 68  |ght held by Arch|
00000080  69 6d 65 64 65 73 20 57  6f 72 6c 64 20 6d 61 67  |imedes World mag|
00000090  61 7a 69 6e 65 0d 00 3c  27 f4 20 54 68 69 73 20  |azine..<'. This |
000000a0  70 72 6f 67 72 61 6d 20  69 73 20 4e 4f 54 20 50  |program is NOT P|
000000b0  75 62 6c 69 63 20 44 6f  6d 61 69 6e 0d 00 46 05  |ublic Domain..F.|
000000c0  f4 0d 00 50 28 f4 20 56  65 72 73 69 6f 6e 20 33  |...P(. Version 3|
000000d0  2e 31 32 20 2d 20 32 36  74 68 20 53 65 70 74 65  |.12 - 26th Septe|
000000e0  6d 62 65 72 20 31 39 39  32 0d 00 5a 05 f4 0d 00  |mber 1992..Z....|
000000f0  64 29 6d 65 6d 31 25 3d  39 30 34 32 3a 6d 65 6d  |d)mem1%=9042:mem|
00000100  32 25 3d 31 37 31 30 30  3a 66 69 6c 65 74 79 70  |2%=17100:filetyp|
00000110  65 25 3d 26 30 33 43 0d  00 6e 0d f2 61 75 74 6f  |e%=&03C..n..auto|
00000120  6c 6f 61 64 0d 00 78 14  c8 99 22 48 6f 75 72 67  |load..x..."Hourg|
00000130  6c 61 73 73 5f 4f 6e 22  0d 00 82 20 f2 53 74 61  |lass_On"... .Sta|
00000140  72 74 28 22 57 6f 72 64  53 71 22 2c 6d 65 6d 31  |rt("WordSq",mem1|
00000150  25 2c 6d 65 6d 32 25 29  0d 00 8c 09 f2 69 6e 69  |%,mem2%).....ini|
00000160  74 0d 00 96 13 f2 43 72  65 61 74 65 5f 57 69 6e  |t.....Create_Win|
00000170  64 6f 77 73 0d 00 a0 11  f2 43 72 65 61 74 65 5f  |dows.....Create_|
00000180  4d 65 6e 75 73 0d 00 aa  0e f2 6c 6f 61 64 70 72  |Menus.....loadpr|
00000190  65 66 73 0d 00 b4 18 e7  64 24 3c 3e 22 22 20 f2  |efs.....d$<>"" .|
000001a0  4c 6f 61 64 4f 77 6e 28  64 24 29 0d 00 be 15 c8  |LoadOwn(d$).....|
000001b0  99 22 48 6f 75 72 67 6c  61 73 73 5f 4f 66 66 22  |."Hourglass_Off"|
000001c0  0d 00 c8 14 ee 20 85 20  f2 45 72 72 6f 72 3a e5  |..... . .Error:.|
000001d0  8d 64 48 40 0d 00 d2 05  f5 0d 00 dc 09 f2 70 6f  |.dH@..........po|
000001e0  6c 6c 0d 00 e6 15 fd 20  a4 6e 65 77 28 22 71 75  |ll..... .new("qu|
000001f0  69 74 22 29 3c 3e 30 0d  00 f0 0e f2 43 6c 6f 73  |it")<>0.....Clos|
00000200  65 44 6f 77 6e 0d 00 fa  05 e0 0d 01 04 05 3a 0d  |eDown.........:.|
00000210  01 0e 0a dd f2 69 6e 69  74 0d 01 18 38 de 20 77  |.....init...8. w|
00000220  6f 72 64 24 28 31 36 38  29 2c 6c 65 6e 25 28 31  |ord$(168),len%(1|
00000230  36 38 29 2c 67 72 69 64  25 28 32 34 30 30 29 2c  |68),grid%(2400),|
00000240  73 68 6f 77 25 28 31 36  38 29 2c 62 24 28 36 30  |show%(168),b$(60|
00000250  29 0d 01 22 35 de 20 73  65 6c 65 63 74 65 64 25  |).."5. selected%|
00000260  28 31 36 38 29 2c 73 74  61 72 74 25 28 31 36 38  |(168),start%(168|
00000270  29 2c 64 69 72 25 28 31  36 38 29 2c 74 65 6d 70  |),dir%(168),temp|
00000280  24 28 31 36 38 29 0d 01  2c 29 de 20 73 78 25 28  |$(168)..,). sx%(|
00000290  31 36 38 29 2c 73 79 25  28 31 36 38 29 2c 65 78  |168),sy%(168),ex|
000002a0  25 28 31 36 38 29 2c 65  79 25 28 31 36 38 29 0d  |%(168),ey%(168).|
000002b0  01 36 2d de 20 76 61 6c  69 64 25 20 33 32 3a 24  |.6-. valid% 32:$|
000002c0  76 61 6c 69 64 25 3d 22  62 31 2c 30 2c 31 35 2c  |valid%="b1,0,15,|
000002d0  34 2c 30 2c 31 2c 31 34  2c 31 32 22 0d 01 40 17  |4,0,1,14,12"..@.|
000002e0  de 20 74 65 78 74 25 20  38 3a 24 74 65 78 74 25  |. text% 8:$text%|
000002f0  3d 22 22 0d 01 4a 3c 77  6f 72 64 73 77 69 6e 64  |=""..J<wordswind|
00000300  25 3d 30 3a 77 6f 72 64  73 25 3d 30 3a 67 72 69  |%=0:words%=0:gri|
00000310  64 25 3d 30 3a 73 65 6c  65 63 74 69 6f 6e 25 3d  |d%=0:selection%=|
00000320  30 3a 65 66 25 3d 30 3a  68 69 67 68 25 3d 30 0d  |0:ef%=0:high%=0.|
00000330  01 54 3d 6e 6f 66 69 74  25 3d 30 3a 64 69 6d 78  |.T=nofit%=0:dimx|
00000340  3d 30 3a 64 69 6d 79 3d  30 3a 6d 61 78 68 3d 30  |=0:dimy=0:maxh=0|
00000350  3a 61 3d 30 3a 6e 65 65  64 73 25 3d 30 3a 67 61  |:a=0:needs%=0:ga|
00000360  70 73 3d 32 35 3a 6c 65  6e 25 3d 30 0d 01 5e 4d  |ps=25:len%=0..^M|
00000370  77 73 71 74 69 74 6c 65  24 3d 22 22 3a 73 65 6c  |wsqtitle$="":sel|
00000380  65 63 74 65 64 77 6f 72  64 24 3d 22 22 3a 73 61  |ectedword$="":sa|
00000390  76 65 66 6f 72 6d 61 74  24 3d 22 74 65 78 74 22  |veformat$="text"|
000003a0  3a 73 6f 6c 76 65 66 6f  72 6d 61 74 24 3d 22 22  |:solveformat$=""|
000003b0  3a 74 65 6d 70 24 3d 22  22 0d 01 68 42 6d 61 69  |:temp$=""..hBmai|
000003c0  6e 77 69 6e 64 25 3d 30  3a 73 6f 6c 76 65 77 69  |nwind%=0:solvewi|
000003d0  6e 64 25 3d 30 3a 64 69  73 70 77 69 6e 64 25 3d  |nd%=0:dispwind%=|
000003e0  30 3a 77 73 71 78 3d 30  3a 77 73 71 79 3d 30 3a  |0:wsqx=0:wsqy=0:|
000003f0  77 73 71 77 6f 72 64 73  25 3d 30 0d 01 72 3f 77  |wsqwords%=0..r?w|
00000400  6f 72 64 73 73 61 76 65  64 25 3d 31 3a 67 72 69  |ordssaved%=1:gri|
00000410  64 73 61 76 65 64 25 3d  31 3a 66 6c 61 67 25 3d  |dsaved%=1:flag%=|
00000420  30 3a 73 68 6f 77 25 3d  30 3a 66 6f 75 6e 64 25  |0:show%=0:found%|
00000430  3d 30 3a 64 6f 6e 65 25  3d 30 0d 01 7c 20 73 74  |=0:done%=0..| st|
00000440  61 72 74 78 25 3d 30 3a  73 74 61 72 74 79 25 3d  |artx%=0:starty%=|
00000450  30 3a 64 69 73 70 78 25  3d 30 0d 01 86 1a 64 69  |0:dispx%=0....di|
00000460  73 70 62 6f 78 25 3d 30  3a 77 6f 72 64 73 62 6f  |spbox%=0:wordsbo|
00000470  78 25 3d 30 0d 01 90 05  e1 0d 01 9a 05 3a 0d 01  |x%=0.........:..|
00000480  a4 14 dd f2 43 72 65 61  74 65 5f 57 69 6e 64 6f  |....Create_Windo|
00000490  77 73 0d 01 ae 10 f2 53  70 72 69 74 65 73 4c 6f  |ws.....SpritesLo|
000004a0  61 64 0d 01 b8 26 73 6f  6c 76 65 5f 57 69 6e 64  |ad...&solve_Wind|
000004b0  6f 77 25 3d a4 57 69 6e  64 6f 77 4c 6f 61 64 28  |ow%=.WindowLoad(|
000004c0  22 73 6f 6c 76 65 22 29  0d 01 c2 24 69 6e 66 6f  |"solve")...$info|
000004d0  5f 57 69 6e 64 6f 77 25  3d a4 57 69 6e 64 6f 77  |_Window%=.Window|
000004e0  4c 6f 61 64 28 22 69 6e  66 6f 22 29 0d 01 cc 2e  |Load("info")....|
000004f0  73 61 76 65 77 6f 72 64  73 5f 57 69 6e 64 6f 77  |savewords_Window|
00000500  25 3d a4 57 69 6e 64 6f  77 4c 6f 61 64 28 22 73  |%=.WindowLoad("s|
00000510  61 76 65 77 6f 72 64 73  22 29 0d 01 d6 2a 64 69  |avewords")...*di|
00000520  73 70 6c 61 79 5f 57 69  6e 64 6f 77 25 3d a4 57  |splay_Window%=.W|
00000530  69 6e 64 6f 77 4c 6f 61  64 28 22 64 69 73 70 6c  |indowLoad("displ|
00000540  61 79 22 29 0d 01 e0 26  77 6f 72 64 73 5f 57 69  |ay")...&words_Wi|
00000550  6e 64 6f 77 25 3d a4 57  69 6e 64 6f 77 4c 6f 61  |ndow%=.WindowLoa|
00000560  64 28 22 77 6f 72 64 73  22 29 0d 01 ea 24 6d 61  |d("words")...$ma|
00000570  69 6e 5f 57 69 6e 64 6f  77 25 3d a4 57 69 6e 64  |in_Window%=.Wind|
00000580  6f 77 4c 6f 61 64 28 22  6d 61 69 6e 22 29 0d 01  |owLoad("main")..|
00000590  f4 2a 73 61 76 65 77 73  71 5f 57 69 6e 64 6f 77  |.*savewsq_Window|
000005a0  25 3d a4 57 69 6e 64 6f  77 4c 6f 61 64 28 22 73  |%=.WindowLoad("s|
000005b0  61 76 65 77 73 71 22 29  0d 01 fe 26 70 72 65 66  |avewsq")...&pref|
000005c0  73 5f 57 69 6e 64 6f 77  25 3d a4 57 69 6e 64 6f  |s_Window%=.Windo|
000005d0  77 4c 6f 61 64 28 22 70  72 65 66 73 22 29 0d 02  |wLoad("prefs")..|
000005e0  08 21 42 61 72 5f 49 63  6f 6e 25 3d a4 49 63 6f  |.!Bar_Icon%=.Ico|
000005f0  6e 42 61 72 28 22 21 57  6f 72 64 53 71 22 29 0d  |nBar("!WordSq").|
00000600  02 12 31 e3 49 25 3d 34  b8 31 37 31 3a f2 49 63  |..1.I%=4.171:.Ic|
00000610  6f 6e 50 75 74 54 65 78  74 28 77 6f 72 64 73 5f  |onPutText(words_|
00000620  57 69 6e 64 6f 77 25 2c  49 25 2c 22 22 29 3a ed  |Window%,I%,""):.|
00000630  0d 02 1c 07 f2 77 77 0d  02 26 05 e1 0d 02 30 05  |.....ww..&....0.|
00000640  3a 0d 02 3a 19 dd a4 45  76 65 6e 74 5f 53 61 76  |:..:...Event_Sav|
00000650  65 28 77 69 6e 64 6f 77  25 29 0d 02 44 10 c8 8e  |e(window%)..D...|
00000660  20 77 69 6e 64 6f 77 25  20 ca 0d 02 4e 1b c9 20  | window% ...N.. |
00000670  73 61 76 65 77 6f 72 64  73 5f 57 69 6e 64 6f 77  |savewords_Window|
00000680  25 20 3a 3d b9 0d 02 58  19 c9 20 73 61 76 65 77  |% :=...X.. savew|
00000690  73 71 5f 57 69 6e 64 6f  77 25 20 3a 3d b9 0d 02  |sq_Window% :=...|
000006a0  62 09 7f 20 3a 3d a3 0d  02 6c 05 cb 0d 02 76 05  |b.. :=...l....v.|
000006b0  3a 0d 02 80 12 dd f2 43  72 65 61 74 65 5f 4d 65  |:......Create_Me|
000006c0  6e 75 73 0d 02 8a 14 de  20 70 72 65 66 73 5f 4d  |nus..... prefs_M|
000006d0  65 6e 75 25 28 31 29 0d  02 94 46 6d 65 6e 75 24  |enu%(1)...Fmenu$|
000006e0  3d 22 57 6f 72 64 53 71  5c 49 6e 66 6f 3e 69 6e  |="WordSq\Info>in|
000006f0  66 6f 5f 57 69 6e 64 6f  77 25 5c 45 64 69 74 5c  |fo_Window%\Edit\|
00000700  53 6f 6c 76 65 5c 50 72  65 66 65 72 65 6e 63 65  |Solve\Preference|
00000710  73 5c 43 6c 65 61 72 5c  51 75 69 74 22 0d 02 9e  |s\Clear\Quit"...|
00000720  20 42 61 72 5f 4d 65 6e  75 25 3d a4 4d 65 6e 75  | Bar_Menu%=.Menu|
00000730  43 72 65 61 74 65 28 6d  65 6e 75 24 29 0d 02 a8  |Create(menu$)...|
00000740  30 6d 65 6e 75 24 20 3d  22 53 6f 6c 76 65 5c 49  |0menu$ ="Solve\I|
00000750  6e 66 6f 3e 69 6e 66 6f  5f 57 69 6e 64 6f 77 25  |nfo>info_Window%|
00000760  5c 53 68 6f 77 20 57 6f  72 64 73 5c 22 0d 02 b2  |\Show Words\"...|
00000770  11 6d 65 6e 75 24 2b 3d  22 51 75 69 74 22 0d 02  |.menu$+="Quit"..|
00000780  bc 22 73 6f 6c 76 65 5f  4d 65 6e 75 25 3d a4 4d  |."solve_Menu%=.M|
00000790  65 6e 75 43 72 65 61 74  65 28 6d 65 6e 75 24 29  |enuCreate(menu$)|
000007a0  0d 02 c6 36 6d 65 6e 75  24 20 3d 22 44 69 73 70  |...6menu$ ="Disp|
000007b0  6c 61 79 5c 49 6e 66 6f  3e 69 6e 66 6f 5f 57 69  |lay\Info>info_Wi|
000007c0  6e 64 6f 77 25 5c 53 68  6f 77 20 57 6f 72 64 73  |ndow%\Show Words|
000007d0  5c 51 75 69 74 22 0d 02  d0 24 64 69 73 70 6c 61  |\Quit"...$displa|
000007e0  79 5f 4d 65 6e 75 25 3d  a4 4d 65 6e 75 43 72 65  |y_Menu%=.MenuCre|
000007f0  61 74 65 28 6d 65 6e 75  24 29 0d 02 da 42 6d 65  |ate(menu$)...Bme|
00000800  6e 75 24 20 3d 22 57 6f  72 64 73 5c 49 6e 66 6f  |nu$ ="Words\Info|
00000810  3e 69 6e 66 6f 5f 57 69  6e 64 6f 77 25 5c 53 61  |>info_Window%\Sa|
00000820  76 65 20 57 6f 72 64 73  3e 73 61 76 65 77 6f 72  |ve Words>savewor|
00000830  64 73 5f 57 69 6e 64 6f  77 25 5c 22 0d 02 e4 11  |ds_Window%\"....|
00000840  6d 65 6e 75 24 2b 3d 22  51 75 69 74 22 0d 02 ee  |menu$+="Quit"...|
00000850  22 77 6f 72 64 73 5f 4d  65 6e 75 25 3d a4 4d 65  |"words_Menu%=.Me|
00000860  6e 75 43 72 65 61 74 65  28 6d 65 6e 75 24 29 0d  |nuCreate(menu$).|
00000870  02 f8 22 57 6c 4d 65 6e  75 25 3d a4 4d 65 6e 75  |.."WlMenu%=.Menu|
00000880  43 72 65 61 74 65 28 22  43 6f 6c 6f 75 72 73 22  |Create("Colours"|
00000890  29 0d 03 02 22 53 6d 4d  65 6e 75 25 3d a4 4d 65  |)..."SmMenu%=.Me|
000008a0  6e 75 43 72 65 61 74 65  28 22 43 6f 6c 6f 75 72  |nuCreate("Colour|
000008b0  73 22 29 0d 03 0c 21 4c  4d 65 6e 75 25 3d a4 4d  |s")...!LMenu%=.M|
000008c0  65 6e 75 43 72 65 61 74  65 28 22 43 6f 6c 6f 75  |enuCreate("Colou|
000008d0  72 73 22 29 0d 03 16 22  43 6c 4d 65 6e 75 25 3d  |rs")..."ClMenu%=|
000008e0  a4 4d 65 6e 75 43 72 65  61 74 65 28 22 43 6f 6c  |.MenuCreate("Col|
000008f0  6f 75 72 73 22 29 0d 03  20 5a 6d 65 6e 75 24 3d  |ours").. Zmenu$=|
00000900  22 43 6f 6c 6f 75 72 73  5c 57 6f 72 64 73 20 6c  |"Colours\Words l|
00000910  69 73 74 3e 57 6c 4d 65  6e 75 25 5c 53 74 61 72  |ist>WlMenu%\Star|
00000920  74 20 6d 61 72 6b 3e 53  6d 4d 65 6e 75 25 5c 4c  |t mark>SmMenu%\L|
00000930  69 6e 65 73 3e 4c 4d 65  6e 75 25 5c 4c 61 74 65  |ines>LMenu%\Late|
00000940  73 74 20 6c 69 6e 65 3e  43 6c 4d 65 6e 75 25 22  |st line>ClMenu%"|
00000950  0d 03 2a 25 70 72 65 66  73 5f 4d 65 6e 75 25 28  |..*%prefs_Menu%(|
00000960  31 29 3d a4 4d 65 6e 75  43 72 65 61 74 65 28 6d  |1)=.MenuCreate(m|
00000970  65 6e 75 24 29 0d 03 34  40 6d 65 6e 75 24 20 3d  |enu$)..4@menu$ =|
00000980  22 50 72 65 66 73 5c 49  6e 66 6f 3e 69 6e 66 6f  |"Prefs\Info>info|
00000990  5f 57 69 6e 64 6f 77 25  5c 43 6f 6c 6f 75 72 73  |_Window%\Colours|
000009a0  3e 70 72 65 66 73 5f 4d  65 6e 75 25 28 31 29 5c  |>prefs_Menu%(1)\|
000009b0  51 75 69 74 22 0d 03 3e  22 70 72 65 66 73 5f 4d  |Quit"..>"prefs_M|
000009c0  65 6e 75 25 3d a4 4d 65  6e 75 43 72 65 61 74 65  |enu%=.MenuCreate|
000009d0  28 6d 65 6e 75 24 29 0d  03 48 31 6d 65 6e 75 24  |(menu$)..H1menu$|
000009e0  20 3d 22 43 72 65 61 74  65 5c 49 6e 66 6f 3e 69  | ="Create\Info>i|
000009f0  6e 66 6f 5f 57 69 6e 64  6f 77 25 5c 53 68 6f 77  |nfo_Window%\Show|
00000a00  20 57 6f 72 64 73 5c 22  0d 03 52 63 6d 65 6e 75  | Words\"..Rcmenu|
00000a10  24 2b 3d 22 53 61 76 65  20 57 6f 72 64 73 3e 73  |$+="Save Words>s|
00000a20  61 76 65 77 6f 72 64 73  5f 57 69 6e 64 6f 77 25  |avewords_Window%|
00000a30  5c 53 61 76 65 20 53 71  75 61 72 65 3e 73 61 76  |\Save Square>sav|
00000a40  65 77 73 71 5f 57 69 6e  64 6f 77 25 5c 50 72 69  |ewsq_Window%\Pri|
00000a50  6e 74 20 57 6f 72 64 73  5c 50 72 69 6e 74 20 53  |nt Words\Print S|
00000a60  71 75 61 72 65 5c 51 75  69 74 22 0d 03 5c 21 6d  |quare\Quit"..\!m|
00000a70  61 69 6e 5f 4d 65 6e 75  25 3d a4 4d 65 6e 75 43  |ain_Menu%=.MenuC|
00000a80  72 65 61 74 65 28 6d 65  6e 75 24 29 0d 03 66 32  |reate(menu$)..f2|
00000a90  73 61 76 65 77 73 71 5f  4d 65 6e 75 25 3d 30 3a  |savewsq_Menu%=0:|
00000aa0  69 6e 66 6f 5f 4d 65 6e  75 25 3d 30 3a 73 61 76  |info_Menu%=0:sav|
00000ab0  65 77 6f 72 64 73 5f 4d  65 6e 75 25 3d 30 0d 03  |ewords_Menu%=0..|
00000ac0  70 1e f2 4d 65 6e 75 44  69 73 61 62 6c 65 28 6d  |p..MenuDisable(m|
00000ad0  61 69 6e 5f 4d 65 6e 75  25 2c 32 29 0d 03 7a 1e  |ain_Menu%,2)..z.|
00000ae0  f2 4d 65 6e 75 44 69 73  61 62 6c 65 28 6d 61 69  |.MenuDisable(mai|
00000af0  6e 5f 4d 65 6e 75 25 2c  33 29 0d 03 84 1e f2 4d  |n_Menu%,3).....M|
00000b00  65 6e 75 44 69 73 61 62  6c 65 28 6d 61 69 6e 5f  |enuDisable(main_|
00000b10  4d 65 6e 75 25 2c 34 29  0d 03 8e 1e f2 4d 65 6e  |Menu%,4).....Men|
00000b20  75 44 69 73 61 62 6c 65  28 6d 61 69 6e 5f 4d 65  |uDisable(main_Me|
00000b30  6e 75 25 2c 35 29 0d 03  98 1e f2 4d 65 6e 75 44  |nu%,5).....MenuD|
00000b40  69 73 61 62 6c 65 28 6d  61 69 6e 5f 4d 65 6e 75  |isable(main_Menu|
00000b50  25 2c 36 29 0d 03 a2 1f  f2 4d 65 6e 75 44 69 73  |%,6).....MenuDis|
00000b60  61 62 6c 65 28 73 6f 6c  76 65 5f 4d 65 6e 75 25  |able(solve_Menu%|
00000b70  2c 32 29 0d 03 ac 21 f2  4d 65 6e 75 44 69 73 61  |,2)...!.MenuDisa|
00000b80  62 6c 65 28 64 69 73 70  6c 61 79 5f 4d 65 6e 75  |ble(display_Menu|
00000b90  25 2c 32 29 0d 03 b6 05  e1 0d 03 c0 05 3a 0d 03  |%,2).........:..|
00000ba0  ca 19 dd a4 45 76 65 6e  74 5f 4d 65 6e 75 28 77  |....Event_Menu(w|
00000bb0  69 6e 64 6f 77 25 29 0d  03 d4 10 c8 8e 20 77 69  |indow%)...... wi|
00000bc0  6e 64 6f 77 25 20 ca 0d  03 de 1c c9 20 42 61 72  |ndow% ...... Bar|
00000bd0  5f 57 69 6e 64 6f 77 25  3a 3d 42 61 72 5f 4d 65  |_Window%:=Bar_Me|
00000be0  6e 75 25 0d 03 e8 20 c9  20 73 6f 6c 76 65 5f 57  |nu%... . solve_W|
00000bf0  69 6e 64 6f 77 25 3a 3d  73 6f 6c 76 65 5f 4d 65  |indow%:=solve_Me|
00000c00  6e 75 25 0d 03 f2 24 c9  20 64 69 73 70 6c 61 79  |nu%...$. display|
00000c10  5f 57 69 6e 64 6f 77 25  3a 3d 64 69 73 70 6c 61  |_Window%:=displa|
00000c20  79 5f 4d 65 6e 75 25 0d  03 fc 20 c9 20 77 6f 72  |y_Menu%... . wor|
00000c30  64 73 5f 57 69 6e 64 6f  77 25 3a 3d 77 6f 72 64  |ds_Window%:=word|
00000c40  73 5f 4d 65 6e 75 25 0d  04 06 1e c9 20 6d 61 69  |s_Menu%..... mai|
00000c50  6e 5f 57 69 6e 64 6f 77  25 3a 3d 6d 61 69 6e 5f  |n_Window%:=main_|
00000c60  4d 65 6e 75 25 0d 04 10  20 c9 20 70 72 65 66 73  |Menu%... . prefs|
00000c70  5f 57 69 6e 64 6f 77 25  3a 3d 70 72 65 66 73 5f  |_Window%:=prefs_|
00000c80  4d 65 6e 75 25 0d 04 1a  08 7f 3a 3d a3 0d 04 24  |Menu%.....:=...$|
00000c90  05 cb 0d 04 2e 05 3a 0d  04 38 29 dd f2 45 76 65  |......:..8)..Eve|
00000ca0  6e 74 5f 57 69 6e 64 6f  77 43 6c 6f 73 65 28 77  |nt_WindowClose(w|
00000cb0  69 6e 64 6f 77 25 2c 62  75 74 74 6f 6e 73 25 29  |indow%,buttons%)|
00000cc0  0d 04 42 10 c8 8e 20 77  69 6e 64 6f 77 25 20 ca  |..B... window% .|
00000cd0  0d 04 4c 20 c9 20 73 6f  6c 76 65 5f 57 69 6e 64  |..L . solve_Wind|
00000ce0  6f 77 25 3a 73 6f 6c 76  65 77 69 6e 64 25 3d 30  |ow%:solvewind%=0|
00000cf0  0d 04 56 12 c9 20 69 6e  66 6f 5f 57 69 6e 64 6f  |..V.. info_Windo|
00000d00  77 25 0d 04 60 17 c9 20  73 61 76 65 77 6f 72 64  |w%..`.. saveword|
00000d10  73 5f 57 69 6e 64 6f 77  25 0d 04 6a 21 c9 20 64  |s_Window%..j!. d|
00000d20  69 73 70 6c 61 79 5f 57  69 6e 64 6f 77 25 3a 64  |isplay_Window%:d|
00000d30  69 73 70 77 69 6e 64 25  3d 30 0d 04 74 6c c9 20  |ispwind%=0..tl. |
00000d40  77 6f 72 64 73 5f 57 69  6e 64 6f 77 25 3a 77 6f  |words_Window%:wo|
00000d50  72 64 73 77 69 6e 64 25  3d 30 3a f2 4d 65 6e 75  |rdswind%=0:.Menu|
00000d60  54 69 63 6b 28 6d 61 69  6e 5f 4d 65 6e 75 25 2c  |Tick(main_Menu%,|
00000d70  32 29 3a f2 4d 65 6e 75  54 69 63 6b 28 73 6f 6c  |2):.MenuTick(sol|
00000d80  76 65 5f 4d 65 6e 75 25  2c 32 29 3a f2 4d 65 6e  |ve_Menu%,2):.Men|
00000d90  75 54 69 63 6b 28 64 69  73 70 6c 61 79 5f 4d 65  |uTick(display_Me|
00000da0  6e 75 25 2c 32 29 0d 04  7e 1e c9 20 6d 61 69 6e  |nu%,2)..~.. main|
00000db0  5f 57 69 6e 64 6f 77 25  3a 6d 61 69 6e 77 69 6e  |_Window%:mainwin|
00000dc0  64 25 3d 30 0d 04 88 15  c9 20 73 61 76 65 77 73  |d%=0..... savews|
00000dd0  71 5f 57 69 6e 64 6f 77  25 0d 04 92 13 c9 20 70  |q_Window%..... p|
00000de0  72 65 66 73 5f 57 69 6e  64 6f 77 25 0d 04 9c 05  |refs_Window%....|
00000df0  cb 0d 04 a6 05 e1 0d 04  b0 05 3a 0d 04 ba 2d dd  |..........:...-.|
00000e00  f2 45 76 65 6e 74 5f 44  72 61 77 28 77 69 6e 64  |.Event_Draw(wind|
00000e10  6f 77 25 2c 78 5f 6f 72  69 67 69 6e 25 2c 79 5f  |ow%,x_origin%,y_|
00000e20  6f 72 69 67 69 6e 25 29  0d 04 c4 10 c8 8e 20 77  |origin%)...... w|
00000e30  69 6e 64 6f 77 25 20 ca  0d 04 ce 28 c9 20 73 61  |indow% ....(. sa|
00000e40  76 65 77 73 71 5f 57 69  6e 64 6f 77 25 3a f2 44  |vewsq_Window%:.D|
00000e50  72 61 77 73 61 76 65 77  73 71 57 69 6e 64 6f 77  |rawsavewsqWindow|
00000e60  0d 04 d8 24 c9 20 73 6f  6c 76 65 5f 57 69 6e 64  |...$. solve_Wind|
00000e70  6f 77 25 3a f2 44 72 61  77 73 6f 6c 76 65 57 69  |ow%:.DrawsolveWi|
00000e80  6e 64 6f 77 0d 04 e2 22  c9 20 69 6e 66 6f 5f 57  |ndow...". info_W|
00000e90  69 6e 64 6f 77 25 3a f2  44 72 61 77 69 6e 66 6f  |indow%:.Drawinfo|
00000ea0  57 69 6e 64 6f 77 0d 04  ec 2c c9 20 73 61 76 65  |Window...,. save|
00000eb0  77 6f 72 64 73 5f 57 69  6e 64 6f 77 25 3a f2 44  |words_Window%:.D|
00000ec0  72 61 77 73 61 76 65 77  6f 72 64 73 57 69 6e 64  |rawsavewordsWind|
00000ed0  6f 77 0d 04 f6 24 c9 20  70 72 65 66 73 5f 57 69  |ow...$. prefs_Wi|
00000ee0  6e 64 6f 77 25 3a f2 44  72 61 77 70 72 65 66 73  |ndow%:.Drawprefs|
00000ef0  57 69 6e 64 6f 77 0d 05  00 28 c9 20 64 69 73 70  |Window...(. disp|
00000f00  6c 61 79 5f 57 69 6e 64  6f 77 25 3a f2 44 72 61  |lay_Window%:.Dra|
00000f10  77 64 69 73 70 6c 61 79  57 69 6e 64 6f 77 0d 05  |wdisplayWindow..|
00000f20  0a 24 c9 20 77 6f 72 64  73 5f 57 69 6e 64 6f 77  |.$. words_Window|
00000f30  25 3a f2 44 72 61 77 77  6f 72 64 73 57 69 6e 64  |%:.DrawwordsWind|
00000f40  6f 77 0d 05 14 22 c9 20  6d 61 69 6e 5f 57 69 6e  |ow...". main_Win|
00000f50  64 6f 77 25 3a f2 44 72  61 77 6d 61 69 6e 57 69  |dow%:.DrawmainWi|
00000f60  6e 64 6f 77 0d 05 1e 05  cb 0d 05 28 05 e1 0d 05  |ndow.......(....|
00000f70  32 05 3a 0d 05 3c 17 dd  f2 44 72 61 77 73 61 76  |2.:..<...Drawsav|
00000f80  65 77 73 71 57 69 6e 64  6f 77 0d 05 46 05 e1 0d  |ewsqWindow..F...|
00000f90  05 50 05 3a 0d 05 5a 15  dd f2 44 72 61 77 73 6f  |.P.:..Z...Drawso|
00000fa0  6c 76 65 57 69 6e 64 6f  77 0d 05 64 05 e1 0d 05  |lveWindow..d....|
00000fb0  6e 05 3a 0d 05 78 14 dd  f2 44 72 61 77 69 6e 66  |n.:..x...Drawinf|
00000fc0  6f 57 69 6e 64 6f 77 0d  05 82 05 e1 0d 05 8c 05  |oWindow.........|
00000fd0  3a 0d 05 96 19 dd f2 44  72 61 77 73 61 76 65 77  |:......Drawsavew|
00000fe0  6f 72 64 73 57 69 6e 64  6f 77 0d 05 a0 05 e1 0d  |ordsWindow......|
00000ff0  05 aa 05 3a 0d 05 b4 15  dd f2 44 72 61 77 70 72  |...:......Drawpr|
00001000  65 66 73 57 69 6e 64 6f  77 0d 05 be 05 e1 0d 05  |efsWindow.......|
00001010  c8 05 3a 0d 05 d2 15 dd  f2 44 72 61 77 77 6f 72  |..:......Drawwor|
00001020  64 73 57 69 6e 64 6f 77  0d 05 dc 05 e1 0d 05 e6  |dsWindow........|
00001030  05 3a 0d 05 f0 14 dd f2  44 72 61 77 6d 61 69 6e  |.:......Drawmain|
00001040  57 69 6e 64 6f 77 0d 05  fa 05 e1 0d 06 04 05 3a  |Window.........:|
00001050  0d 06 0e 17 dd f2 44 72  61 77 64 69 73 70 6c 61  |......Drawdispla|
00001060  79 57 69 6e 64 6f 77 0d  06 18 65 e7 73 74 61 72  |yWindow...e.star|
00001070  74 78 25 3c 3e 30 20 80  20 73 74 61 72 74 79 25  |tx%<>0 . starty%|
00001080  3c 3e 30 20 c8 99 22 57  69 6d 70 5f 53 65 74 43  |<>0 .."Wimp_SetC|
00001090  6f 6c 6f 75 72 22 2c 6d  63 6f 6c 25 3a c8 93 20  |olour",mcol%:.. |
000010a0  c8 90 20 78 5f 6f 72 69  67 69 6e 25 2b 73 74 61  |.. x_origin%+sta|
000010b0  72 74 78 25 2c 79 5f 6f  72 69 67 69 6e 25 2b 73  |rtx%,y_origin%+s|
000010c0  74 61 72 74 79 25 2c 32  32 2c 33 32 0d 06 22 10  |tarty%,22,32..".|
000010d0  e3 49 25 3d 31 b8 77 6f  72 64 73 25 0d 06 2c 34  |.I%=1.words%..,4|
000010e0  e7 73 68 6f 77 25 28 49  25 29 3d 30 20 84 20 28  |.show%(I%)=0 . (|
000010f0  73 74 61 72 74 25 28 49  25 29 3d 30 20 80 20 64  |start%(I%)=0 . d|
00001100  69 72 25 28 49 25 29 3d  30 29 20 e5 8d 44 4a 46  |ir%(I%)=0) ..DJF|
00001110  0d 06 36 40 e7 49 25 3d  73 68 6f 77 25 20 c8 99  |..6@.I%=show% ..|
00001120  22 57 69 6d 70 5f 53 65  74 43 6f 6c 6f 75 72 22  |"Wimp_SetColour"|
00001130  2c 6c 63 6f 6c 25 20 8b  20 c8 99 22 57 69 6d 70  |,lcol% . .."Wimp|
00001140  5f 53 65 74 43 6f 6c 6f  75 72 22 2c 63 6f 6c 25  |_SetColour",col%|
00001150  0d 06 40 4d 86 20 78 5f  6f 72 69 67 69 6e 25 2b  |..@M. x_origin%+|
00001160  73 78 25 28 49 25 29 2c  79 5f 6f 72 69 67 69 6e  |sx%(I%),y_origin|
00001170  25 2d 73 79 25 28 49 25  29 2c 78 5f 6f 72 69 67  |%-sy%(I%),x_orig|
00001180  69 6e 25 2b 65 78 25 28  49 25 29 2c 79 5f 6f 72  |in%+ex%(I%),y_or|
00001190  69 67 69 6e 25 2d 65 79  25 28 49 25 29 0d 06 4a  |igin%-ey%(I%)..J|
000011a0  05 ed 0d 06 54 17 64 69  73 70 78 25 3d 78 5f 6f  |....T.dispx%=x_o|
000011b0  72 69 67 69 6e 25 2d 31  38 0d 06 5e 05 e1 0d 06  |rigin%-18..^....|
000011c0  68 05 3a 0d 06 72 33 dd  f2 45 76 65 6e 74 5f 4d  |h.:..r3..Event_M|
000011d0  6f 75 73 65 43 6c 69 63  6b 28 77 69 6e 64 6f 77  |ouseClick(window|
000011e0  25 2c 69 63 6f 6e 25 2c  62 75 74 74 6f 6e 25 2c  |%,icon%,button%,|
000011f0  78 25 2c 79 25 29 0d 06  7c 10 c8 8e 20 77 69 6e  |x%,y%)..|... win|
00001200  64 6f 77 25 20 ca 0d 06  86 1b c9 20 42 61 72 5f  |dow% ...... Bar_|
00001210  57 69 6e 64 6f 77 25 3a  f2 4d 6f 75 73 65 42 61  |Window%:.MouseBa|
00001220  72 0d 06 90 2e c9 20 73  6f 6c 76 65 5f 57 69 6e  |r..... solve_Win|
00001230  64 6f 77 25 3a f2 4d 6f  75 73 65 73 6f 6c 76 65  |dow%:.Mousesolve|
00001240  28 62 75 74 74 6f 6e 25  2c 69 63 6f 6e 25 29 0d  |(button%,icon%).|
00001250  06 9a 2c c9 20 69 6e 66  6f 5f 57 69 6e 64 6f 77  |..,. info_Window|
00001260  25 3a f2 4d 6f 75 73 65  69 6e 66 6f 28 62 75 74  |%:.Mouseinfo(but|
00001270  74 6f 6e 25 2c 69 63 6f  6e 25 29 0d 06 a4 32 c9  |ton%,icon%)...2.|
00001280  20 64 69 73 70 6c 61 79  5f 57 69 6e 64 6f 77 25  | display_Window%|
00001290  3a f2 4d 6f 75 73 65 64  69 73 70 6c 61 79 28 62  |:.Mousedisplay(b|
000012a0  75 74 74 6f 6e 25 2c 69  63 6f 6e 25 29 0d 06 ae  |utton%,icon%)...|
000012b0  2e c9 20 70 72 65 66 73  5f 57 69 6e 64 6f 77 25  |.. prefs_Window%|
000012c0  3a f2 4d 6f 75 73 65 70  72 65 66 73 28 62 75 74  |:.Mouseprefs(but|
000012d0  74 6f 6e 25 2c 69 63 6f  6e 25 29 0d 06 b8 2e c9  |ton%,icon%).....|
000012e0  20 77 6f 72 64 73 5f 57  69 6e 64 6f 77 25 3a f2  | words_Window%:.|
000012f0  4d 6f 75 73 65 77 6f 72  64 73 28 62 75 74 74 6f  |Mousewords(butto|
00001300  6e 25 2c 69 63 6f 6e 25  29 0d 06 c2 2c c9 20 6d  |n%,icon%)...,. m|
00001310  61 69 6e 5f 57 69 6e 64  6f 77 25 3a f2 4d 6f 75  |ain_Window%:.Mou|
00001320  73 65 6d 61 69 6e 28 62  75 74 74 6f 6e 25 2c 69  |semain(button%,i|
00001330  63 6f 6e 25 29 0d 06 cc  05 cb 0d 06 d6 05 e1 0d  |con%)...........|
00001340  06 e0 05 3a 0d 06 ea 0e  dd f2 4d 6f 75 73 65 42  |...:......MouseB|
00001350  61 72 0d 06 f4 29 f2 42  72 69 6e 67 54 6f 54 6f  |ar...).BringToTo|
00001360  70 28 6d 61 69 6e 5f 57  69 6e 64 6f 77 25 29 3a  |p(main_Window%):|
00001370  6d 61 69 6e 77 69 6e 64  25 3d 31 0d 06 fe 05 e1  |mainwind%=1.....|
00001380  0d 07 08 05 3a 0d 07 12  1f dd f2 4d 6f 75 73 65  |....:......Mouse|
00001390  70 72 65 66 73 28 62 75  74 74 6f 6e 25 2c 69 63  |prefs(button%,ic|
000013a0  6f 6e 25 29 0d 07 1c 0e  c8 8e 20 69 63 6f 6e 25  |on%)...... icon%|
000013b0  20 ca 0d 07 26 2e c9 20  31 3a f2 73 61 76 65 70  | ...&.. 1:.savep|
000013c0  72 65 66 73 3a f2 57 69  6e 64 6f 77 43 6c 6f 73  |refs:.WindowClos|
000013d0  65 28 70 72 65 66 73 5f  57 69 6e 64 6f 77 25 29  |e(prefs_Window%)|
000013e0  0d 07 30 2e c9 20 31 31  3a f2 67 65 74 70 72 65  |..0.. 11:.getpre|
000013f0  66 73 3a f2 57 69 6e 64  6f 77 43 6c 6f 73 65 28  |fs:.WindowClose(|
00001400  70 72 65 66 73 5f 57 69  6e 64 6f 77 25 29 0d 07  |prefs_Window%)..|
00001410  3a 24 c9 20 31 32 3a f2  57 69 6e 64 6f 77 43 6c  |:$. 12:.WindowCl|
00001420  6f 73 65 28 70 72 65 66  73 5f 57 69 6e 64 6f 77  |ose(prefs_Window|
00001430  25 29 0d 07 44 3b e7 74  65 6d 70 64 62 6c 25 3c  |%)..D;.tempdbl%<|
00001440  3e 64 62 6c 25 20 f2 53  65 74 49 63 6f 6e 28 70  |>dbl% .SetIcon(p|
00001450  72 65 66 73 5f 57 69 6e  64 6f 77 25 2c 33 29 3a  |refs_Window%,3):|
00001460  74 65 6d 70 64 62 6c 25  3d 64 62 6c 25 0d 07 4e  |tempdbl%=dbl%..N|
00001470  5b e7 74 65 6d 70 63 61  70 73 25 3c 3e 63 61 70  |[.tempcaps%<>cap|
00001480  73 25 20 f2 53 65 74 49  63 6f 6e 28 70 72 65 66  |s% .SetIcon(pref|
00001490  73 5f 57 69 6e 64 6f 77  25 2c 32 39 29 3a f2 53  |s_Window%,29):.S|
000014a0  65 74 49 63 6f 6e 28 70  72 65 66 73 5f 57 69 6e  |etIcon(prefs_Win|
000014b0  64 6f 77 25 2c 33 30 29  3a 74 65 6d 70 63 61 70  |dow%,30):tempcap|
000014c0  73 25 3d 63 61 70 73 25  0d 07 58 5f e7 74 65 6d  |s%=caps%..X_.tem|
000014d0  70 66 6f 72 63 65 25 3c  3e 66 6f 72 63 65 25 20  |pforce%<>force% |
000014e0  f2 53 65 74 49 63 6f 6e  28 70 72 65 66 73 5f 57  |.SetIcon(prefs_W|
000014f0  69 6e 64 6f 77 25 2c 34  35 29 3a f2 53 65 74 49  |indow%,45):.SetI|
00001500  63 6f 6e 28 70 72 65 66  73 5f 57 69 6e 64 6f 77  |con(prefs_Window|
00001510  25 2c 34 36 29 3a 74 65  6d 70 66 6f 72 63 65 25  |%,46):tempforce%|
00001520  3d 66 6f 72 63 65 25 0d  07 62 31 e7 74 65 6d 70  |=force%..b1.temp|
00001530  74 69 74 6c 65 70 74 25  3c 3e 74 69 74 6c 65 70  |titlept%<>titlep|
00001540  74 25 20 74 65 6d 70 74  69 74 6c 65 70 74 25 3d  |t% temptitlept%=|
00001550  74 69 74 6c 65 70 74 25  0d 07 6c 2d e7 74 65 6d  |titlept%..l-.tem|
00001560  70 67 72 69 64 70 74 25  3c 3e 67 72 69 64 70 74  |pgridpt%<>gridpt|
00001570  25 20 74 65 6d 70 67 72  69 64 70 74 25 3d 67 72  |% tempgridpt%=gr|
00001580  69 64 70 74 25 0d 07 76  31 e7 74 65 6d 70 77 6f  |idpt%..v1.tempwo|
00001590  72 64 73 70 74 25 3c 3e  77 6f 72 64 73 70 74 25  |rdspt%<>wordspt%|
000015a0  20 74 65 6d 70 77 6f 72  64 73 70 74 25 3d 77 6f  | tempwordspt%=wo|
000015b0  72 64 73 70 74 25 0d 07  80 21 e7 74 65 6d 70 63  |rdspt%...!.tempc|
000015c0  6f 6c 25 3c 3e 63 6f 6c  25 20 74 65 6d 70 63 6f  |ol%<>col% tempco|
000015d0  6c 25 3d 63 6f 6c 25 0d  07 8a 25 e7 74 65 6d 70  |l%=col%...%.temp|
000015e0  6d 63 6f 6c 25 3c 3e 6d  63 6f 6c 25 20 74 65 6d  |mcol%<>mcol% tem|
000015f0  70 6d 63 6f 6c 25 3d 6d  63 6f 6c 25 0d 07 94 25  |pmcol%=mcol%...%|
00001600  e7 74 65 6d 70 77 63 6f  6c 25 3c 3e 77 63 6f 6c  |.tempwcol%<>wcol|
00001610  25 20 74 65 6d 70 77 63  6f 6c 25 3d 77 63 6f 6c  |% tempwcol%=wcol|
00001620  25 0d 07 9e 25 e7 74 65  6d 70 6c 63 6f 6c 25 3c  |%...%.templcol%<|
00001630  3e 6c 63 6f 6c 25 20 74  65 6d 70 6c 63 6f 6c 25  |>lcol% templcol%|
00001640  3d 6c 63 6f 6c 25 0d 07  a8 0d f2 73 65 74 70 72  |=lcol%.....setpr|
00001650  65 66 73 0d 07 b2 2e c9  20 33 3a e7 20 74 65 6d  |efs..... 3:. tem|
00001660  70 64 62 6c 25 3d 2d 31  20 74 65 6d 70 64 62 6c  |pdbl%=-1 tempdbl|
00001670  25 3d 30 20 8b 20 74 65  6d 70 64 62 6c 25 3d 2d  |%=0 . tempdbl%=-|
00001680  31 0d 07 bc 3d c9 20 32  39 3a e7 62 75 74 74 6f  |1...=. 29:.butto|
00001690  6e 25 3d 31 20 80 20 74  65 6d 70 63 61 70 73 25  |n%=1 . tempcaps%|
000016a0  3d 2d 31 20 f2 53 65 74  49 63 6f 6e 28 70 72 65  |=-1 .SetIcon(pre|
000016b0  66 73 5f 57 69 6e 64 6f  77 25 2c 32 39 29 0d 07  |fs_Window%,29)..|
000016c0  c6 10 74 65 6d 70 63 61  70 73 25 3d 2d 31 0d 07  |..tempcaps%=-1..|
000016d0  d0 3c c9 20 33 30 3a e7  62 75 74 74 6f 6e 25 3d  |.<. 30:.button%=|
000016e0  31 20 80 20 74 65 6d 70  63 61 70 73 25 3d 30 20  |1 . tempcaps%=0 |
000016f0  f2 53 65 74 49 63 6f 6e  28 70 72 65 66 73 5f 57  |.SetIcon(prefs_W|
00001700  69 6e 64 6f 77 25 2c 33  30 29 0d 07 da 0f 74 65  |indow%,30)....te|
00001710  6d 70 63 61 70 73 25 3d  30 0d 07 e4 3a c9 20 33  |mpcaps%=0...:. 3|
00001720  31 2c 33 33 3a 74 65 6d  70 74 69 74 6c 65 70 74  |1,33:temptitlept|
00001730  25 3d a4 62 75 6d 70 70  74 28 69 63 6f 6e 25 2d  |%=.bumppt(icon%-|
00001740  33 32 2c 74 65 6d 70 74  69 74 6c 65 70 74 25 2c  |32,temptitlept%,|
00001750  33 32 29 0d 07 ee 38 c9  20 33 34 2c 33 36 3a 74  |32)...8. 34,36:t|
00001760  65 6d 70 67 72 69 64 70  74 25 3d a4 62 75 6d 70  |empgridpt%=.bump|
00001770  70 74 28 69 63 6f 6e 25  2d 33 35 2c 74 65 6d 70  |pt(icon%-35,temp|
00001780  67 72 69 64 70 74 25 2c  33 35 29 0d 07 f8 3a c9  |gridpt%,35)...:.|
00001790  20 33 37 2c 33 39 3a 74  65 6d 70 77 6f 72 64 73  | 37,39:tempwords|
000017a0  70 74 25 3d a4 62 75 6d  70 70 74 28 69 63 6f 6e  |pt%=.bumppt(icon|
000017b0  25 2d 33 38 2c 74 65 6d  70 77 6f 72 64 73 70 74  |%-38,tempwordspt|
000017c0  25 2c 33 38 29 0d 08 02  3f c9 20 34 35 3a e7 20  |%,38)...?. 45:. |
000017d0  62 75 74 74 6f 6e 25 3d  31 20 80 20 74 65 6d 70  |button%=1 . temp|
000017e0  66 6f 72 63 65 25 3d 2d  31 20 f2 53 65 74 49 63  |force%=-1 .SetIc|
000017f0  6f 6e 28 70 72 65 66 73  5f 57 69 6e 64 6f 77 25  |on(prefs_Window%|
00001800  2c 34 35 29 0d 08 0c 11  74 65 6d 70 66 6f 72 63  |,45)....tempforc|
00001810  65 25 3d 2d 31 0d 08 16  3e c9 20 34 36 3a e7 20  |e%=-1...>. 46:. |
00001820  62 75 74 74 6f 6e 25 3d  31 20 80 20 74 65 6d 70  |button%=1 . temp|
00001830  66 6f 72 63 65 25 3d 30  20 f2 53 65 74 49 63 6f  |force%=0 .SetIco|
00001840  6e 28 70 72 65 66 73 5f  57 69 6e 64 6f 77 25 2c  |n(prefs_Window%,|
00001850  34 35 29 0d 08 20 10 74  65 6d 70 66 6f 72 63 65  |45).. .tempforce|
00001860  25 3d 30 0d 08 2a 30 7f  3a f2 41 6c 65 72 74 28  |%=0..*0.:.Alert(|
00001870  22 57 6f 72 64 53 71 22  2c 22 49 6e 76 61 6c 69  |"WordSq","Invali|
00001880  64 20 54 65 6d 70 6c 61  74 65 73 20 66 69 6c 65  |d Templates file|
00001890  2e 22 29 0d 08 34 05 cb  0d 08 3e 05 e1 0d 08 48  |.")..4....>....H|
000018a0  05 3a 0d 08 52 1f dd f2  4d 6f 75 73 65 73 6f 6c  |.:..R...Mousesol|
000018b0  76 65 28 62 75 74 74 6f  6e 25 2c 69 63 6f 6e 25  |ve(button%,icon%|
000018c0  29 0d 08 5c 1e e7 62 75  74 74 6f 6e 25 3c 3e 31  |)..\..button%<>1|
000018d0  20 80 20 62 75 74 74 6f  6e 25 3c 3e 34 20 e1 0d  | . button%<>4 ..|
000018e0  08 66 83 e7 73 6f 6c 76  65 66 6f 72 6d 61 74 24  |.f..solveformat$|
000018f0  3d 22 22 20 f2 41 6c 65  72 74 28 22 57 6f 72 64  |="" .Alert("Word|
00001900  53 71 22 2c 22 4e 6f 20  77 6f 72 64 73 71 75 61  |Sq","No wordsqua|
00001910  72 65 20 69 73 20 63 75  72 72 65 6e 74 6c 79 20  |re is currently |
00001920  61 76 61 69 6c 61 62 6c  65 20 2d 20 65 69 74 68  |available - eith|
00001930  65 72 20 63 72 65 61 74  65 20 6f 6e 65 20 6f 72  |er create one or|
00001940  20 6c 6f 61 64 20 61 20  70 6c 61 69 6e 20 74 65  | load a plain te|
00001950  78 74 20 77 6f 72 64 73  71 75 61 72 65 2e 22 29  |xt wordsquare.")|
00001960  3a e1 0d 08 70 40 e7 69  63 6f 6e 25 3d 39 20 80  |:...p@.icon%=9 .|
00001970  20 28 73 65 6c 65 63 74  69 6f 6e 25 3d 30 20 80  | (selection%=0 .|
00001980  20 a4 49 63 6f 6e 54 65  78 74 28 73 6f 6c 76 65  | .IconText(solve|
00001990  5f 57 69 6e 64 6f 77 25  2c 31 37 29 3d 22 22 29  |_Window%,17)="")|
000019a0  20 e1 0d 08 7a 0e c8 8e  20 69 63 6f 6e 25 20 ca  | ...z... icon% .|
000019b0  0d 08 84 3f c9 20 38 3a  f2 42 72 69 6e 67 54 6f  |...?. 8:.BringTo|
000019c0  54 6f 70 28 64 69 73 70  6c 61 79 5f 57 69 6e 64  |Top(display_Wind|
000019d0  6f 77 25 29 3a 64 69 73  70 77 69 6e 64 25 3d 31  |ow%):dispwind%=1|
000019e0  3a f2 72 65 6d 6f 76 65  70 72 65 73 73 65 64 0d  |:.removepressed.|
000019f0  08 8e 3d c9 20 39 3a f2  42 72 69 6e 67 54 6f 54  |..=. 9:.BringToT|
00001a00  6f 70 28 64 69 73 70 6c  61 79 5f 57 69 6e 64 6f  |op(display_Windo|
00001a10  77 25 29 3a 64 69 73 70  77 69 6e 64 25 3d 31 3a  |w%):dispwind%=1:|
00001a20  f2 73 68 6f 77 70 72 65  73 73 65 64 0d 08 98 3a  |.showpressed...:|
00001a30  c9 20 31 31 3a f2 42 72  69 6e 67 54 6f 54 6f 70  |. 11:.BringToTop|
00001a40  28 64 69 73 70 6c 61 79  5f 57 69 6e 64 6f 77 25  |(display_Window%|
00001a50  29 3a 64 69 73 70 77 69  6e 64 25 3d 31 3a f2 73  |):dispwind%=1:.s|
00001a60  68 6f 77 61 6c 6c 0d 08  a2 13 c9 20 31 30 3a f2  |howall..... 10:.|
00001a70  72 65 6d 6f 76 65 61 6c  6c 0d 08 ac 30 7f 3a f2  |removeall...0.:.|
00001a80  41 6c 65 72 74 28 22 57  6f 72 64 53 71 22 2c 22  |Alert("WordSq","|
00001a90  49 6e 76 61 6c 69 64 20  54 65 6d 70 6c 61 74 65  |Invalid Template|
00001aa0  73 20 66 69 6c 65 2e 22  29 0d 08 b6 05 cb 0d 08  |s file.").......|
00001ab0  c0 05 e1 0d 08 ca 05 3a  0d 08 d4 21 dd f2 4d 6f  |.......:...!..Mo|
00001ac0  75 73 65 64 69 73 70 6c  61 79 28 62 75 74 74 6f  |usedisplay(butto|
00001ad0  6e 25 2c 69 63 6f 6e 25  29 0d 08 de 1e e7 62 75  |n%,icon%).....bu|
00001ae0  74 74 6f 6e 25 3c 3e 34  20 80 20 62 75 74 74 6f  |tton%<>4 . butto|
00001af0  6e 25 3c 3e 31 20 e1 0d  08 e8 13 e7 69 63 6f 6e  |n%<>1 ......icon|
00001b00  25 2d 31 3e 77 73 71 79  20 e1 0d 08 f2 54 21 77  |%-1>wsqy ....T!w|
00001b10  69 6d 70 25 3d 64 69 73  70 6c 61 79 5f 57 69 6e  |imp%=display_Win|
00001b20  64 6f 77 25 3a c8 99 20  22 57 69 6d 70 5f 47 65  |dow%:.. "Wimp_Ge|
00001b30  74 57 69 6e 64 6f 77 53  74 61 74 65 22 2c 2c 77  |tWindowState",,w|
00001b40  69 6d 70 25 3a 64 69 73  70 78 25 3d 77 69 6d 70  |imp%:dispx%=wimp|
00001b50  25 21 34 2d 77 69 6d 70  25 21 32 30 2d 32 0d 08  |%!4-wimp%!20-2..|
00001b60  fc 7b e7 62 75 74 74 6f  6e 25 3d 34 20 73 74 61  |.{.button%=4 sta|
00001b70  72 74 70 6f 73 25 3d 30  3a 73 74 61 72 74 78 25  |rtpos%=0:startx%|
00001b80  3d 30 3a 73 74 61 72 74  79 25 3d 30 3a 65 6e 64  |=0:starty%=0:end|
00001b90  70 6f 73 25 3d 30 20 8b  20 e7 62 75 74 74 6f 6e  |pos%=0 . .button|
00001ba0  25 3d 31 20 80 20 73 74  61 72 74 70 6f 73 25 3d  |%=1 . startpos%=|
00001bb0  30 20 62 75 74 74 6f 6e  25 3d 34 3a 73 74 61 72  |0 button%=4:star|
00001bc0  74 78 25 3d 30 3a 73 74  61 72 74 79 25 3d 30 3a  |tx%=0:starty%=0:|
00001bd0  65 6e 64 70 6f 73 25 3d  30 0d 09 06 2c 69 63 6f  |endpos%=0...,ico|
00001be0  6e 25 2d 3d 31 3a 69 25  3d 28 28 32 34 2b 28 28  |n%-=1:i%=((24+((|
00001bf0  78 25 2d 64 69 73 70 78  25 29 2f 31 36 29 29 2f  |x%-dispx%)/16))/|
00001c00  32 29 2d 31 32 0d 09 10  0e e7 69 25 3e 77 73 71  |2)-12.....i%>wsq|
00001c10  78 20 e1 0d 09 1a 1a 70  25 3d 28 28 69 63 6f 6e  |x .....p%=((icon|
00001c20  25 2d 31 29 2a 77 73 71  78 29 2b 69 25 0d 09 24  |%-1)*wsqx)+i%..$|
00001c30  10 c8 8e 20 62 75 74 74  6f 6e 25 20 ca 0d 09 2e  |... button% ....|
00001c40  14 c9 20 34 3a 73 74 61  72 74 70 6f 73 25 3d 70  |.. 4:startpos%=p|
00001c50  25 0d 09 38 37 73 74 61  72 74 78 25 3d 32 32 2b  |%..87startx%=22+|
00001c60  28 28 69 25 2d 31 29 2a  33 32 29 2d 38 3a 73 74  |((i%-1)*32)-8:st|
00001c70  61 72 74 79 25 3d 2d 38  34 2d 28 28 69 63 6f 6e  |arty%=-84-((icon|
00001c80  25 2d 31 29 2a 34 34 29  0d 09 42 12 c9 20 31 3a  |%-1)*44)..B.. 1:|
00001c90  65 6e 64 70 6f 73 25 3d  70 25 0d 09 4c 44 64 24  |endpos%=p%..LDd$|
00001ca0  3d a4 67 65 74 77 6f 72  64 28 73 74 61 72 74 70  |=.getword(startp|
00001cb0  6f 73 25 2c 65 6e 64 70  6f 73 25 29 3a f2 49 63  |os%,endpos%):.Ic|
00001cc0  6f 6e 50 75 74 54 65 78  74 28 73 6f 6c 76 65 5f  |onPutText(solve_|
00001cd0  57 69 6e 64 6f 77 25 2c  31 37 2c 64 24 29 0d 09  |Window%,17,d$)..|
00001ce0  56 29 e7 73 74 61 72 74  70 6f 73 25 3c 3e 65 6e  |V).startpos%<>en|
00001cf0  64 70 6f 73 25 20 80 20  6f 25 3d 31 20 80 20 64  |dpos% . o%=1 . d|
00001d00  24 3c 3e 22 22 20 8c 0d  09 60 18 f2 63 61 72 65  |$<>"" ...`..care|
00001d10  74 28 28 a9 64 24 2f 32  29 2b 31 30 30 30 29 0d  |t((.d$/2)+1000).|
00001d20  09 6a 26 65 78 25 3d a4  65 78 69 73 74 73 28 64  |.j&ex%=.exists(d|
00001d30  24 29 3a 70 25 3d a4 70  61 6c 69 6e 64 72 6f 6d  |$):p%=.palindrom|
00001d40  65 28 64 24 29 0d 09 74  5e e7 65 78 25 3d 30 20  |e(d$)..t^.ex%=0 |
00001d50  f2 41 6c 65 72 74 28 22  57 6f 72 64 53 71 22 2c  |.Alert("WordSq",|
00001d60  22 54 68 65 20 77 6f 72  64 20 27 22 2b 64 24 2b  |"The word '"+d$+|
00001d70  22 27 20 64 6f 65 73 20  6e 6f 74 20 65 78 69 73  |"' does not exis|
00001d80  74 20 69 6e 20 74 68 65  20 63 75 72 72 65 6e 74  |t in the current|
00001d90  20 77 6f 72 64 20 6c 69  73 74 2e 22 29 3a e5 8d  | word list."):..|
00001da0  74 5c 49 0d 09 7e ba e7  65 78 25 3e 30 20 80 20  |t\I..~..ex%>0 . |
00001db0  73 74 61 72 74 70 6f 73  25 3c 3e 30 20 80 20 65  |startpos%<>0 . e|
00001dc0  6e 64 70 6f 73 25 3c 3e  30 20 80 20 73 74 61 72  |ndpos%<>0 . star|
00001dd0  74 70 6f 73 25 3c 3e 73  74 61 72 74 25 28 65 78  |tpos%<>start%(ex|
00001de0  25 29 20 80 20 70 25 3d  30 20 f2 41 6c 65 72 74  |%) . p%=0 .Alert|
00001df0  28 22 57 6f 72 64 53 71  22 2c 22 41 6c 74 68 6f  |("WordSq","Altho|
00001e00  75 67 68 20 74 68 65 20  77 6f 72 64 20 22 2b 64  |ugh the word "+d|
00001e10  24 2b 22 20 64 6f 65 73  20 65 78 69 73 74 20 69  |$+" does exist i|
00001e20  6e 20 74 68 65 20 63 75  72 72 65 6e 74 20 77 6f  |n the current wo|
00001e30  72 64 73 71 75 61 72 65  2c 20 69 74 20 69 73 20  |rdsquare, it is |
00001e40  6e 6f 74 20 61 74 20 74  68 69 73 20 70 6f 73 69  |not at this posi|
00001e50  74 69 6f 6e 2e 22 29 3a  e5 8d 74 5c 49 0d 09 88  |tion."):..t\I...|
00001e60  5b e7 65 78 25 3e 30 20  80 20 73 74 61 72 74 70  |[.ex%>0 . startp|
00001e70  6f 73 25 3c 3e 30 20 80  20 65 6e 64 70 6f 73 25  |os%<>0 . endpos%|
00001e80  3c 3e 30 20 80 20 73 74  61 72 74 70 6f 73 25 3c  |<>0 . startpos%<|
00001e90  3e 73 74 61 72 74 25 28  65 78 25 29 20 80 20 70  |>start%(ex%) . p|
00001ea0  25 3d 31 20 c8 94 20 73  74 61 72 74 70 6f 73 25  |%=1 .. startpos%|
00001eb0  2c 65 6e 64 70 6f 73 25  0d 09 92 62 e7 65 78 25  |,endpos%...b.ex%|
00001ec0  3e 30 3a e7 73 68 6f 77  25 28 65 78 25 29 3d 30  |>0:.show%(ex%)=0|
00001ed0  20 68 69 67 68 25 2b 3d  31 3a 73 68 6f 77 25 28  | high%+=1:show%(|
00001ee0  65 78 25 29 3d 32 3a f2  73 69 63 28 77 6f 72 64  |ex%)=2:.sic(word|
00001ef0  73 5f 57 69 6e 64 6f 77  25 2c 65 78 25 2b 33 2c  |s_Window%,ex%+3,|
00001f00  77 63 6f 6c 25 29 3a 73  68 6f 77 25 3d 65 78 25  |wcol%):show%=ex%|
00001f10  3a 66 6f 75 6e 64 25 2b  3d 31 0d 09 9c 2d 73 74  |:found%+=1...-st|
00001f20  61 72 74 78 25 3d 30 3a  73 74 61 72 74 79 25 3d  |artx%=0:starty%=|
00001f30  30 3a 73 74 61 72 74 70  6f 73 25 3d 30 3a 65 6e  |0:startpos%=0:en|
00001f40  64 70 6f 73 25 3d 30 0d  09 a6 05 cd 0d 09 b0 05  |dpos%=0.........|
00001f50  cb 0d 09 ba 25 f2 57 69  6e 64 6f 77 46 6f 72 63  |....%.WindowForc|
00001f60  65 44 72 61 77 28 64 69  73 70 6c 61 79 5f 57 69  |eDraw(display_Wi|
00001f70  6e 64 6f 77 25 29 0d 09  c4 15 f2 75 70 64 61 74  |ndow%).....updat|
00001f80  65 73 6f 6c 76 65 73 74  61 74 65 0d 09 ce 1a e7  |esolvestate.....|
00001f90  73 6f 6c 76 65 66 6f 72  6d 61 74 24 3c 3e 22 6f  |solveformat$<>"o|
00001fa0  77 6e 22 20 e1 0d 09 d8  6b e7 66 6f 75 6e 64 25  |wn" ....k.found%|
00001fb0  3d 77 73 71 77 6f 72 64  73 25 20 80 20 64 6f 6e  |=wsqwords% . don|
00001fc0  65 25 3d 30 20 80 77 73  71 77 6f 72 64 73 25 3d  |e%=0 .wsqwords%=|
00001fd0  31 20 f2 41 6c 65 72 74  28 22 57 6f 72 64 53 71  |1 .Alert("WordSq|
00001fe0  22 2c 22 57 65 6c 6c 20  44 6f 6e 65 2c 20 79 6f  |","Well Done, yo|
00001ff0  75 27 76 65 20 66 6f 75  6e 64 20 74 68 65 20 77  |u've found the w|
00002000  6f 72 64 2e 22 29 3a 64  6f 6e 65 25 3d 31 3a e1  |ord."):done%=1:.|
00002010  0d 09 e2 a7 e7 68 69 67  68 25 3d 77 73 71 77 6f  |.....high%=wsqwo|
00002020  72 64 73 25 20 80 20 66  6f 75 6e 64 25 3c 77 73  |rds% . found%<ws|
00002030  71 77 6f 72 64 73 25 20  80 20 64 6f 6e 65 25 3d  |qwords% . done%=|
00002040  30 20 80 20 77 73 71 77  6f 72 64 73 25 3d 31 20  |0 . wsqwords%=1 |
00002050  80 20 66 6f 75 6e 64 25  3e 30 20 f2 41 6c 65 72  |. found%>0 .Aler|
00002060  74 28 22 57 6f 72 64 53  71 22 2c 22 41 6c 74 68  |t("WordSq","Alth|
00002070  6f 75 67 68 20 79 6f 75  20 68 61 76 65 20 66 6f  |ough you have fo|
00002080  75 6e 64 20 74 68 65 20  77 6f 72 64 2c 20 79 6f  |und the word, yo|
00002090  75 20 68 61 64 20 74 6f  20 73 65 65 6b 20 68 65  |u had to seek he|
000020a0  6c 70 20 77 69 74 68 20  69 74 2e 22 29 3a 64 6f  |lp with it."):do|
000020b0  6e 65 25 3d 31 3a e1 0d  09 ec 7c e7 66 6f 75 6e  |ne%=1:....|.foun|
000020c0  64 25 3d 77 73 71 77 6f  72 64 73 25 20 80 20 64  |d%=wsqwords% . d|
000020d0  6f 6e 65 25 3d 30 20 f2  41 6c 65 72 74 28 22 57  |one%=0 .Alert("W|
000020e0  6f 72 64 53 71 22 2c 22  57 65 6c 6c 20 44 6f 6e  |ordSq","Well Don|
000020f0  65 2c 20 79 6f 75 27 76  65 20 66 6f 75 6e 64 20  |e, you've found |
00002100  61 6c 6c 20 22 2b a4 6f  6e 65 6f 72 6d 6f 72 65  |all "+.oneormore|
00002110  28 77 73 71 77 6f 72 64  73 25 29 2b 22 69 6e 20  |(wsqwords%)+"in |
00002120  74 68 65 20 67 72 69 64  2e 22 29 3a 64 6f 6e 65  |the grid."):done|
00002130  25 3d 31 0d 09 f6 d4 e7  68 69 67 68 25 3d 77 73  |%=1.....high%=ws|
00002140  71 77 6f 72 64 73 25 20  80 20 66 6f 75 6e 64 25  |qwords% . found%|
00002150  3c 77 73 71 77 6f 72 64  73 25 20 80 20 64 6f 6e  |<wsqwords% . don|
00002160  65 25 3d 30 20 80 20 66  6f 75 6e 64 25 3e 30 20  |e%=0 . found%>0 |
00002170  f2 41 6c 65 72 74 28 22  57 6f 72 64 53 71 22 2c  |.Alert("WordSq",|
00002180  22 41 6c 74 68 6f 75 67  68 20 79 6f 75 20 68 61  |"Although you ha|
00002190  76 65 20 66 6f 75 6e 64  20 61 6c 6c 20 22 2b a4  |ve found all "+.|
000021a0  6f 6e 65 6f 72 6d 6f 72  65 28 77 73 71 77 6f 72  |oneormore(wsqwor|
000021b0  64 73 25 29 2b 22 69 6e  20 74 68 65 20 67 72 69  |ds%)+"in the gri|
000021c0  64 2c 20 79 6f 75 20 68  61 64 20 74 6f 20 73 65  |d, you had to se|
000021d0  65 6b 20 68 65 6c 70 20  77 69 74 68 20 22 2b c3  |ek help with "+.|
000021e0  28 77 73 71 77 6f 72 64  73 25 2d 66 6f 75 6e 64  |(wsqwords%-found|
000021f0  25 29 2b 22 20 6f 66 20  74 68 65 6d 2e 22 29 3a  |%)+" of them."):|
00002200  64 6f 6e 65 25 3d 31 0d  0a 00 05 e1 0d 0a 0a 05  |done%=1.........|
00002210  3a 0d 0a 14 11 dd f2 73  68 6f 77 70 72 65 73 73  |:......showpress|
00002220  65 64 0d 0a 1e 38 e7 73  6f 6c 76 65 66 6f 72 6d  |ed...8.solveform|
00002230  61 74 24 3d 22 22 20 f2  49 63 6f 6e 50 75 74 54  |at$="" .IconPutT|
00002240  65 78 74 28 73 6f 6c 76  65 5f 57 69 6e 64 6f 77  |ext(solve_Window|
00002250  25 2c 31 37 2c 22 22 29  3a e1 0d 0a 28 34 67 69  |%,17,""):...(4gi|
00002260  62 62 65 74 24 3d a4 49  63 6f 6e 54 65 78 74 28  |bbet$=.IconText(|
00002270  73 6f 6c 76 65 5f 57 69  6e 64 6f 77 25 2c 31 37  |solve_Window%,17|
00002280  29 3a 6e 65 65 64 25 3d  30 3a 46 25 3d 30 0d 0a  |):need%=0:F%=0..|
00002290  32 18 65 78 25 3d a4 65  78 69 73 74 73 28 67 69  |2.ex%=.exists(gi|
000022a0  62 62 65 74 24 29 0d 0a  3c 68 e7 63 61 70 73 25  |bbet$)..<h.caps%|
000022b0  3d 2d 31 20 f2 49 63 6f  6e 50 75 74 54 65 78 74  |=-1 .IconPutText|
000022c0  28 6d 61 69 6e 5f 57 69  6e 64 6f 77 25 2c 32 36  |(main_Window%,26|
000022d0  2c a4 63 61 70 73 28 67  69 62 62 65 74 24 29 29  |,.caps(gibbet$))|
000022e0  3a f2 49 63 6f 6e 50 75  74 54 65 78 74 28 73 6f  |:.IconPutText(so|
000022f0  6c 76 65 5f 57 69 6e 64  6f 77 25 2c 31 37 2c a4  |lve_Window%,17,.|
00002300  63 61 70 73 28 67 69 62  62 65 74 24 29 29 0d 0a  |caps(gibbet$))..|
00002310  46 29 e7 a4 6c 65 6e 28  67 69 62 62 65 74 24 29  |F)..len(gibbet$)|
00002320  3c 33 20 80 20 73 65 6c  65 63 74 69 6f 6e 25 3d  |<3 . selection%=|
00002330  30 20 e5 8d 54 4e 4b 0d  0a 50 6f e7 73 65 6c 65  |0 ..TNK..Po.sele|
00002340  63 74 69 6f 6e 25 3d 30  20 80 20 73 6f 6c 76 65  |ction%=0 . solve|
00002350  66 6f 72 6d 61 74 24 3d  22 74 65 78 74 22 20 80  |format$="text" .|
00002360  20 65 78 25 3d 30 20 f2  66 69 6e 64 28 a4 63 61  | ex%=0 .find(.ca|
00002370  70 73 28 67 69 62 62 65  74 24 29 29 3a f2 49 63  |ps(gibbet$)):.Ic|
00002380  6f 6e 50 75 74 54 65 78  74 28 6d 61 69 6e 5f 57  |onPutText(main_W|
00002390  69 6e 64 6f 77 25 2c 32  30 2c c3 67 61 70 73 29  |indow%,20,.gaps)|
000023a0  3a e5 8d 54 44 4b 0d 0a  5a 28 e7 73 65 6c 65 63  |:..TDK..Z(.selec|
000023b0  74 69 6f 6e 25 3d 30 20  80 20 73 6f 6c 76 65 66  |tion%=0 . solvef|
000023c0  6f 72 6d 61 74 24 3d 22  6f 77 6e 22 20 8c 0d 0a  |ormat$="own" ...|
000023d0  64 63 e7 65 78 25 3d 30  20 f2 41 6c 65 72 74 28  |dc.ex%=0 .Alert(|
000023e0  22 57 6f 72 64 53 71 22  2c 22 54 68 65 20 77 6f  |"WordSq","The wo|
000023f0  72 64 20 27 22 2b 67 69  62 62 65 74 24 2b 22 27  |rd '"+gibbet$+"'|
00002400  20 64 6f 65 73 20 6e 6f  74 20 65 78 69 73 74 20  | does not exist |
00002410  69 6e 20 74 68 65 20 63  75 72 72 65 6e 74 20 77  |in the current w|
00002420  6f 72 64 20 6c 69 73 74  2e 22 29 3a e5 8d 74 42  |ord list."):..tB|
00002430  4a 0d 0a 6e b8 e7 65 78  25 3e 30 20 80 20 73 74  |J..n..ex%>0 . st|
00002440  61 72 74 70 6f 73 25 3c  3e 30 20 80 20 65 6e 64  |artpos%<>0 . end|
00002450  70 6f 73 25 3c 3e 30 20  80 20 73 74 61 72 74 70  |pos%<>0 . startp|
00002460  6f 73 25 3c 3e 73 74 61  72 74 25 28 65 78 25 29  |os%<>start%(ex%)|
00002470  20 f2 41 6c 65 72 74 28  22 57 6f 72 64 53 71 22  | .Alert("WordSq"|
00002480  2c 22 41 6c 74 68 6f 75  67 68 20 74 68 65 20 77  |,"Although the w|
00002490  6f 72 64 20 22 2b 67 69  62 62 65 74 24 2b 22 20  |ord "+gibbet$+" |
000024a0  64 6f 65 73 20 65 78 69  73 74 20 69 6e 20 74 68  |does exist in th|
000024b0  65 20 63 75 72 72 65 6e  74 20 77 6f 72 64 73 71  |e current wordsq|
000024c0  75 61 72 65 2c 20 69 74  20 69 73 20 6e 6f 74 20  |uare, it is not |
000024d0  61 74 20 74 68 69 73 20  70 6f 73 69 74 69 6f 6e  |at this position|
000024e0  2e 22 29 3a e5 8d 74 42  4a 0d 0a 78 60 e7 65 78  |."):..tBJ..x`.ex|
000024f0  25 3e 30 20 6e 65 65 64  25 3d 31 3a e7 73 68 6f  |%>0 need%=1:.sho|
00002500  77 25 28 65 78 25 29 3d  30 20 68 69 67 68 25 2b  |w%(ex%)=0 high%+|
00002510  3d 31 3a 73 68 6f 77 25  28 65 78 25 29 3d 31 3a  |=1:show%(ex%)=1:|
00002520  f2 73 69 63 28 77 6f 72  64 73 5f 57 69 6e 64 6f  |.sic(words_Windo|
00002530  77 25 2c 65 78 25 2b 33  2c 77 63 6f 6c 25 29 3a  |w%,ex%+3,wcol%):|
00002540  73 68 6f 77 25 3d 65 78  25 0d 0a 82 05 cd 0d 0a  |show%=ex%.......|
00002550  8c 2d e7 73 65 6c 65 63  74 69 6f 6e 25 3d 30 20  |.-.selection%=0 |
00002560  80 20 73 6f 6c 76 65 66  6f 72 6d 61 74 24 3d 22  |. solveformat$="|
00002570  6f 77 6e 22 20 e5 20 8d  54 4e 4b 0d 0a 96 13 e7  |own" . .TNK.....|
00002580  73 65 6c 65 63 74 69 6f  6e 25 3e 30 20 8c 0d 0a  |selection%>0 ...|
00002590  a0 a5 6f 25 3d 30 3a e3  49 25 3d 31 b8 77 6f 72  |..o%=0:.I%=1.wor|
000025a0  64 73 25 3a e7 73 65 6c  65 63 74 65 64 25 28 49  |ds%:.selected%(I|
000025b0  25 29 3d 31 20 80 20 73  74 61 72 74 25 28 49 25  |%)=1 . start%(I%|
000025c0  29 3d 30 20 80 20 64 69  72 25 28 49 25 29 3d 30  |)=0 . dir%(I%)=0|
000025d0  20 6f 25 2b 3d 31 20 8b  20 e7 73 65 6c 65 63 74  | o%+=1 . .select|
000025e0  65 64 25 28 49 25 29 3d  31 20 80 20 73 68 6f 77  |ed%(I%)=1 . show|
000025f0  25 28 49 25 29 3d 30 20  68 69 67 68 25 2b 3d 31  |%(I%)=0 high%+=1|
00002600  3a 73 68 6f 77 25 28 49  25 29 3d 31 3a 6e 65 65  |:show%(I%)=1:nee|
00002610  64 25 3d 31 3a f2 73 69  63 28 77 6f 72 64 73 5f  |d%=1:.sic(words_|
00002620  57 69 6e 64 6f 77 25 2c  49 25 2b 33 2c 77 63 6f  |Window%,I%+3,wco|
00002630  6c 25 29 0d 0a aa 05 ed  0d 0a b4 19 e7 73 65 6c  |l%)..........sel|
00002640  65 63 74 69 6f 6e 25 3e  31 20 73 68 6f 77 25 3d  |ection%>1 show%=|
00002650  30 0d 0a be 0b e7 6f 25  3e 30 20 8c 0d 0a c8 21  |0.....o%>0 ....!|
00002660  e7 6f 25 3d 31 20 6f 24  3d 22 20 64 6f 65 73 20  |.o%=1 o$=" does |
00002670  22 20 8b 20 6f 24 3d 22  20 64 6f 20 22 0d 0a d2  |" . o$=" do "...|
00002680  66 e7 6f 25 3d 31 20 80  20 73 65 6c 65 63 74 69  |f.o%=1 . selecti|
00002690  6f 6e 25 3d 31 20 64 24  3d 22 54 68 69 73 20 77  |on%=1 d$="This w|
000026a0  6f 72 64 20 64 6f 65 73  20 22 3a 8b 20 64 24 3d  |ord does ":. d$=|
000026b0  a4 6f 6e 65 6f 72 6d 6f  72 65 28 6f 25 29 2b 22  |.oneormore(o%)+"|
000026c0  61 6d 6f 6e 67 73 74 20  74 68 65 20 73 65 6c 65  |amongst the sele|
000026d0  63 74 69 6f 6e 22 2b 6f  24 3a 6f 24 3d 22 74 68  |ction"+o$:o$="th|
000026e0  65 79 22 0d 0a dc 11 e7  6f 25 3d 31 20 6f 24 3d  |ey".....o%=1 o$=|
000026f0  22 69 74 22 0d 0a e6 5b  f2 41 6c 65 72 74 28 22  |"it"...[.Alert("|
00002700  57 6f 72 64 53 71 22 2c  64 24 2b 22 6e 6f 74 20  |WordSq",d$+"not |
00002710  61 70 70 65 61 72 20 69  6e 20 74 68 65 20 63 75  |appear in the cu|
00002720  72 72 65 6e 74 20 77 6f  72 64 73 71 75 61 72 65  |rrent wordsquare|
00002730  20 73 6f 20 22 2b 6f 24  2b 22 20 77 69 6c 6c 20  | so "+o$+" will |
00002740  6e 6f 74 20 62 65 20 73  68 6f 77 6e 2e 22 29 0d  |not be shown.").|
00002750  0a f0 05 cd 0d 0a fa 05  cd 0d 0b 04 11 6f 25 3d  |.............o%=|
00002760  73 65 6c 65 63 74 69 6f  6e 25 0d 0b 0e 5a f2 63  |selection%...Z.c|
00002770  6c 65 61 72 61 6c 6c 3a  f2 49 63 6f 6e 50 75 74  |learall:.IconPut|
00002780  54 65 78 74 28 6d 61 69  6e 5f 57 69 6e 64 6f 77  |Text(main_Window|
00002790  25 2c 32 36 2c 22 22 29  3a f2 49 63 6f 6e 50 75  |%,26,""):.IconPu|
000027a0  74 54 65 78 74 28 73 6f  6c 76 65 5f 57 69 6e 64  |tText(solve_Wind|
000027b0  6f 77 25 2c 31 37 2c 22  22 29 3a f2 63 61 72 65  |ow%,17,""):.care|
000027c0  74 28 30 29 0d 0b 18 ae  e7 77 6f 72 64 73 25 3d  |t(0).....words%=|
000027d0  31 3a f2 4d 65 6e 75 45  6e 61 62 6c 65 28 6d 61  |1:.MenuEnable(ma|
000027e0  69 6e 5f 4d 65 6e 75 25  2c 32 29 3a f2 4d 65 6e  |in_Menu%,2):.Men|
000027f0  75 45 6e 61 62 6c 65 28  6d 61 69 6e 5f 4d 65 6e  |uEnable(main_Men|
00002800  75 25 2c 33 29 3a f2 4d  65 6e 75 45 6e 61 62 6c  |u%,3):.MenuEnabl|
00002810  65 28 6d 61 69 6e 5f 4d  65 6e 75 25 2c 35 29 3a  |e(main_Menu%,5):|
00002820  f2 4d 65 6e 75 45 6e 61  62 6c 65 28 73 6f 6c 76  |.MenuEnable(solv|
00002830  65 5f 4d 65 6e 75 25 2c  32 29 3a f2 4d 65 6e 75  |e_Menu%,2):.Menu|
00002840  45 6e 61 62 6c 65 28 77  6f 72 64 73 5f 4d 65 6e  |Enable(words_Men|
00002850  75 25 2c 32 29 3a f2 4d  65 6e 75 45 6e 61 62 6c  |u%,2):.MenuEnabl|
00002860  65 28 64 69 73 70 6c 61  79 5f 4d 65 6e 75 25 2c  |e(display_Menu%,|
00002870  32 29 0d 0b 22 15 e7 77  6f 72 64 73 25 3d 30 20  |2).."..words%=0 |
00002880  64 6f 6e 65 25 3d 30 0d  0b 2c 17 73 74 61 72 74  |done%=0..,.start|
00002890  78 25 3d 30 3a 73 74 61  72 74 79 25 3d 30 0d 0b  |x%=0:starty%=0..|
000028a0  36 25 f2 57 69 6e 64 6f  77 46 6f 72 63 65 44 72  |6%.WindowForceDr|
000028b0  61 77 28 64 69 73 70 6c  61 79 5f 57 69 6e 64 6f  |aw(display_Windo|
000028c0  77 25 29 0d 0b 40 44 f2  75 70 64 61 74 65 73 6f  |w%)..@D.updateso|
000028d0  6c 76 65 73 74 61 74 65  3a e7 73 6f 6c 76 65 66  |lvestate:.solvef|
000028e0  6f 72 6d 61 74 24 3c 3e  22 6f 77 6e 22 20 84 6f  |ormat$<>"own" .o|
000028f0  25 3e 3d 77 73 71 77 6f  72 64 73 25 20 84 64 6f  |%>=wsqwords% .do|
00002900  6e 65 25 3d 31 20 e1 0d  0b 4a 8c e7 68 69 67 68  |ne%=1 ...J..high|
00002910  25 3d 77 73 71 77 6f 72  64 73 25 20 80 20 66 6f  |%=wsqwords% . fo|
00002920  75 6e 64 25 3c 77 73 71  77 6f 72 64 73 25 20 80  |und%<wsqwords% .|
00002930  77 73 71 77 6f 72 64 73  25 3d 31 20 f2 41 6c 65  |wsqwords%=1 .Ale|
00002940  72 74 28 22 57 6f 72 64  53 71 22 2c 22 41 6c 74  |rt("WordSq","Alt|
00002950  68 6f 75 67 68 20 79 6f  75 20 66 6f 75 6e 64 20  |hough you found |
00002960  74 68 65 20 77 6f 72 64  2c 20 79 6f 75 20 68 61  |the word, you ha|
00002970  64 20 74 6f 20 73 65 65  6b 20 68 65 6c 70 20 77  |d to seek help w|
00002980  69 74 68 20 69 74 2e 22  29 3a 64 6f 6e 65 25 3d  |ith it."):done%=|
00002990  31 3a e1 0d 0b 54 ca e7  68 69 67 68 25 3d 77 73  |1:...T..high%=ws|
000029a0  71 77 6f 72 64 73 25 20  80 20 66 6f 75 6e 64 25  |qwords% . found%|
000029b0  3c 77 73 71 77 6f 72 64  73 25 20 80 20 66 6f 75  |<wsqwords% . fou|
000029c0  6e 64 25 3e 30 20 f2 41  6c 65 72 74 28 22 57 6f  |nd%>0 .Alert("Wo|
000029d0  72 64 53 71 22 2c 22 41  6c 74 68 6f 75 67 68 20  |rdSq","Although |
000029e0  79 6f 75 20 68 61 76 65  20 66 6f 75 6e 64 20 61  |you have found a|
000029f0  6c 6c 20 22 2b a4 6f 6e  65 6f 72 6d 6f 72 65 28  |ll "+.oneormore(|
00002a00  77 73 71 77 6f 72 64 73  25 29 2b 22 69 6e 20 74  |wsqwords%)+"in t|
00002a10  68 65 20 67 72 69 64 2c  20 79 6f 75 20 68 61 64  |he grid, you had|
00002a20  20 74 6f 20 73 65 65 6b  20 68 65 6c 70 20 77 69  | to seek help wi|
00002a30  74 68 20 22 2b c3 28 77  73 71 77 6f 72 64 73 25  |th "+.(wsqwords%|
00002a40  2d 66 6f 75 6e 64 25 29  2b 22 20 6f 66 20 74 68  |-found%)+" of th|
00002a50  65 6d 2e 22 29 3a 64 6f  6e 65 25 3d 31 0d 0b 5e  |em."):done%=1..^|
00002a60  05 e1 0d 0b 68 05 3a 0d  0b 72 13 dd f2 72 65 6d  |....h.:..r...rem|
00002a70  6f 76 65 70 72 65 73 73  65 64 0d 0b 7c 42 e7 73  |ovepressed..|B.s|
00002a80  6f 6c 76 65 66 6f 72 6d  61 74 24 3d 22 22 20 f2  |olveformat$="" .|
00002a90  49 63 6f 6e 50 75 74 54  65 78 74 28 73 6f 6c 76  |IconPutText(solv|
00002aa0  65 5f 57 69 6e 64 6f 77  25 2c 31 37 2c 22 22 29  |e_Window%,17,"")|
00002ab0  3a f2 63 61 72 65 74 28  30 29 3a e1 0d 0b 86 13  |:.caret(0):.....|
00002ac0  e7 73 65 6c 65 63 74 69  6f 6e 25 3d 30 20 e1 0d  |.selection%=0 ..|
00002ad0  0b 90 18 6e 65 65 64 25  3d 30 3a e3 49 25 3d 31  |...need%=0:.I%=1|
00002ae0  b8 77 6f 72 64 73 25 0d  0b 9a 2c e7 73 68 6f 77  |.words%...,.show|
00002af0  25 28 49 25 29 3d 32 20  80 20 73 65 6c 65 63 74  |%(I%)=2 . select|
00002b00  65 64 25 28 49 25 29 3d  31 20 66 6f 75 6e 64 25  |ed%(I%)=1 found%|
00002b10  2d 3d 31 0d 0b a4 6c e7  73 65 6c 65 63 74 65 64  |-=1...l.selected|
00002b20  25 28 49 25 29 3d 31 20  80 20 73 68 6f 77 25 28  |%(I%)=1 . show%(|
00002b30  49 25 29 3e 30 20 68 69  67 68 25 2d 3d 31 3a 73  |I%)>0 high%-=1:s|
00002b40  68 6f 77 25 28 49 25 29  3d 30 3a 6e 65 65 64 25  |how%(I%)=0:need%|
00002b50  3d 31 3a f2 73 69 63 28  77 6f 72 64 73 5f 57 69  |=1:.sic(words_Wi|
00002b60  6e 64 6f 77 25 2c 49 25  2b 33 2c 37 29 3a e7 49  |ndow%,I%+3,7):.I|
00002b70  25 3d 73 68 6f 77 25 20  73 68 6f 77 25 3d 30 0d  |%=show% show%=0.|
00002b80  0b ae 05 ed 0d 0b b8 0b  64 6f 6e 65 25 3d 30 0d  |........done%=0.|
00002b90  0b c2 5a f2 63 6c 65 61  72 61 6c 6c 3a f2 49 63  |..Z.clearall:.Ic|
00002ba0  6f 6e 50 75 74 54 65 78  74 28 6d 61 69 6e 5f 57  |onPutText(main_W|
00002bb0  69 6e 64 6f 77 25 2c 32  36 2c 22 22 29 3a f2 49  |indow%,26,""):.I|
00002bc0  63 6f 6e 50 75 74 54 65  78 74 28 73 6f 6c 76 65  |conPutText(solve|
00002bd0  5f 57 69 6e 64 6f 77 25  2c 31 37 2c 22 22 29 3a  |_Window%,17,""):|
00002be0  f2 63 61 72 65 74 28 30  29 0d 0b cc 2c e7 6e 65  |.caret(0)...,.ne|
00002bf0  65 64 25 20 f2 57 69 6e  64 6f 77 46 6f 72 63 65  |ed% .WindowForce|
00002c00  44 72 61 77 28 64 69 73  70 6c 61 79 5f 57 69 6e  |Draw(display_Win|
00002c10  64 6f 77 25 29 0d 0b d6  15 f2 75 70 64 61 74 65  |dow%).....update|
00002c20  73 6f 6c 76 65 73 74 61  74 65 0d 0b e0 05 e1 0d  |solvestate......|
00002c30  0b ea 05 3a 0d 0b f4 1e  dd f2 4d 6f 75 73 65 69  |...:......Mousei|
00002c40  6e 66 6f 28 62 75 74 74  6f 6e 25 2c 69 63 6f 6e  |nfo(button%,icon|
00002c50  25 29 0d 0b fe 05 e1 0d  0c 08 05 3a 0d 0c 12 1f  |%).........:....|
00002c60  dd f2 4d 6f 75 73 65 77  6f 72 64 73 28 62 75 74  |..Mousewords(but|
00002c70  74 6f 6e 25 2c 69 63 6f  6e 25 29 0d 0c 1c 20 e7  |ton%,icon%)... .|
00002c80  69 63 6f 6e 25 3e 33 20  80 20 69 63 6f 6e 25 3c  |icon%>3 . icon%<|
00002c90  3d 77 6f 72 64 73 25 2b  33 20 8c 0d 0c 26 10 c8  |=words%+3 ...&..|
00002ca0  8e 20 62 75 74 74 6f 6e  25 20 ca 0d 0c 30 08 c9  |. button% ...0..|
00002cb0  20 34 3a 0d 0c 3a 4e e3  49 25 3d 31 b8 77 6f 72  | 4:..:N.I%=1.wor|
00002cc0  64 73 25 3a e7 73 65 6c  65 63 74 65 64 25 28 49  |ds%:.selected%(I|
00002cd0  25 29 3d 31 20 f2 53 65  74 49 63 6f 6e 28 77 6f  |%)=1 .SetIcon(wo|
00002ce0  72 64 73 5f 57 69 6e 64  6f 77 25 2c 49 25 2b 33  |rds_Window%,I%+3|
00002cf0  29 3a 73 65 6c 65 63 74  65 64 25 28 49 25 29 3d  |):selected%(I%)=|
00002d00  30 0d 0c 44 6d ed 3a f2  53 65 74 49 63 6f 6e 28  |0..Dm.:.SetIcon(|
00002d10  77 6f 72 64 73 5f 57 69  6e 64 6f 77 25 2c 69 63  |words_Window%,ic|
00002d20  6f 6e 25 29 3a 73 65 6c  65 63 74 65 64 25 28 69  |on%):selected%(i|
00002d30  63 6f 6e 25 2d 33 29 3d  31 3a 73 65 6c 65 63 74  |con%-3)=1:select|
00002d40  69 6f 6e 25 3d 31 3a 73  65 6c 65 63 74 65 64 77  |ion%=1:selectedw|
00002d50  6f 72 64 24 3d 77 6f 72  64 24 28 69 63 6f 6e 25  |ord$=word$(icon%|
00002d60  2d 33 29 3a f2 73 65 74  62 75 74 74 6f 6e 0d 0c  |-3):.setbutton..|
00002d70  4e 08 c9 20 31 3a 0d 0c  58 21 f2 53 65 74 49 63  |N.. 1:..X!.SetIc|
00002d80  6f 6e 28 77 6f 72 64 73  5f 57 69 6e 64 6f 77 25  |on(words_Window%|
00002d90  2c 69 63 6f 6e 25 29 0d  0c 62 6c e7 73 65 6c 65  |,icon%)..bl.sele|
00002da0  63 74 65 64 25 28 69 63  6f 6e 25 2d 33 29 3d 30  |cted%(icon%-3)=0|
00002db0  20 73 65 6c 65 63 74 65  64 25 28 69 63 6f 6e 25  | selected%(icon%|
00002dc0  2d 33 29 3d 31 3a 73 65  6c 65 63 74 69 6f 6e 25  |-3)=1:selection%|
00002dd0  2b 3d 31 3a 8b 20 73 65  6c 65 63 74 65 64 25 28  |+=1:. selected%(|
00002de0  69 63 6f 6e 25 2d 33 29  3d 30 3a 73 65 6c 65 63  |icon%-3)=0:selec|
00002df0  74 69 6f 6e 25 2d 3d 31  3a f2 73 65 74 62 75 74  |tion%-=1:.setbut|
00002e00  74 6f 6e 0d 0c 6c 18 e7  73 65 6c 65 63 74 69 6f  |ton..l..selectio|
00002e10  6e 25 3c 3e 31 20 e5 8d  74 40 4c 0d 0c 76 3e e3  |n%<>1 ..t@L..v>.|
00002e20  49 25 3d 31 b8 77 6f 72  64 73 25 3a e7 73 65 6c  |I%=1.words%:.sel|
00002e30  65 63 74 65 64 25 28 49  25 29 3d 31 20 73 65 6c  |ected%(I%)=1 sel|
00002e40  65 63 74 65 64 77 6f 72  64 24 3d 77 6f 72 64 24  |ectedword$=word$|
00002e50  28 49 25 29 3a ed 3a 8b  ed 0d 0c 80 05 cb 0d 0c  |(I%):.:.........|
00002e60  8a 13 c8 8e 20 73 65 6c  65 63 74 69 6f 6e 25 20  |.... selection% |
00002e70  ca 0d 0c 94 5b c9 20 30  3a f2 49 63 6f 6e 50 75  |....[. 0:.IconPu|
00002e80  74 54 65 78 74 28 6d 61  69 6e 5f 57 69 6e 64 6f  |tText(main_Windo|
00002e90  77 25 2c 32 36 2c 22 22  29 3a f2 49 63 6f 6e 50  |w%,26,""):.IconP|
00002ea0  75 74 54 65 78 74 28 73  6f 6c 76 65 5f 57 69 6e  |utText(solve_Win|
00002eb0  64 6f 77 25 2c 31 37 2c  22 22 29 3a 73 65 6c 65  |dow%,17,""):sele|
00002ec0  63 74 65 64 77 6f 72 64  24 3d 22 22 0d 0c 9e 60  |ctedword$=""...`|
00002ed0  c9 20 31 3a f2 49 63 6f  6e 50 75 74 54 65 78 74  |. 1:.IconPutText|
00002ee0  28 6d 61 69 6e 5f 57 69  6e 64 6f 77 25 2c 32 36  |(main_Window%,26|
00002ef0  2c 73 65 6c 65 63 74 65  64 77 6f 72 64 24 29 3a  |,selectedword$):|
00002f00  f2 49 63 6f 6e 50 75 74  54 65 78 74 28 73 6f 6c  |.IconPutText(sol|
00002f10  76 65 5f 57 69 6e 64 6f  77 25 2c 31 37 2c 73 65  |ve_Window%,17,se|
00002f20  6c 65 63 74 65 64 77 6f  72 64 24 29 0d 0c a8 59  |lectedword$)...Y|
00002f30  7f 3a f2 49 63 6f 6e 50  75 74 54 65 78 74 28 6d  |.:.IconPutText(m|
00002f40  61 69 6e 5f 57 69 6e 64  6f 77 25 2c 32 36 2c 22  |ain_Window%,26,"|
00002f50  22 29 3a f2 49 63 6f 6e  50 75 74 54 65 78 74 28  |"):.IconPutText(|
00002f60  73 6f 6c 76 65 5f 57 69  6e 64 6f 77 25 2c 31 37  |solve_Window%,17|
00002f70  2c 22 22 29 3a 73 65 6c  65 63 74 65 64 77 6f 72  |,""):selectedwor|
00002f80  64 24 3d 22 22 0d 0c b2  05 cb 0d 0c bc 05 cd 0d  |d$=""...........|
00002f90  0c c6 18 e7 20 69 63 6f  6e 25 3d 32 20 f2 73 65  |.... icon%=2 .se|
00002fa0  6c 65 63 74 61 6c 6c 0d  0c d0 17 e7 20 69 63 6f  |lectall..... ico|
00002fb0  6e 25 3d 33 20 f2 63 6c  65 61 72 61 6c 6c 0d 0c  |n%=3 .clearall..|
00002fc0  da 15 f2 75 70 64 61 74  65 73 6f 6c 76 65 73 74  |...updatesolvest|
00002fd0  61 74 65 0d 0c e4 1c f2  63 61 72 65 74 28 a9 73  |ate.....caret(.s|
00002fe0  65 6c 65 63 74 65 64 77  6f 72 64 24 2f 32 29 0d  |electedword$/2).|
00002ff0  0c ee 0e f2 73 65 74 62  75 74 74 6f 6e 0d 0c f8  |....setbutton...|
00003000  05 e1 0d 0d 02 05 3a 0d  0d 0c 1e dd f2 4d 6f 75  |......:......Mou|
00003010  73 65 6d 61 69 6e 28 62  75 74 74 6f 6e 25 2c 69  |semain(button%,i|
00003020  63 6f 6e 25 29 0d 0d 16  1f e7 20 62 75 74 74 6f  |con%)..... butto|
00003030  6e 25 3c 3e 31 20 80 20  62 75 74 74 6f 6e 25 3c  |n%<>1 . button%<|
00003040  3e 34 20 e1 0d 0d 20 2f  e7 69 63 6f 6e 25 3d 32  |>4 ... /.icon%=2|
00003050  34 20 80 20 a4 49 63 6f  6e 54 65 78 74 28 6d 61  |4 . .IconText(ma|
00003060  69 6e 5f 57 69 6e 64 6f  77 25 2c 32 36 29 3d 22  |in_Window%,26)="|
00003070  22 20 e1 0d 0d 2a 0e c8  8e 20 69 63 6f 6e 25 20  |" ...*... icon% |
00003080  ca 0d 0d 34 11 c9 20 32  34 3a f2 61 64 64 77 6f  |...4.. 24:.addwo|
00003090  72 64 0d 0d 3e 14 c9 20  32 35 3a f2 64 65 6c 65  |rd..>.. 25:.dele|
000030a0  74 65 77 6f 72 64 0d 0d  48 13 c9 20 32 38 3a f2  |teword..H.. 28:.|
000030b0  61 6d 65 6e 64 77 6f 72  64 0d 0d 52 10 c9 20 32  |amendword..R.. 2|
000030c0  39 3a f2 63 72 65 61 74  65 0d 0d 5c 1c c9 20 31  |9:.create..\.. 1|
000030d0  31 2c 31 33 3a f2 62 75  6d 70 78 28 69 63 6f 6e  |1,13:.bumpx(icon|
000030e0  25 2d 31 32 29 0d 0d 66  1f c9 20 31 35 2c 31 37  |%-12)..f.. 15,17|
000030f0  3a f2 62 75 6d 70 79 28  2d 28 69 63 6f 6e 25 2d  |:.bumpy(-(icon%-|
00003100  31 36 29 29 0d 0d 70 22  c9 20 31 39 2c 32 31 3a  |16))..p". 19,21:|
00003110  f2 62 75 6d 70 67 61 70  73 28 2d 28 69 63 6f 6e  |.bumpgaps(-(icon|
00003120  25 2d 32 30 29 29 0d 0d  7a 42 c9 20 33 30 3a e7  |%-20))..zB. 30:.|
00003130  62 75 74 74 6f 6e 25 3d  31 20 80 20 73 61 76 65  |button%=1 . save|
00003140  66 6f 72 6d 61 74 24 3d  22 74 65 78 74 22 20 f2  |format$="text" .|
00003150  53 65 74 49 63 6f 6e 28  6d 61 69 6e 5f 57 69 6e  |SetIcon(main_Win|
00003160  64 6f 77 25 2c 33 30 29  0d 0d 84 46 73 61 76 65  |dow%,30)...Fsave|
00003170  66 6f 72 6d 61 74 24 3d  22 74 65 78 74 22 3a 64  |format$="text":d|
00003180  25 3d a4 49 63 6f 6e 50  75 74 53 70 72 69 74 65  |%=.IconPutSprite|
00003190  28 73 61 76 65 77 73 71  5f 57 69 6e 64 6f 77 25  |(savewsq_Window%|
000031a0  2c 30 2c 22 66 69 6c 65  5f 66 66 66 22 29 0d 0d  |,0,"file_fff")..|
000031b0  8e 42 c9 20 33 32 3a e7  62 75 74 74 6f 6e 25 3d  |.B. 32:.button%=|
000031c0  31 20 80 20 73 61 76 65  66 6f 72 6d 61 74 24 3d  |1 . saveformat$=|
000031d0  22 64 72 61 77 22 20 f2  53 65 74 49 63 6f 6e 28  |"draw" .SetIcon(|
000031e0  6d 61 69 6e 5f 57 69 6e  64 6f 77 25 2c 33 32 29  |main_Window%,32)|
000031f0  0d 0d 98 46 73 61 76 65  66 6f 72 6d 61 74 24 3d  |...Fsaveformat$=|
00003200  22 64 72 61 77 22 3a 64  25 3d a4 49 63 6f 6e 50  |"draw":d%=.IconP|
00003210  75 74 53 70 72 69 74 65  28 73 61 76 65 77 73 71  |utSprite(savewsq|
00003220  5f 57 69 6e 64 6f 77 25  2c 30 2c 22 66 69 6c 65  |_Window%,0,"file|
00003230  5f 66 66 66 22 29 0d 0d  a2 41 c9 20 33 33 3a e7  |_fff")...A. 33:.|
00003240  62 75 74 74 6f 6e 25 3d  31 20 80 20 73 61 76 65  |button%=1 . save|
00003250  66 6f 72 6d 61 74 24 3d  22 6f 77 6e 22 20 f2 53  |format$="own" .S|
00003260  65 74 49 63 6f 6e 28 6d  61 69 6e 5f 57 69 6e 64  |etIcon(main_Wind|
00003270  6f 77 25 2c 33 33 29 0d  0d ac 45 73 61 76 65 66  |ow%,33)...Esavef|
00003280  6f 72 6d 61 74 24 3d 22  6f 77 6e 22 3a 64 25 3d  |ormat$="own":d%=|
00003290  a4 49 63 6f 6e 50 75 74  53 70 72 69 74 65 28 73  |.IconPutSprite(s|
000032a0  61 76 65 77 73 71 5f 57  69 6e 64 6f 77 25 2c 30  |avewsq_Window%,0|
000032b0  2c 22 66 69 6c 65 5f 30  33 63 22 29 0d 0d b6 41  |,"file_03c")...A|
000032c0  c9 20 33 34 3a e7 62 75  74 74 6f 6e 25 3d 31 20  |. 34:.button%=1 |
000032d0  80 20 73 61 76 65 66 6f  72 6d 61 74 24 3d 22 69  |. saveformat$="i|
000032e0  6d 70 22 20 f2 53 65 74  49 63 6f 6e 28 6d 61 69  |mp" .SetIcon(mai|
000032f0  6e 5f 57 69 6e 64 6f 77  25 2c 33 34 29 0d 0d c0  |n_Window%,34)...|
00003300  45 73 61 76 65 66 6f 72  6d 61 74 24 3d 22 69 6d  |Esaveformat$="im|
00003310  70 22 3a 64 25 3d a4 49  63 6f 6e 50 75 74 53 70  |p":d%=.IconPutSp|
00003320  72 69 74 65 28 73 61 76  65 77 73 71 5f 57 69 6e  |rite(savewsq_Win|
00003330  64 6f 77 25 2c 30 2c 22  66 69 6c 65 5f 66 66 66  |dow%,0,"file_fff|
00003340  22 29 0d 0d ca 30 7f 3a  f2 41 6c 65 72 74 28 22  |")...0.:.Alert("|
00003350  57 6f 72 64 53 71 22 2c  22 49 6e 76 61 6c 69 64  |WordSq","Invalid|
00003360  20 54 65 6d 70 6c 61 74  65 73 20 66 69 6c 65 2e  | Templates file.|
00003370  22 29 0d 0d d4 05 cb 0d  0d de 05 e1 0d 0d e8 05  |")..............|
00003380  3a 0d 0d f2 0f dd f2 73  65 6c 65 63 74 61 6c 6c  |:......selectall|
00003390  0d 0d fc 52 e3 49 25 3d  34 b8 77 6f 72 64 73 25  |...R.I%=4.words%|
000033a0  2b 33 3a e7 73 65 6c 65  63 74 65 64 25 28 49 25  |+3:.selected%(I%|
000033b0  2d 33 29 3d 30 20 f2 53  65 74 49 63 6f 6e 28 77  |-3)=0 .SetIcon(w|
000033c0  6f 72 64 73 5f 57 69 6e  64 6f 77 25 2c 49 25 29  |ords_Window%,I%)|
000033d0  3a 73 65 6c 65 63 74 65  64 25 28 49 25 2d 33 29  |:selected%(I%-3)|
000033e0  3d 31 0d 0e 06 22 ed 3a  73 65 6c 65 63 74 69 6f  |=1...".:selectio|
000033f0  6e 25 3d 77 6f 72 64 73  25 3a f2 73 65 74 62 75  |n%=words%:.setbu|
00003400  74 74 6f 6e 0d 0e 10 05  e1 0d 0e 1a 05 3a 0d 0e  |tton.........:..|
00003410  24 0e dd f2 63 6c 65 61  72 61 6c 6c 0d 0e 2e 52  |$...clearall...R|
00003420  e3 49 25 3d 34 b8 77 6f  72 64 73 25 2b 33 3a e7  |.I%=4.words%+3:.|
00003430  73 65 6c 65 63 74 65 64  25 28 49 25 2d 33 29 3d  |selected%(I%-3)=|
00003440  31 20 f2 53 65 74 49 63  6f 6e 28 77 6f 72 64 73  |1 .SetIcon(words|
00003450  5f 57 69 6e 64 6f 77 25  2c 49 25 29 3a 73 65 6c  |_Window%,I%):sel|
00003460  65 63 74 65 64 25 28 49  25 2d 33 29 3d 30 0d 0e  |ected%(I%-3)=0..|
00003470  38 1d ed 3a 73 65 6c 65  63 74 69 6f 6e 25 3d 30  |8..:selection%=0|
00003480  3a f2 73 65 74 62 75 74  74 6f 6e 0d 0e 42 05 e1  |:.setbutton..B..|
00003490  0d 0e 4c 05 3a 0d 0e 56  0d dd f2 73 68 6f 77 61  |..L.:..V...showa|
000034a0  6c 6c 0d 0e 60 58 e3 49  25 3d 31 b8 77 6f 72 64  |ll..`X.I%=1.word|
000034b0  73 25 3a e7 73 74 61 72  74 25 28 49 25 29 3c 3e  |s%:.start%(I%)<>|
000034c0  30 20 80 20 64 69 72 25  28 49 25 29 3c 3e 30 20  |0 . dir%(I%)<>0 |
000034d0  73 68 6f 77 25 28 49 25  29 3d 31 3a f2 73 69 63  |show%(I%)=1:.sic|
000034e0  28 77 6f 72 64 73 5f 57  69 6e 64 6f 77 25 2c 49  |(words_Window%,I|
000034f0  25 2b 33 2c 77 63 6f 6c  25 29 0d 0e 6a 27 ed 3a  |%+3,wcol%)..j'.:|
00003500  f2 57 69 6e 64 6f 77 46  6f 72 63 65 44 72 61 77  |.WindowForceDraw|
00003510  28 64 69 73 70 6c 61 79  5f 57 69 6e 64 6f 77 25  |(display_Window%|
00003520  29 0d 0e 74 35 68 69 67  68 25 3d 77 73 71 77 6f  |)..t5high%=wsqwo|
00003530  72 64 73 25 3a 64 6f 6e  65 25 3d 31 3a 73 68 6f  |rds%:done%=1:sho|
00003540  77 25 3d 30 3a f2 75 70  64 61 74 65 73 6f 6c 76  |w%=0:.updatesolv|
00003550  65 73 74 61 74 65 0d 0e  7e 05 e1 0d 0e 88 05 3a  |estate..~......:|
00003560  0d 0e 92 0f dd f2 72 65  6d 6f 76 65 61 6c 6c 0d  |......removeall.|
00003570  0e 9c 49 e3 49 25 3d 31  b8 77 6f 72 64 73 25 3a  |..I.I%=1.words%:|
00003580  73 68 6f 77 25 28 49 25  29 3d 30 3a f2 73 69 63  |show%(I%)=0:.sic|
00003590  28 77 6f 72 64 73 5f 57  69 6e 64 6f 77 25 2c 49  |(words_Window%,I|
000035a0  25 2b 33 2c 37 29 3a e7  49 25 3d 73 68 6f 77 25  |%+3,7):.I%=show%|
000035b0  20 73 68 6f 77 25 3d 30  0d 0e a6 05 ed 0d 0e b0  | show%=0........|
000035c0  25 f2 57 69 6e 64 6f 77  46 6f 72 63 65 44 72 61  |%.WindowForceDra|
000035d0  77 28 64 69 73 70 6c 61  79 5f 57 69 6e 64 6f 77  |w(display_Window|
000035e0  25 29 0d 0e ba 2e 68 69  67 68 25 3d 30 3a 66 6f  |%)....high%=0:fo|
000035f0  75 6e 64 25 3d 30 3a 64  6f 6e 65 25 3d 30 3a f2  |und%=0:done%=0:.|
00003600  75 70 64 61 74 65 73 6f  6c 76 65 73 74 61 74 65  |updatesolvestate|
00003610  0d 0e c4 05 e1 0d 0e ce  05 3a 0d 0e d8 28 dd f2  |.........:...(..|
00003620  45 76 65 6e 74 5f 4b 65  79 50 72 65 73 73 28 77  |Event_KeyPress(w|
00003630  69 6e 64 6f 77 25 2c 69  63 6f 6e 25 2c 6b 65 79  |indow%,icon%,key|
00003640  25 29 0d 0e e2 10 c8 8e  20 77 69 6e 64 6f 77 25  |%)...... window%|
00003650  20 ca 0d 0e ec 2e c9 20  73 6f 6c 76 65 5f 57 69  | ...... solve_Wi|
00003660  6e 64 6f 77 25 3a f2 4b  65 79 50 72 65 73 73 73  |ndow%:.KeyPresss|
00003670  6f 6c 76 65 28 69 63 6f  6e 25 2c 6b 65 79 25 29  |olve(icon%,key%)|
00003680  0d 0e f6 12 c9 20 69 6e  66 6f 5f 57 69 6e 64 6f  |..... info_Windo|
00003690  77 25 0d 0f 00 15 c9 20  64 69 73 70 6c 61 79 5f  |w%..... display_|
000036a0  57 69 6e 64 6f 77 25 0d  0f 0a 13 c9 20 77 6f 72  |Window%..... wor|
000036b0  64 73 5f 57 69 6e 64 6f  77 25 0d 0f 14 2c c9 20  |ds_Window%...,. |
000036c0  6d 61 69 6e 5f 57 69 6e  64 6f 77 25 3a f2 4b 65  |main_Window%:.Ke|
000036d0  79 50 72 65 73 73 6d 61  69 6e 28 69 63 6f 6e 25  |yPressmain(icon%|
000036e0  2c 6b 65 79 25 29 0d 0f  1e 2e c9 20 70 72 65 66  |,key%)..... pref|
000036f0  73 5f 57 69 6e 64 6f 77  25 3a f2 4b 65 79 50 72  |s_Window%:.KeyPr|
00003700  65 73 73 70 72 65 66 73  28 69 63 6f 6e 25 2c 6b  |essprefs(icon%,k|
00003710  65 79 25 29 0d 0f 28 05  cb 0d 0f 32 2e 6b 65 79  |ey%)..(....2.key|
00003720  25 3d 30 3a 77 73 71 74  69 74 6c 65 24 3d a4 49  |%=0:wsqtitle$=.I|
00003730  63 6f 6e 54 65 78 74 28  6d 61 69 6e 5f 57 69 6e  |conText(main_Win|
00003740  64 6f 77 25 2c 39 29 0d  0f 3c 05 e1 0d 0f 46 05  |dow%,9)..<....F.|
00003750  3a 0d 0f 50 1f dd f2 4b  65 79 50 72 65 73 73 73  |:..P...KeyPresss|
00003760  6f 6c 76 65 28 69 63 6f  6e 25 2c 6b 65 79 25 29  |olve(icon%,key%)|
00003770  0d 0f 5a 26 e7 6b 65 79  25 3c 3e 31 33 20 c8 99  |..Z&.key%<>13 ..|
00003780  22 57 69 6d 70 5f 50 72  6f 63 65 73 73 4b 65 79  |"Wimp_ProcessKey|
00003790  22 2c 6b 65 79 25 0d 0f  64 58 e7 6b 65 79 25 3d  |",key%..dX.key%=|
000037a0  31 33 20 80 20 69 63 6f  6e 25 3d 31 37 20 80 20  |13 . icon%=17 . |
000037b0  28 73 65 6c 65 63 74 69  6f 6e 25 3c 3e 30 20 84  |(selection%<>0 .|
000037c0  20 a4 49 63 6f 6e 54 65  78 74 28 73 6f 6c 76 65  | .IconText(solve|
000037d0  5f 57 69 6e 64 6f 77 25  2c 31 37 29 3c 3e 22 22  |_Window%,17)<>""|
000037e0  29 20 f2 73 68 6f 77 70  72 65 73 73 65 64 0d 0f  |) .showpressed..|
000037f0  6e 33 e7 6b 65 79 25 3d  31 33 20 80 20 69 63 6f  |n3.key%=13 . ico|
00003800  6e 25 3d 31 37 20 80 20  73 6f 6c 76 65 66 6f 72  |n%=17 . solvefor|
00003810  6d 61 74 24 3d 22 22 20  f2 63 61 72 65 74 28 30  |mat$="" .caret(0|
00003820  29 0d 0f 78 05 e1 0d 0f  82 05 3a 0d 0f 8c 1e dd  |)..x......:.....|
00003830  f2 4b 65 79 50 72 65 73  73 6d 61 69 6e 28 69 63  |.KeyPressmain(ic|
00003840  6f 6e 25 2c 6b 65 79 25  29 0d 0f 96 0c 64 25 3d  |on%,key%)....d%=|
00003850  69 63 6f 6e 25 0d 0f a0  40 e7 6b 65 79 25 3d 33  |icon%...@.key%=3|
00003860  39 39 20 80 20 69 63 6f  6e 25 3d 32 36 20 69 63  |99 . icon%=26 ic|
00003870  6f 6e 25 3d 39 20 8b 20  e7 20 6b 65 79 25 3d 33  |on%=9 . . key%=3|
00003880  39 38 20 80 20 69 63 6f  6e 25 3d 39 20 69 63 6f  |98 . icon%=9 ico|
00003890  6e 25 3d 32 36 0d 0f aa  53 e7 64 25 3c 3e 69 63  |n%=26...S.d%<>ic|
000038a0  6f 6e 25 20 f2 49 63 6f  6e 43 61 72 65 74 28 6d  |on% .IconCaret(m|
000038b0  61 69 6e 5f 57 69 6e 64  6f 77 25 2c 69 63 6f 6e  |ain_Window%,icon|
000038c0  25 2c a8 28 a9 a4 49 63  6f 6e 54 65 78 74 28 6d  |%,.(..IconText(m|
000038d0  61 69 6e 5f 57 69 6e 64  6f 77 25 2c 69 63 6f 6e  |ain_Window%,icon|
000038e0  25 29 2f 32 29 29 3a e1  0d 0f b4 5a e7 6b 65 79  |%)/2)):....Z.key|
000038f0  25 3d 31 33 20 80 20 69  63 6f 6e 25 3d 32 36 20  |%=13 . icon%=26 |
00003900  80 20 a4 49 63 6f 6e 54  65 78 74 28 6d 61 69 6e  |. .IconText(main|
00003910  5f 57 69 6e 64 6f 77 25  2c 32 36 29 3c 3e 22 22  |_Window%,26)<>""|
00003920  20 80 20 73 6f 6c 76 65  66 6f 72 6d 61 74 24 3c  | . solveformat$<|
00003930  3e 22 74 65 78 74 22 20  f2 61 64 64 77 6f 72 64  |>"text" .addword|
00003940  3a e1 0d 0f be 1c c8 99  22 57 69 6d 70 5f 50 72  |:......."Wimp_Pr|
00003950  6f 63 65 73 73 4b 65 79  22 2c 6b 65 79 25 0d 0f  |ocessKey",key%..|
00003960  c8 05 e1 0d 0f d2 05 3a  0d 0f dc 1f dd f2 4b 65  |.......:......Ke|
00003970  79 50 72 65 73 73 70 72  65 66 73 28 69 63 6f 6e  |yPressprefs(icon|
00003980  25 2c 6b 65 79 25 29 0d  0f e6 0c 64 25 3d 69 63  |%,key%)....d%=ic|
00003990  6f 6e 25 0d 0f f0 0d c8  8e 20 6b 65 79 25 20 ca  |on%...... key% .|
000039a0  0d 0f fa 09 c9 20 33 39  39 0d 10 04 b8 e7 69 63  |..... 399.....ic|
000039b0  6f 6e 25 3d 32 34 20 84  20 69 63 6f 6e 25 3d 32  |on%=24 . icon%=2|
000039c0  35 20 84 20 69 63 6f 6e  25 3d 32 36 20 84 20 69  |5 . icon%=26 . i|
000039d0  63 6f 6e 25 3d 32 37 20  69 63 6f 6e 25 2d 3d 31  |con%=27 icon%-=1|
000039e0  20 8b 20 e7 20 69 63 6f  6e 25 3d 32 33 20 69 63  | . . icon%=23 ic|
000039f0  6f 6e 25 3d 31 37 20 8b  20 e7 20 69 63 6f 6e 25  |on%=17 . . icon%|
00003a00  3d 34 31 20 69 63 6f 6e  25 3d 32 37 20 8b 20 e7  |=41 icon%=27 . .|
00003a10  20 69 63 6f 6e 25 3d 34  33 20 69 63 6f 6e 25 3d  | icon%=43 icon%=|
00003a20  34 31 20 8b 20 e7 20 69  63 6f 6e 25 3d 39 20 69  |41 . . icon%=9 i|
00003a30  63 6f 6e 25 3d 37 20 8b  20 e7 20 69 63 6f 6e 25  |con%=7 . . icon%|
00003a40  3d 31 33 20 69 63 6f 6e  25 3d 39 20 8b 20 e7 20  |=13 icon%=9 . . |
00003a50  69 63 6f 6e 25 3d 31 37  20 69 63 6f 6e 25 3d 31  |icon%=17 icon%=1|
00003a60  33 0d 10 0e 09 c9 20 33  39 38 0d 10 18 b8 e7 69  |3..... 398.....i|
00003a70  63 6f 6e 25 3d 32 33 20  84 20 69 63 6f 6e 25 3d  |con%=23 . icon%=|
00003a80  32 34 20 84 20 69 63 6f  6e 25 3d 32 35 20 84 20  |24 . icon%=25 . |
00003a90  69 63 6f 6e 25 3d 32 36  20 69 63 6f 6e 25 2b 3d  |icon%=26 icon%+=|
00003aa0  31 20 8b 20 e7 20 69 63  6f 6e 25 3d 34 31 20 69  |1 . . icon%=41 i|
00003ab0  63 6f 6e 25 3d 34 33 20  8b 20 e7 20 69 63 6f 6e  |con%=43 . . icon|
00003ac0  25 3d 32 37 20 69 63 6f  6e 25 3d 34 31 20 8b 20  |%=27 icon%=41 . |
00003ad0  e7 20 69 63 6f 6e 25 3d  31 37 20 69 63 6f 6e 25  |. icon%=17 icon%|
00003ae0  3d 32 33 20 8b 20 e7 20  69 63 6f 6e 25 3d 37 20  |=23 . . icon%=7 |
00003af0  69 63 6f 6e 25 3d 39 20  8b 20 e7 20 69 63 6f 6e  |icon%=9 . . icon|
00003b00  25 3d 39 20 69 63 6f 6e  25 3d 31 33 20 8b 20 e7  |%=9 icon%=13 . .|
00003b10  20 69 63 6f 6e 25 3d 31  33 20 69 63 6f 6e 25 3d  | icon%=13 icon%=|
00003b20  31 37 0d 10 22 1e 7f 20  c8 99 22 57 69 6d 70 5f  |17..".. .."Wimp_|
00003b30  50 72 6f 63 65 73 73 4b  65 79 22 2c 6b 65 79 25  |ProcessKey",key%|
00003b40  0d 10 2c 05 cb 0d 10 36  53 e7 69 63 6f 6e 25 3c  |..,....6S.icon%<|
00003b50  3e 64 25 20 f2 49 63 6f  6e 43 61 72 65 74 28 70  |>d% .IconCaret(p|
00003b60  72 65 66 73 5f 57 69 6e  64 6f 77 25 2c 69 63 6f  |refs_Window%,ico|
00003b70  6e 25 2c a8 28 a9 a4 49  63 6f 6e 54 65 78 74 28  |n%,.(..IconText(|
00003b80  70 72 65 66 73 5f 57 69  6e 64 6f 77 25 2c 69 63  |prefs_Window%,ic|
00003b90  6f 6e 25 29 2f 32 29 29  0d 10 40 05 e1 0d 10 4a  |on%)/2))..@....J|
00003ba0  05 3a 0d 10 54 1d dd f2  45 76 65 6e 74 5f 4d 65  |.:..T...Event_Me|
00003bb0  6e 75 43 68 6f 69 63 65  28 6d 65 6e 75 25 29 0d  |nuChoice(menu%).|
00003bc0  10 5e 0e c8 8e 20 6d 65  6e 75 25 20 ca 0d 10 68  |.^... menu% ...h|
00003bd0  1e c9 20 42 61 72 5f 4d  65 6e 75 25 3a f2 4d 65  |.. Bar_Menu%:.Me|
00003be0  6e 75 43 68 6f 69 63 65  42 61 72 0d 10 72 13 c9  |nuChoiceBar..r..|
00003bf0  20 73 61 76 65 77 73 71  5f 4d 65 6e 75 25 0d 10  | savewsq_Menu%..|
00003c00  7c 22 c9 20 73 6f 6c 76  65 5f 4d 65 6e 75 25 3a  ||". solve_Menu%:|
00003c10  f2 4d 65 6e 75 43 68 6f  69 63 65 73 6f 6c 76 65  |.MenuChoicesolve|
00003c20  0d 10 86 10 c9 20 69 6e  66 6f 5f 4d 65 6e 75 25  |..... info_Menu%|
00003c30  0d 10 90 15 c9 20 73 61  76 65 77 6f 72 64 73 5f  |..... savewords_|
00003c40  4d 65 6e 75 25 0d 10 9a  22 c9 20 70 72 65 66 73  |Menu%...". prefs|
00003c50  5f 4d 65 6e 75 25 3a f2  4d 65 6e 75 43 68 6f 69  |_Menu%:.MenuChoi|
00003c60  63 65 70 72 65 66 73 0d  10 a4 26 c9 20 64 69 73  |ceprefs...&. dis|
00003c70  70 6c 61 79 5f 4d 65 6e  75 25 3a f2 4d 65 6e 75  |play_Menu%:.Menu|
00003c80  43 68 6f 69 63 65 64 69  73 70 6c 61 79 0d 10 ae  |Choicedisplay...|
00003c90  22 c9 20 77 6f 72 64 73  5f 4d 65 6e 75 25 3a f2  |". words_Menu%:.|
00003ca0  4d 65 6e 75 43 68 6f 69  63 65 77 6f 72 64 73 0d  |MenuChoicewords.|
00003cb0  10 b8 20 c9 20 6d 61 69  6e 5f 4d 65 6e 75 25 3a  |.. . main_Menu%:|
00003cc0  f2 4d 65 6e 75 43 68 6f  69 63 65 6d 61 69 6e 0d  |.MenuChoicemain.|
00003cd0  10 c2 05 cb 0d 10 cc 05  e1 0d 10 d6 05 3a 0d 10  |.............:..|
00003ce0  e0 13 dd f2 4d 65 6e 75  43 68 6f 69 63 65 42 61  |....MenuChoiceBa|
00003cf0  72 0d 10 ea 17 c8 8e 20  a4 4d 65 6e 75 43 68 6f  |r...... .MenuCho|
00003d00  69 63 65 28 30 29 20 ca  0d 10 f4 07 c9 20 31 0d  |ice(0) ...... 1.|
00003d10  10 fe 2d c9 20 32 3a f2  42 72 69 6e 67 54 6f 54  |..-. 2:.BringToT|
00003d20  6f 70 28 6d 61 69 6e 5f  57 69 6e 64 6f 77 25 29  |op(main_Window%)|
00003d30  3a 6d 61 69 6e 77 69 6e  64 25 3d 31 0d 11 08 42  |:mainwind%=1...B|
00003d40  c9 20 33 3a e7 73 6f 6c  76 65 66 6f 72 6d 61 74  |. 3:.solveformat|
00003d50  24 3c 3e 22 22 20 f2 42  72 69 6e 67 54 6f 54 6f  |$<>"" .BringToTo|
00003d60  70 28 64 69 73 70 6c 61  79 5f 57 69 6e 64 6f 77  |p(display_Window|
00003d70  25 29 3a 64 69 73 70 77  69 6e 64 25 3d 31 0d 11  |%):dispwind%=1..|
00003d80  12 2b f2 42 72 69 6e 67  54 6f 54 6f 70 28 73 6f  |.+.BringToTop(so|
00003d90  6c 76 65 5f 57 69 6e 64  6f 77 25 29 3a 73 6f 6c  |lve_Window%):sol|
00003da0  76 65 77 69 6e 64 25 3d  31 0d 11 1c 22 c9 20 34  |vewind%=1...". 4|
00003db0  3a f2 42 72 69 6e 67 54  6f 54 6f 70 28 70 72 65  |:.BringToTop(pre|
00003dc0  66 73 5f 57 69 6e 64 6f  77 25 29 0d 11 26 08 c9  |fs_Window%)..&..|
00003dd0  20 35 3a 0d 11 30 29 e7  a4 6e 65 77 28 22 63 6c  | 5:..0)..new("cl|
00003de0  65 61 72 20 61 6c 6c 20  76 61 72 69 61 62 6c 65  |ear all variable|
00003df0  73 22 29 3d 31 20 f2 72  65 73 65 74 0d 11 3a 13  |s")=1 .reset..:.|
00003e00  c9 20 36 3a 66 69 6e 69  73 68 65 64 25 3d b9 0d  |. 6:finished%=..|
00003e10  11 44 05 cb 0d 11 4e 05  e1 0d 11 58 05 3a 0d 11  |.D....N....X.:..|
00003e20  62 15 dd f2 4d 65 6e 75  43 68 6f 69 63 65 70 72  |b...MenuChoicepr|
00003e30  65 66 73 0d 11 6c 17 c8  8e 20 a4 4d 65 6e 75 43  |efs..l... .MenuC|
00003e40  68 6f 69 63 65 28 30 29  20 ca 0d 11 76 07 c9 20  |hoice(0) ...v.. |
00003e50  31 0d 11 80 1b c9 20 32  3a c8 8e 20 a4 4d 65 6e  |1..... 2:.. .Men|
00003e60  75 43 68 6f 69 63 65 28  31 29 20 ca 0d 11 8a 35  |uChoice(1) ....5|
00003e70  c9 20 31 3a e7 a4 4d 65  6e 75 43 68 6f 69 63 65  |. 1:..MenuChoice|
00003e80  28 32 29 3c 3e 30 20 74  65 6d 70 77 63 6f 6c 25  |(2)<>0 tempwcol%|
00003e90  3d a4 4d 65 6e 75 43 68  6f 69 63 65 28 32 29 2d  |=.MenuChoice(2)-|
00003ea0  31 0d 11 94 35 c9 20 32  3a e7 a4 4d 65 6e 75 43  |1...5. 2:..MenuC|
00003eb0  68 6f 69 63 65 28 32 29  3c 3e 30 20 74 65 6d 70  |hoice(2)<>0 temp|
00003ec0  6d 63 6f 6c 25 3d a4 4d  65 6e 75 43 68 6f 69 63  |mcol%=.MenuChoic|
00003ed0  65 28 32 29 2d 31 0d 11  9e 34 c9 20 33 3a e7 a4  |e(2)-1...4. 3:..|
00003ee0  4d 65 6e 75 43 68 6f 69  63 65 28 32 29 3c 3e 30  |MenuChoice(2)<>0|
00003ef0  20 74 65 6d 70 63 6f 6c  25 3d a4 4d 65 6e 75 43  | tempcol%=.MenuC|
00003f00  68 6f 69 63 65 28 32 29  2d 31 0d 11 a8 35 c9 20  |hoice(2)-1...5. |
00003f10  34 3a e7 a4 4d 65 6e 75  43 68 6f 69 63 65 28 32  |4:..MenuChoice(2|
00003f20  29 3c 3e 30 20 74 65 6d  70 6c 63 6f 6c 25 3d a4  |)<>0 templcol%=.|
00003f30  4d 65 6e 75 43 68 6f 69  63 65 28 32 29 2d 31 0d  |MenuChoice(2)-1.|
00003f40  11 b2 05 cb 0d 11 bc 13  c9 20 33 3a 66 69 6e 69  |......... 3:fini|
00003f50  73 68 65 64 25 3d b9 0d  11 c6 05 cb 0d 11 d0 44  |shed%=.........D|
00003f60  f2 73 69 62 28 70 72 65  66 73 5f 57 69 6e 64 6f  |.sib(prefs_Windo|
00003f70  77 25 2c 35 30 2c 74 65  6d 70 63 6f 6c 25 29 3a  |w%,50,tempcol%):|
00003f80  f2 73 69 62 28 70 72 65  66 73 5f 57 69 6e 64 6f  |.sib(prefs_Windo|
00003f90  77 25 2c 35 31 2c 74 65  6d 70 6d 63 6f 6c 25 29  |w%,51,tempmcol%)|
00003fa0  0d 11 da 45 f2 73 69 62  28 70 72 65 66 73 5f 57  |...E.sib(prefs_W|
00003fb0  69 6e 64 6f 77 25 2c 35  33 2c 74 65 6d 70 77 63  |indow%,53,tempwc|
00003fc0  6f 6c 25 29 3a f2 73 69  62 28 70 72 65 66 73 5f  |ol%):.sib(prefs_|
00003fd0  57 69 6e 64 6f 77 25 2c  35 34 2c 74 65 6d 70 6c  |Window%,54,templ|
00003fe0  63 6f 6c 25 29 0d 11 e4  05 e1 0d 11 ee 05 3a 0d  |col%).........:.|
00003ff0  11 f8 15 dd f2 4d 65 6e  75 43 68 6f 69 63 65 73  |.....MenuChoices|
00004000  6f 6c 76 65 0d 12 02 17  c8 8e 20 a4 4d 65 6e 75  |olve...... .Menu|
00004010  43 68 6f 69 63 65 28 30  29 20 ca 0d 12 0c 07 c9  |Choice(0) ......|
00004020  20 31 0d 12 16 7d c9 20  32 3a f2 4d 65 6e 75 54  | 1...}. 2:.MenuT|
00004030  69 63 6b 28 73 6f 6c 76  65 5f 4d 65 6e 75 25 2c  |ick(solve_Menu%,|
00004040  32 29 3a f2 4d 65 6e 75  54 69 63 6b 28 6d 61 69  |2):.MenuTick(mai|
00004050  6e 5f 4d 65 6e 75 25 2c  32 29 3a f2 4d 65 6e 75  |n_Menu%,2):.Menu|
00004060  54 69 63 6b 28 64 69 73  70 6c 61 79 5f 4d 65 6e  |Tick(display_Men|
00004070  75 25 2c 32 29 3a e7 77  6f 72 64 73 77 69 6e 64  |u%,2):.wordswind|
00004080  25 3d 30 20 77 6f 72 64  73 77 69 6e 64 25 3d 31  |%=0 wordswind%=1|
00004090  20 8b 20 77 6f 72 64 73  77 69 6e 64 25 3d 30 0d  | . wordswind%=0.|
000040a0  12 20 13 c9 20 33 3a 66  69 6e 69 73 68 65 64 25  |. .. 3:finished%|
000040b0  3d b9 0d 12 2a 05 cb 0d  12 34 4b e7 20 77 6f 72  |=...*....4K. wor|
000040c0  64 73 77 69 6e 64 25 3d  31 20 f2 42 72 69 6e 67  |dswind%=1 .Bring|
000040d0  54 6f 54 6f 70 28 77 6f  72 64 73 5f 57 69 6e 64  |ToTop(words_Wind|
000040e0  6f 77 25 29 20 8b 20 f2  57 69 6e 64 6f 77 43 6c  |ow%) . .WindowCl|
000040f0  6f 73 65 28 77 6f 72 64  73 5f 57 69 6e 64 6f 77  |ose(words_Window|
00004100  25 29 0d 12 3e 05 e1 0d  12 48 05 3a 0d 12 52 17  |%)..>....H.:..R.|
00004110  dd f2 4d 65 6e 75 43 68  6f 69 63 65 64 69 73 70  |..MenuChoicedisp|
00004120  6c 61 79 0d 12 5c 17 c8  8e 20 a4 4d 65 6e 75 43  |lay..\... .MenuC|
00004130  68 6f 69 63 65 28 30 29  20 ca 0d 12 66 07 c9 20  |hoice(0) ...f.. |
00004140  31 0d 12 70 7d c9 20 32  3a f2 4d 65 6e 75 54 69  |1..p}. 2:.MenuTi|
00004150  63 6b 28 73 6f 6c 76 65  5f 4d 65 6e 75 25 2c 32  |ck(solve_Menu%,2|
00004160  29 3a f2 4d 65 6e 75 54  69 63 6b 28 6d 61 69 6e  |):.MenuTick(main|
00004170  5f 4d 65 6e 75 25 2c 32  29 3a f2 4d 65 6e 75 54  |_Menu%,2):.MenuT|
00004180  69 63 6b 28 64 69 73 70  6c 61 79 5f 4d 65 6e 75  |ick(display_Menu|
00004190  25 2c 32 29 3a e7 77 6f  72 64 73 77 69 6e 64 25  |%,2):.wordswind%|
000041a0  3d 30 20 77 6f 72 64 73  77 69 6e 64 25 3d 31 20  |=0 wordswind%=1 |
000041b0  8b 20 77 6f 72 64 73 77  69 6e 64 25 3d 30 0d 12  |. wordswind%=0..|
000041c0  7a 13 c9 20 33 3a 66 69  6e 69 73 68 65 64 25 3d  |z.. 3:finished%=|
000041d0  b9 0d 12 84 05 cb 0d 12  8e 4b e7 20 77 6f 72 64  |.........K. word|
000041e0  73 77 69 6e 64 25 3d 31  20 f2 42 72 69 6e 67 54  |swind%=1 .BringT|
000041f0  6f 54 6f 70 28 77 6f 72  64 73 5f 57 69 6e 64 6f  |oTop(words_Windo|
00004200  77 25 29 20 8b 20 f2 57  69 6e 64 6f 77 43 6c 6f  |w%) . .WindowClo|
00004210  73 65 28 77 6f 72 64 73  5f 57 69 6e 64 6f 77 25  |se(words_Window%|
00004220  29 0d 12 98 05 e1 0d 12  a2 05 3a 0d 12 ac 15 dd  |).........:.....|
00004230  f2 4d 65 6e 75 43 68 6f  69 63 65 77 6f 72 64 73  |.MenuChoicewords|
00004240  0d 12 b6 17 c8 8e 20 a4  4d 65 6e 75 43 68 6f 69  |...... .MenuChoi|
00004250  63 65 28 30 29 20 ca 0d  12 c0 07 c9 20 31 0d 12  |ce(0) ...... 1..|
00004260  ca 07 c9 20 32 0d 12 d4  13 c9 20 33 3a 66 69 6e  |... 2..... 3:fin|
00004270  69 73 68 65 64 25 3d b9  0d 12 de 05 cb 0d 12 e8  |ished%=.........|
00004280  05 e1 0d 12 f2 05 3a 0d  12 fc 14 dd f2 4d 65 6e  |......:......Men|
00004290  75 43 68 6f 69 63 65 6d  61 69 6e 0d 13 06 17 c8  |uChoicemain.....|
000042a0  8e 20 a4 4d 65 6e 75 43  68 6f 69 63 65 28 30 29  |. .MenuChoice(0)|
000042b0  20 ca 0d 13 10 07 c9 20  31 0d 13 1a b4 c9 20 32  | ...... 1..... 2|
000042c0  3a f2 4d 65 6e 75 54 69  63 6b 28 6d 61 69 6e 5f  |:.MenuTick(main_|
000042d0  4d 65 6e 75 25 2c 32 29  3a f2 4d 65 6e 75 54 69  |Menu%,2):.MenuTi|
000042e0  63 6b 28 73 6f 6c 76 65  5f 4d 65 6e 75 25 2c 32  |ck(solve_Menu%,2|
000042f0  29 3a f2 4d 65 6e 75 54  69 63 6b 28 64 69 73 70  |):.MenuTick(disp|
00004300  6c 61 79 5f 4d 65 6e 75  25 2c 32 29 3a e7 77 6f  |lay_Menu%,2):.wo|
00004310  72 64 73 77 69 6e 64 25  3d 30 20 77 6f 72 64 73  |rdswind%=0 words|
00004320  77 69 6e 64 25 3d 31 3a  f2 42 72 69 6e 67 54 6f  |wind%=1:.BringTo|
00004330  54 6f 70 28 77 6f 72 64  73 5f 57 69 6e 64 6f 77  |Top(words_Window|
00004340  25 29 20 8b 20 77 6f 72  64 73 77 69 6e 64 25 3d  |%) . wordswind%=|
00004350  30 3a f2 57 69 6e 64 6f  77 43 6c 6f 73 65 28 77  |0:.WindowClose(w|
00004360  6f 72 64 73 5f 57 69 6e  64 6f 77 25 29 0d 13 24  |ords_Window%)..$|
00004370  07 c9 20 33 0d 13 2e 07  c9 20 34 0d 13 38 5d c9  |.. 3..... 4..8].|
00004380  20 35 3a 6f 6c 64 24 3d  73 61 76 65 66 6f 72 6d  | 5:old$=saveform|
00004390  61 74 24 3a 73 61 76 65  66 6f 72 6d 61 74 24 3d  |at$:saveformat$=|
000043a0  22 70 72 69 6e 74 22 3a  ef 32 3a f2 70 72 65 3a  |"print":.2:.pre:|
000043b0  f2 73 61 76 65 77 6f 72  64 73 28 22 22 29 3a f2  |.savewords(""):.|
000043c0  70 6f 73 74 3a ef 33 3a  73 61 76 65 66 6f 72 6d  |post:.3:saveform|
000043d0  61 74 24 3d 6f 6c 64 24  0d 13 42 5a c9 20 36 3a  |at$=old$..BZ. 6:|
000043e0  6f 6c 64 24 3d 73 61 76  65 66 6f 72 6d 61 74 24  |old$=saveformat$|
000043f0  3a 73 61 76 65 66 6f 72  6d 61 74 24 3d 22 70 72  |:saveformat$="pr|
00004400  69 6e 74 22 3a ef 32 3a  f2 70 72 65 3a f2 73 61  |int":.2:.pre:.sa|
00004410  76 65 73 71 75 61 72 65  3a f2 70 6f 73 74 3a ef  |vesquare:.post:.|
00004420  33 3a 73 61 76 65 66 6f  72 6d 61 74 24 3d 6f 6c  |3:saveformat$=ol|
00004430  64 24 0d 13 4c 13 c9 20  37 3a 66 69 6e 69 73 68  |d$..L.. 7:finish|
00004440  65 64 25 3d b9 0d 13 56  05 cb 0d 13 60 05 e1 0d  |ed%=...V....`...|
00004450  13 6a 05 3a 0d 13 74 21  dd f2 45 76 65 6e 74 5f  |.j.:..t!..Event_|
00004460  4c 6f 61 64 46 69 6c 65  28 66 69 6c 65 24 2c 74  |LoadFile(file$,t|
00004470  79 70 65 25 29 0d 13 7e  14 c8 99 22 48 6f 75 72  |ype%)..~..."Hour|
00004480  67 6c 61 73 73 5f 4f 6e  22 0d 13 88 0e c8 8e 20  |glass_On"...... |
00004490  74 79 70 65 25 20 ca 0d  13 92 3e c9 20 26 46 46  |type% ....>. &FF|
000044a0  46 3a e7 a4 6e 65 77 28  22 6c 6f 61 64 20 61 20  |F:..new("load a |
000044b0  6e 65 77 20 66 69 6c 65  22 29 3d 31 20 f2 72 65  |new file")=1 .re|
000044c0  73 65 74 3a f2 4c 6f 61  64 57 6f 72 64 73 28 66  |set:.LoadWords(f|
000044d0  69 6c 65 24 29 0d 13 9c  52 c9 20 66 69 6c 65 74  |ile$)...R. filet|
000044e0  79 70 65 25 3a e7 a4 6e  65 77 28 22 6c 6f 61 64  |ype%:..new("load|
000044f0  20 61 20 6e 65 77 20 73  65 74 20 6f 66 20 77 6f  | a new set of wo|
00004500  72 64 73 20 61 6e 64 20  67 72 69 64 22 29 3d 31  |rds and grid")=1|
00004510  20 f2 72 65 73 65 74 3a  f2 4c 6f 61 64 4f 77 6e  | .reset:.LoadOwn|
00004520  28 66 69 6c 65 24 29 0d  13 a6 05 cb 0d 13 b0 15  |(file$).........|
00004530  c8 99 22 48 6f 75 72 67  6c 61 73 73 5f 4f 66 66  |.."Hourglass_Off|
00004540  22 0d 13 ba 05 e1 0d 13  c4 05 3a 0d 13 ce 16 dd  |".........:.....|
00004550  f2 4c 6f 61 64 57 6f 72  64 73 28 66 69 6c 65 24  |.LoadWords(file$|
00004560  29 0d 13 d8 0f 66 69 6c  65 3d 8e 66 69 6c 65 24  |)....file=.file$|
00004570  0d 13 e2 18 64 75 6d 6d  79 24 3d a4 63 61 70 73  |....dummy$=.caps|
00004580  28 be 23 66 69 6c 65 29  0d 13 ec 5d e7 a7 64 75  |(.#file)...]..du|
00004590  6d 6d 79 24 2c 22 4f 52  44 22 29 20 80 20 a7 64  |mmy$,"ORD") . .d|
000045a0  75 6d 6d 79 24 2c 22 55  41 52 45 22 29 3a 64 69  |ummy$,"UARE"):di|
000045b0  6d 78 3d a9 be 23 66 69  6c 65 3a 77 6f 72 64 73  |mx=..#file:words|
000045c0  25 3d 30 3a 73 6f 6c 76  65 66 6f 72 6d 61 74 24  |%=0:solveformat$|
000045d0  3d 22 74 65 78 74 22 3a  f2 6c 6f 61 64 73 71 75  |="text":.loadsqu|
000045e0  61 72 65 3a e1 0d 13 f6  16 d9 23 66 69 6c 65 3a  |are:......#file:|
000045f0  66 69 6c 65 3d 8e 66 69  6c 65 24 0d 14 00 0e 77  |file=.file$....w|
00004600  6f 72 64 73 25 3d 31 3a  f5 0d 14 0a 11 64 75 6d  |ords%=1:.....dum|
00004610  6d 79 24 3d be 23 66 69  6c 65 0d 14 14 15 e7 a4  |my$=.#file......|
00004620  6c 65 6e 28 64 75 6d 6d  79 24 29 3e 32 20 8c 0d  |len(dummy$)>2 ..|
00004630  14 1e 3e 77 6f 72 64 24  28 77 6f 72 64 73 25 29  |..>word$(words%)|
00004640  3d c0 64 75 6d 6d 79 24  2c 31 38 29 3a 6c 65 6e  |=.dummy$,18):len|
00004650  25 28 77 6f 72 64 73 25  29 3d a4 6c 65 6e 28 77  |%(words%)=.len(w|
00004660  6f 72 64 24 28 77 6f 72  64 73 25 29 29 0d 14 28  |ord$(words%))..(|
00004670  2d e7 63 61 70 73 25 20  77 6f 72 64 24 28 77 6f  |-.caps% word$(wo|
00004680  72 64 73 25 29 3d a4 63  61 70 73 28 77 6f 72 64  |rds%)=.caps(word|
00004690  24 28 77 6f 72 64 73 25  29 29 0d 14 32 0d 77 6f  |$(words%))..2.wo|
000046a0  72 64 73 25 2b 3d 31 0d  14 3c 05 cd 0d 14 46 17  |rds%+=1..<....F.|
000046b0  fd c5 23 66 69 6c 65 20  84 77 6f 72 64 73 25 3d  |..#file .words%=|
000046c0  31 36 39 0d 14 50 1d 77  6f 72 64 73 25 2d 3d 31  |169..P.words%-=1|
000046d0  3a 6e 65 65 64 73 25 3d  c6 8e 6c 65 6e 25 28 29  |:needs%=..len%()|
000046e0  0d 14 5a 0a d9 23 66 69  6c 65 0d 14 64 0f e7 77  |..Z..#file..d..w|
000046f0  6f 72 64 73 25 3d 30 20  e1 0d 14 6e 0c f2 73 6f  |ords%=0 ...n..so|
00004700  72 74 28 31 29 0d 14 78  39 f2 4d 65 6e 75 44 69  |rt(1)..x9.MenuDi|
00004710  73 61 62 6c 65 28 6d 61  69 6e 5f 4d 65 6e 75 25  |sable(main_Menu%|
00004720  2c 34 29 3a f2 4d 65 6e  75 44 69 73 61 62 6c 65  |,4):.MenuDisable|
00004730  28 6d 61 69 6e 5f 4d 65  6e 75 25 2c 36 29 0d 14  |(main_Menu%,6)..|
00004740  82 0b f2 72 65 63 28 32  29 0d 14 8c 0e f2 61 66  |...rec(2).....af|
00004750  74 65 72 6c 6f 61 64 0d  14 96 21 f2 57 69 6e 64  |terload...!.Wind|
00004760  6f 77 43 6c 6f 73 65 28  64 69 73 70 6c 61 79 5f  |owClose(display_|
00004770  57 69 6e 64 6f 77 25 29  0d 14 a0 43 e7 a7 66 69  |Window%)...C..fi|
00004780  6c 65 24 2c 22 57 69 6d  70 24 53 63 72 61 70 22  |le$,"Wimp$Scrap"|
00004790  29 3d 30 20 f2 49 63 6f  6e 50 75 74 54 65 78 74  |)=0 .IconPutText|
000047a0  28 73 61 76 65 77 6f 72  64 73 5f 57 69 6e 64 6f  |(savewords_Windo|
000047b0  77 25 2c 31 2c 66 69 6c  65 24 29 0d 14 aa 05 e1  |w%,1,file$).....|
000047c0  0d 14 b4 05 3a 0d 14 be  0f dd f2 61 66 74 65 72  |....:......after|
000047d0  6c 6f 61 64 0d 14 c8 89  f2 4d 65 6e 75 45 6e 61  |load.....MenuEna|
000047e0  62 6c 65 28 6d 61 69 6e  5f 4d 65 6e 75 25 2c 32  |ble(main_Menu%,2|
000047f0  29 3a f2 4d 65 6e 75 45  6e 61 62 6c 65 28 6d 61  |):.MenuEnable(ma|
00004800  69 6e 5f 4d 65 6e 75 25  2c 33 29 3a f2 4d 65 6e  |in_Menu%,3):.Men|
00004810  75 45 6e 61 62 6c 65 28  6d 61 69 6e 5f 4d 65 6e  |uEnable(main_Men|
00004820  75 25 2c 35 29 3a f2 4d  65 6e 75 45 6e 61 62 6c  |u%,5):.MenuEnabl|
00004830  65 28 73 6f 6c 76 65 5f  4d 65 6e 75 25 2c 32 29  |e(solve_Menu%,2)|
00004840  3a f2 4d 65 6e 75 45 6e  61 62 6c 65 28 64 69 73  |:.MenuEnable(dis|
00004850  70 6c 61 79 5f 4d 65 6e  75 25 2c 32 29 0d 14 d2  |play_Menu%,2)...|
00004860  3a e3 49 25 3d 31 b8 31  36 38 3a f2 49 63 6f 6e  |:.I%=1.168:.Icon|
00004870  50 75 74 54 65 78 74 28  77 6f 72 64 73 5f 57 69  |PutText(words_Wi|
00004880  6e 64 6f 77 25 2c 49 25  2b 33 2c 77 6f 72 64 24  |ndow%,I%+3,word$|
00004890  28 49 25 29 29 3a ed 0d  14 dc 53 77 6f 72 64 73  |(I%)):....Swords|
000048a0  74 61 74 75 73 24 3d c3  28 77 6f 72 64 73 25 29  |tatus$=.(words%)|
000048b0  2b 22 20 77 6f 72 64 73  20 6c 6f 61 64 65 64 2e  |+" words loaded.|
000048c0  22 3a f2 49 63 6f 6e 50  75 74 54 65 78 74 28 6d  |":.IconPutText(m|
000048d0  61 69 6e 5f 57 69 6e 64  6f 77 25 2c 35 2c 77 6f  |ain_Window%,5,wo|
000048e0  72 64 73 74 61 74 75 73  24 29 0d 14 e6 3c f2 49  |rdstatus$)...<.I|
000048f0  63 6f 6e 50 75 74 54 65  78 74 28 6d 61 69 6e 5f  |conPutText(main_|
00004900  57 69 6e 64 6f 77 25 2c  39 2c a4 47 65 74 46 69  |Window%,9,.GetFi|
00004910  6c 65 46 72 6f 6d 50 61  74 68 6e 61 6d 65 28 74  |leFromPathname(t|
00004920  65 6d 70 24 29 29 0d 14  f0 1d 68 69 67 68 25 3d  |emp$))....high%=|
00004930  30 3a f2 75 70 64 61 74  65 73 6f 6c 76 65 73 74  |0:.updatesolvest|
00004940  61 74 65 0d 14 fa 3e e3  49 25 3d 31 b8 31 36 38  |ate...>.I%=1.168|
00004950  3a e7 77 6f 72 64 73 25  3c 49 25 20 f2 49 63 6f  |:.words%<I% .Ico|
00004960  6e 50 75 74 54 65 78 74  28 77 6f 72 64 73 5f 57  |nPutText(words_W|
00004970  69 6e 64 6f 77 25 2c 49  25 2b 33 2c 22 22 29 3a  |indow%,I%+3,""):|
00004980  ed 0d 15 04 07 f2 77 77  0d 15 0e 38 f2 42 72 69  |......ww...8.Bri|
00004990  6e 67 54 6f 54 6f 70 28  6d 61 69 6e 5f 57 69 6e  |ngToTop(main_Win|
000049a0  64 6f 77 25 29 3a f2 42  72 69 6e 67 54 6f 54 6f  |dow%):.BringToTo|
000049b0  70 28 77 6f 72 64 73 5f  57 69 6e 64 6f 77 25 29  |p(words_Window%)|
000049c0  0d 15 18 5d e7 77 6f 72  64 73 77 69 6e 64 25 3d  |...].wordswind%=|
000049d0  30 20 f2 4d 65 6e 75 54  69 63 6b 28 6d 61 69 6e  |0 .MenuTick(main|
000049e0  5f 4d 65 6e 75 25 2c 32  29 3a f2 4d 65 6e 75 54  |_Menu%,2):.MenuT|
000049f0  69 63 6b 28 73 6f 6c 76  65 5f 4d 65 6e 75 25 2c  |ick(solve_Menu%,|
00004a00  32 29 3a f2 4d 65 6e 75  54 69 63 6b 28 64 69 73  |2):.MenuTick(dis|
00004a10  70 6c 61 79 5f 4d 65 6e  75 25 2c 32 29 0d 15 22  |play_Menu%,2).."|
00004a20  27 77 6f 72 64 73 77 69  6e 64 25 3d 31 3a 6d 61  |'wordswind%=1:ma|
00004a30  69 6e 77 69 6e 64 25 3d  31 3a 6c 65 6e 25 3d a4  |inwind%=1:len%=.|
00004a40  6c 6f 6e 67 0d 15 2c 1e  f2 4d 65 6e 75 45 6e 61  |long..,..MenuEna|
00004a50  62 6c 65 28 77 6f 72 64  73 5f 4d 65 6e 75 25 2c  |ble(words_Menu%,|
00004a60  32 29 0d 15 36 6f f2 49  63 6f 6e 50 75 74 54 65  |2)..6o.IconPutTe|
00004a70  78 74 28 6d 61 69 6e 5f  57 69 6e 64 6f 77 25 2c  |xt(main_Window%,|
00004a80  31 32 2c c3 64 69 6d 78  29 3a f2 49 63 6f 6e 50  |12,.dimx):.IconP|
00004a90  75 74 54 65 78 74 28 6d  61 69 6e 5f 57 69 6e 64  |utText(main_Wind|
00004aa0  6f 77 25 2c 31 36 2c c3  64 69 6d 79 29 3a f2 49  |ow%,16,.dimy):.I|
00004ab0  63 6f 6e 50 75 74 54 65  78 74 28 6d 61 69 6e 5f  |conPutText(main_|
00004ac0  57 69 6e 64 6f 77 25 2c  32 30 2c c3 67 61 70 73  |Window%,20,.gaps|
00004ad0  29 0d 15 40 05 e1 0d 15  4a 05 3a 0d 15 54 14 dd  |)..@....J.:..T..|
00004ae0  f2 4c 6f 61 64 4f 77 6e  28 66 69 6c 65 24 29 0d  |.LoadOwn(file$).|
00004af0  15 5e 0f 66 69 6c 65 3d  8e 66 69 6c 65 24 0d 15  |.^.file=.file$..|
00004b00  68 3b 77 73 71 74 69 74  6c 65 24 3d be 23 66 69  |h;wsqtitle$=.#fi|
00004b10  6c 65 3a 67 61 70 73 3d  bb be 23 66 69 6c 65 3a  |le:gaps=..#file:|
00004b20  64 69 6d 78 3d bb be 23  66 69 6c 65 3a 64 69 6d  |dimx=..#file:dim|
00004b30  79 3d bb be 23 66 69 6c  65 0d 15 72 12 77 6f 72  |y=..#file..r.wor|
00004b40  64 73 25 3d bb be 23 66  69 6c 65 0d 15 7c 10 e3  |ds%=..#file..|..|
00004b50  49 25 3d 31 b8 77 6f 72  64 73 25 0d 15 86 25 77  |I%=1.words%...%w|
00004b60  6f 72 64 24 28 49 25 29  3d be 23 66 69 6c 65 3a  |ord$(I%)=.#file:|
00004b70  6c 65 6e 25 28 49 25 29  3d bb be 23 66 69 6c 65  |len%(I%)=..#file|
00004b80  0d 15 90 27 73 74 61 72  74 25 28 49 25 29 3d bb  |...'start%(I%)=.|
00004b90  be 23 66 69 6c 65 3a 64  69 72 25 28 49 25 29 3d  |.#file:dir%(I%)=|
00004ba0  bb be 23 66 69 6c 65 0d  15 9a 15 73 68 6f 77 25  |..#file....show%|
00004bb0  28 49 25 29 3d bb be 23  66 69 6c 65 0d 15 a4 23  |(I%)=..#file...#|
00004bc0  73 78 25 28 49 25 29 3d  bb be 23 66 69 6c 65 3a  |sx%(I%)=..#file:|
00004bd0  73 79 25 28 49 25 29 3d  bb be 23 66 69 6c 65 0d  |sy%(I%)=..#file.|
00004be0  15 ae 23 65 78 25 28 49  25 29 3d bb be 23 66 69  |..#ex%(I%)=..#fi|
00004bf0  6c 65 3a 65 79 25 28 49  25 29 3d bb be 23 66 69  |le:ey%(I%)=..#fi|
00004c00  6c 65 0d 15 b8 05 ed 0d  15 c2 13 e3 49 25 3d 31  |le..........I%=1|
00004c10  b8 64 69 6d 78 2a 64 69  6d 79 0d 15 cc 14 67 72  |.dimx*dimy....gr|
00004c20  69 64 25 28 49 25 29 3d  9a 23 66 69 6c 65 0d 15  |id%(I%)=.#file..|
00004c30  d6 05 ed 0d 15 e0 0a d9  23 66 69 6c 65 0d 15 ea  |........#file...|
00004c40  16 73 6f 6c 76 65 66 6f  72 6d 61 74 24 3d 22 6f  |.solveformat$="o|
00004c50  77 6e 22 0d 15 f4 0e f2  61 66 74 65 72 6c 6f 61  |wn".....afterloa|
00004c60  64 0d 15 fe 2a f2 49 63  6f 6e 50 75 74 54 65 78  |d...*.IconPutTex|
00004c70  74 28 6d 61 69 6e 5f 57  69 6e 64 6f 77 25 2c 39  |t(main_Window%,9|
00004c80  2c 77 73 71 74 69 74 6c  65 24 29 0d 16 08 37 f2  |,wsqtitle$)...7.|
00004c90  4d 65 6e 75 45 6e 61 62  6c 65 28 6d 61 69 6e 5f  |MenuEnable(main_|
00004ca0  4d 65 6e 75 25 2c 34 29  3a f2 4d 65 6e 75 45 6e  |Menu%,4):.MenuEn|
00004cb0  61 62 6c 65 28 6d 61 69  6e 5f 4d 65 6e 75 25 2c  |able(main_Menu%,|
00004cc0  36 29 0d 16 12 50 f2 49  63 6f 6e 50 75 74 54 65  |6)...P.IconPutTe|
00004cd0  78 74 28 6d 61 69 6e 5f  57 69 6e 64 6f 77 25 2c  |xt(main_Window%,|
00004ce0  36 2c a4 6f 6e 65 6f 72  6d 6f 72 65 28 77 6f 72  |6,.oneormore(wor|
00004cf0  64 73 25 29 2b 22 70 6c  61 63 65 64 20 2d 20 22  |ds%)+"placed - "|
00004d00  2b c3 67 61 70 73 2b 22  25 20 67 61 70 73 2e 20  |+.gaps+"% gaps. |
00004d10  22 29 0d 16 1c 41 e7 a7  66 69 6c 65 24 2c 22 57  |")...A..file$,"W|
00004d20  69 6d 70 24 53 63 72 61  70 22 29 3d 30 20 f2 49  |imp$Scrap")=0 .I|
00004d30  63 6f 6e 50 75 74 54 65  78 74 28 73 61 76 65 77  |conPutText(savew|
00004d40  73 71 5f 57 69 6e 64 6f  77 25 2c 31 2c 66 69 6c  |sq_Window%,1,fil|
00004d50  65 24 29 0d 16 26 53 f2  64 69 73 70 6c 61 79 3a  |e$)..&S.display:|
00004d60  f2 49 63 6f 6e 50 75 74  54 65 78 74 28 73 6f 6c  |.IconPutText(sol|
00004d70  76 65 5f 57 69 6e 64 6f  77 25 2c 35 2c 22 55 73  |ve_Window%,5,"Us|
00004d80  69 6e 67 20 77 6f 72 64  73 71 75 61 72 65 20 66  |ing wordsquare f|
00004d90  72 6f 6d 20 63 72 65 61  74 6f 72 20 70 72 6f 67  |rom creator prog|
00004da0  72 61 6d 2e 22 29 0d 16  30 38 77 73 71 78 3d 64  |ram.")..08wsqx=d|
00004db0  69 6d 78 3a 77 73 71 79  3d 64 69 6d 79 3a 77 73  |imx:wsqy=dimy:ws|
00004dc0  71 77 6f 72 64 73 25 3d  77 6f 72 64 73 25 3a 6e  |qwords%=words%:n|
00004dd0  65 65 64 73 25 3d c6 8e  6c 65 6e 25 28 29 0d 16  |eeds%=..len%()..|
00004de0  3a 45 e3 49 25 3d 31 b8  77 6f 72 64 73 25 3a e7  |:E.I%=1.words%:.|
00004df0  73 68 6f 77 25 28 49 25  29 3e 30 20 68 69 67 68  |show%(I%)>0 high|
00004e00  25 2b 3d 31 3a f2 73 69  63 28 77 6f 72 64 73 5f  |%+=1:.sic(words_|
00004e10  57 69 6e 64 6f 77 25 2c  49 25 2b 33 2c 77 63 6f  |Window%,I%+3,wco|
00004e20  6c 25 29 0d 16 44 05 ed  0d 16 4e 15 f2 75 70 64  |l%)..D....N..upd|
00004e30  61 74 65 73 6f 6c 76 65  73 74 61 74 65 0d 16 58  |atesolvestate..X|
00004e40  05 e1 0d 16 62 05 3a 0d  16 6c 10 dd f2 6c 6f 61  |....b.:..l...loa|
00004e50  64 73 71 75 61 72 65 0d  16 76 20 d9 23 66 69 6c  |dsquare..v .#fil|
00004e60  65 3a 66 69 6c 65 3d 8e  66 69 6c 65 24 3a 64 24  |e:file=.file$:d$|
00004e70  3d be 23 66 69 6c 65 0d  16 80 1b 64 69 6d 79 3d  |=.#file....dimy=|
00004e80  30 3a 64 25 3d 30 3a f5  3a 64 24 3d be 23 66 69  |0:d%=0:.:d$=.#fi|
00004e90  6c 65 0d 16 8a 3a e7 a9  64 24 3e 30 20 64 69 6d  |le...:..d$>0 dim|
00004ea0  79 2b 3d 31 3a e3 49 25  3d 31 b8 64 69 6d 78 3a  |y+=1:.I%=1.dimx:|
00004eb0  64 25 2b 3d 31 3a 67 72  69 64 25 28 64 25 29 3d  |d%+=1:grid%(d%)=|
00004ec0  97 c1 64 24 2c 49 25 2c  31 29 3a ed 0d 16 94 0b  |..d$,I%,1):.....|
00004ed0  fd c5 23 66 69 6c 65 0d  16 9e 17 77 73 71 78 3d  |..#file....wsqx=|
00004ee0  64 69 6d 78 3a 77 73 71  79 3d 64 69 6d 79 0d 16  |dimx:wsqy=dimy..|
00004ef0  a8 0a d9 23 66 69 6c 65  0d 16 b2 32 f7 3a e3 49  |...#file...2.:.I|
00004f00  25 3d 31 b8 31 30 3a f3  64 25 3a f2 49 63 6f 6e  |%=1.10:.d%:.Icon|
00004f10  44 69 73 61 62 6c 65 28  6d 61 69 6e 5f 57 69 6e  |Disable(main_Win|
00004f20  64 6f 77 25 2c 64 25 29  3a ed 0d 16 bc 4a 77 6f  |dow%,d%):....Jwo|
00004f30  72 64 73 74 61 74 75 73  24 3d 22 4e 6f 20 77 6f  |rdstatus$="No wo|
00004f40  72 64 73 20 66 6f 75 6e  64 2e 22 3a f2 49 63 6f  |rds found.":.Ico|
00004f50  6e 50 75 74 54 65 78 74  28 6d 61 69 6e 5f 57 69  |nPutText(main_Wi|
00004f60  6e 64 6f 77 25 2c 35 2c  77 6f 72 64 73 74 61 74  |ndow%,5,wordstat|
00004f70  75 73 24 29 0d 16 c6 2a  e3 49 25 3d 34 b8 36 88  |us$)...*.I%=4.6.|
00004f80  32 3a f2 4d 65 6e 75 45  6e 61 62 6c 65 28 6d 61  |2:.MenuEnable(ma|
00004f90  69 6e 5f 4d 65 6e 75 25  2c 49 25 29 3a ed 0d 16  |in_Menu%,I%):...|
00004fa0  d0 0b 68 69 67 68 25 3d  30 0d 16 da 70 f2 42 72  |..high%=0...p.Br|
00004fb0  69 6e 67 54 6f 54 6f 70  28 73 6f 6c 76 65 5f 57  |ingToTop(solve_W|
00004fc0  69 6e 64 6f 77 25 29 3a  f2 42 72 69 6e 67 54 6f  |indow%):.BringTo|
00004fd0  54 6f 70 28 64 69 73 70  6c 61 79 5f 57 69 6e 64  |Top(display_Wind|
00004fe0  6f 77 25 29 3a f2 57 69  6e 64 6f 77 43 6c 6f 73  |ow%):.WindowClos|
00004ff0  65 28 77 6f 72 64 73 5f  57 69 6e 64 6f 77 25 29  |e(words_Window%)|
00005000  3a 77 6f 72 64 73 77 69  6e 64 25 3d 30 3a 64 69  |:wordswind%=0:di|
00005010  73 70 77 69 6e 64 25 3d  31 0d 16 e4 7c 73 6f 6c  |spwind%=1...|sol|
00005020  76 65 77 69 6e 64 25 3d  31 3a f2 49 63 6f 6e 50  |vewind%=1:.IconP|
00005030  75 74 54 65 78 74 28 6d  61 69 6e 5f 57 69 6e 64  |utText(main_Wind|
00005040  6f 77 25 2c 31 32 2c c3  64 69 6d 78 29 3a f2 49  |ow%,12,.dimx):.I|
00005050  63 6f 6e 50 75 74 54 65  78 74 28 6d 61 69 6e 5f  |conPutText(main_|
00005060  57 69 6e 64 6f 77 25 2c  31 36 2c c3 64 69 6d 79  |Window%,16,.dimy|
00005070  29 3a f2 49 63 6f 6e 50  75 74 54 65 78 74 28 6d  |):.IconPutText(m|
00005080  61 69 6e 5f 57 69 6e 64  6f 77 25 2c 32 30 2c 22  |ain_Window%,20,"|
00005090  31 30 30 22 29 0d 16 ee  69 f2 64 69 73 70 6c 61  |100")...i.displa|
000050a0  79 3a f2 49 63 6f 6e 50  75 74 54 65 78 74 28 73  |y:.IconPutText(s|
000050b0  6f 6c 76 65 5f 57 69 6e  64 6f 77 25 2c 35 2c 22  |olve_Window%,5,"|
000050c0  55 73 69 6e 67 20 74 65  78 74 66 69 6c 65 20 77  |Using textfile w|
000050d0  6f 72 64 73 71 75 61 72  65 20 27 22 2b a4 47 65  |ordsquare '"+.Ge|
000050e0  74 46 69 6c 65 46 72 6f  6d 50 61 74 68 6e 61 6d  |tFileFromPathnam|
000050f0  65 28 74 65 6d 70 24 29  2b 22 27 2e 22 29 0d 16  |e(temp$)+"'.")..|
00005100  f8 5f f2 49 63 6f 6e 50  75 74 54 65 78 74 28 6d  |._.IconPutText(m|
00005110  61 69 6e 5f 57 69 6e 64  6f 77 25 2c 36 2c 22 55  |ain_Window%,6,"U|
00005120  73 69 6e 67 20 74 65 78  74 66 69 6c 65 20 77 6f  |sing textfile wo|
00005130  72 64 73 71 75 61 72 65  20 27 22 2b a4 47 65 74  |rdsquare '"+.Get|
00005140  46 69 6c 65 46 72 6f 6d  50 61 74 68 6e 61 6d 65  |FileFromPathname|
00005150  28 74 65 6d 70 24 29 2b  22 27 2e 22 29 0d 17 02  |(temp$)+"'.")...|
00005160  33 f2 49 63 6f 6e 50 75  74 54 65 78 74 28 73 6f  |3.IconPutText(so|
00005170  6c 76 65 5f 57 69 6e 64  6f 77 25 2c 36 2c 22 4e  |lve_Window%,6,"N|
00005180  6f 20 77 6f 72 64 73 20  66 6f 75 6e 64 2e 22 29  |o words found.")|
00005190  0d 17 0c 41 e7 a7 66 69  6c 65 24 2c 22 57 69 6d  |...A..file$,"Wim|
000051a0  70 24 53 63 72 61 70 22  29 3d 30 20 f2 49 63 6f  |p$Scrap")=0 .Ico|
000051b0  6e 50 75 74 54 65 78 74  28 73 61 76 65 77 73 71  |nPutText(savewsq|
000051c0  5f 57 69 6e 64 6f 77 25  2c 31 2c 66 69 6c 65 24  |_Window%,1,file$|
000051d0  29 0d 17 16 05 e1 0d 17  20 05 3a 0d 17 2a 0f dd  |)....... .:..*..|
000051e0  f2 6c 6f 61 64 70 72 65  66 73 0d 17 34 1e 66 69  |.loadprefs..4.fi|
000051f0  6c 65 3d 8e 22 3c 57 6f  72 64 53 71 24 44 69 72  |le=."<WordSq$Dir|
00005200  3e 2e 50 72 65 66 73 22  0d 17 3e 2d 64 62 6c 25  |>.Prefs"..>-dbl%|
00005210  3d bb be 23 66 69 6c 65  3a 66 6f 72 63 65 25 3d  |=..#file:force%=|
00005220  bb be 23 66 69 6c 65 3a  63 61 70 73 25 3d bb be  |..#file:caps%=..|
00005230  23 66 69 6c 65 0d 17 48  2f f4 20 64 62 6c 25 3d  |#file..H/. dbl%=|
00005240  30 20 66 6f 72 20 73 70  61 63 69 6e 67 20 6f 66  |0 for spacing of|
00005250  66 2c 20 2d 31 20 66 6f  72 20 73 70 61 63 69 6e  |f, -1 for spacin|
00005260  67 20 6f 6e 0d 17 52 32  f4 20 63 61 70 73 25 3d  |g on..R2. caps%=|
00005270  30 20 66 6f 72 20 70 72  65 73 65 72 76 65 20 63  |0 for preserve c|
00005280  61 73 65 2c 20 2d 31 20  66 6f 72 20 63 61 70 69  |ase, -1 for capi|
00005290  74 61 6c 69 73 65 0d 17  5c 42 f4 20 66 6f 72 63  |talise..\B. forc|
000052a0  65 25 3d 30 20 66 6f 72  20 66 6f 72 63 65 20 73  |e%=0 for force s|
000052b0  69 6e 67 6c 65 20 63 6f  6c 75 6d 6e 2c 20 2d 31  |ingle column, -1|
000052c0  20 66 6f 72 20 61 75 74  6f 6d 61 74 69 63 20 73  | for automatic s|
000052d0  65 6c 65 63 74 69 6f 6e  0d 17 66 1e 63 6f 6c 25  |election..f.col%|
000052e0  3d bb be 23 66 69 6c 65  3a 6d 63 6f 6c 25 3d bb  |=..#file:mcol%=.|
000052f0  be 23 66 69 6c 65 0d 17  70 1f 77 63 6f 6c 25 3d  |.#file..p.wcol%=|
00005300  bb be 23 66 69 6c 65 3a  6c 63 6f 6c 25 3d bb be  |..#file:lcol%=..|
00005310  23 66 69 6c 65 0d 17 7a  26 74 69 74 6c 65 66 6f  |#file..z&titlefo|
00005320  6e 74 24 3d be 23 66 69  6c 65 3a 74 69 74 6c 65  |nt$=.#file:title|
00005330  70 74 25 3d bb be 23 66  69 6c 65 0d 17 84 24 67  |pt%=..#file...$g|
00005340  72 69 64 66 6f 6e 74 24  3d be 23 66 69 6c 65 3a  |ridfont$=.#file:|
00005350  67 72 69 64 70 74 25 3d  bb be 23 66 69 6c 65 0d  |gridpt%=..#file.|
00005360  17 8e 26 77 6f 72 64 73  66 6f 6e 74 24 3d be 23  |..&wordsfont$=.#|
00005370  66 69 6c 65 3a 77 6f 72  64 73 70 74 25 3d bb be  |file:wordspt%=..|
00005380  23 66 69 6c 65 0d 17 98  1c 70 72 65 24 3d be 23  |#file....pre$=.#|
00005390  66 69 6c 65 3a 70 6f 73  74 24 3d be 23 66 69 6c  |file:post$=.#fil|
000053a0  65 0d 17 a2 22 6f 76 65  72 6f 6e 24 3d be 23 66  |e..."overon$=.#f|
000053b0  69 6c 65 3a 6f 76 65 72  6f 66 66 24 3d be 23 66  |ile:overoff$=.#f|
000053c0  69 6c 65 0d 17 ac 24 75  6e 64 65 72 6f 6e 24 3d  |ile...$underon$=|
000053d0  be 23 66 69 6c 65 3a 75  6e 64 65 72 6f 66 66 24  |.#file:underoff$|
000053e0  3d be 23 66 69 6c 65 0d  17 b6 22 65 6d 70 68 6f  |=.#file..."empho|
000053f0  6e 24 3d be 23 66 69 6c  65 3a 65 6d 70 68 6f 66  |n$=.#file:emphof|
00005400  66 24 3d be 23 66 69 6c  65 0d 17 c0 0a d9 23 66  |f$=.#file.....#f|
00005410  69 6c 65 0d 17 ca 33 74  65 6d 70 64 62 6c 25 3d  |ile...3tempdbl%=|
00005420  64 62 6c 25 3a 74 65 6d  70 63 61 70 73 25 3d 63  |dbl%:tempcaps%=c|
00005430  61 70 73 25 3a 74 65 6d  70 66 6f 72 63 65 25 3d  |aps%:tempforce%=|
00005440  66 6f 72 63 65 25 0d 17  d4 41 74 65 6d 70 63 6f  |force%...Atempco|
00005450  6c 25 3d 63 6f 6c 25 3a  74 65 6d 70 77 63 6f 6c  |l%=col%:tempwcol|
00005460  25 3d 77 63 6f 6c 25 3a  74 65 6d 70 6c 63 6f 6c  |%=wcol%:templcol|
00005470  25 3d 6c 63 6f 6c 25 3a  74 65 6d 70 6d 63 6f 6c  |%=lcol%:tempmcol|
00005480  25 3d 6d 63 6f 6c 25 0d  17 de 43 74 65 6d 70 74  |%=mcol%...Ctempt|
00005490  69 74 6c 65 70 74 25 3d  74 69 74 6c 65 70 74 25  |itlept%=titlept%|
000054a0  3a 74 65 6d 70 67 72 69  64 70 74 25 3d 67 72 69  |:tempgridpt%=gri|
000054b0  64 70 74 25 3a 74 65 6d  70 77 6f 72 64 73 70 74  |dpt%:tempwordspt|
000054c0  25 3d 77 6f 72 64 73 70  74 25 0d 17 e8 0d f2 73  |%=wordspt%.....s|
000054d0  65 74 70 72 65 66 73 0d  17 f2 25 e7 64 62 6c 25  |etprefs...%.dbl%|
000054e0  3d 30 20 f2 53 65 74 49  63 6f 6e 28 70 72 65 66  |=0 .SetIcon(pref|
000054f0  73 5f 57 69 6e 64 6f 77  25 2c 33 29 0d 17 fc 43  |s_Window%,3)...C|
00005500  e7 63 61 70 73 25 3d 2d  31 20 f2 53 65 74 49 63  |.caps%=-1 .SetIc|
00005510  6f 6e 28 70 72 65 66 73  5f 57 69 6e 64 6f 77 25  |on(prefs_Window%|
00005520  2c 32 39 29 3a f2 53 65  74 49 63 6f 6e 28 70 72  |,29):.SetIcon(pr|
00005530  65 66 73 5f 57 69 6e 64  6f 77 25 2c 33 30 29 0d  |efs_Window%,30).|
00005540  18 06 43 e7 66 6f 72 63  65 25 3d 30 20 f2 53 65  |..C.force%=0 .Se|
00005550  74 49 63 6f 6e 28 70 72  65 66 73 5f 57 69 6e 64  |tIcon(prefs_Wind|
00005560  6f 77 25 2c 34 35 29 3a  f2 53 65 74 49 63 6f 6e  |ow%,45):.SetIcon|
00005570  28 70 72 65 66 73 5f 57  69 6e 64 6f 77 25 2c 34  |(prefs_Window%,4|
00005580  36 29 0d 18 10 3c f2 73  69 62 28 70 72 65 66 73  |6)...<.sib(prefs|
00005590  5f 57 69 6e 64 6f 77 25  2c 35 30 2c 63 6f 6c 25  |_Window%,50,col%|
000055a0  29 3a f2 73 69 62 28 70  72 65 66 73 5f 57 69 6e  |):.sib(prefs_Win|
000055b0  64 6f 77 25 2c 35 31 2c  6d 63 6f 6c 25 29 0d 18  |dow%,51,mcol%)..|
000055c0  1a 3d f2 73 69 62 28 70  72 65 66 73 5f 57 69 6e  |.=.sib(prefs_Win|
000055d0  64 6f 77 25 2c 35 33 2c  77 63 6f 6c 25 29 3a f2  |dow%,53,wcol%):.|
000055e0  73 69 62 28 70 72 65 66  73 5f 57 69 6e 64 6f 77  |sib(prefs_Window|
000055f0  25 2c 35 34 2c 6c 63 6f  6c 25 29 0d 18 24 05 e1  |%,54,lcol%)..$..|
00005600  0d 18 2e 05 3a 0d 18 38  05 3a 0d 18 42 0e dd f2  |....:..8.:..B...|
00005610  73 65 74 70 72 65 66 73  0d 18 4c 5b f2 49 63 6f  |setprefs..L[.Ico|
00005620  6e 50 75 74 54 65 78 74  28 70 72 65 66 73 5f 57  |nPutText(prefs_W|
00005630  69 6e 64 6f 77 25 2c 37  2c 74 69 74 6c 65 66 6f  |indow%,7,titlefo|
00005640  6e 74 24 29 3a f2 49 63  6f 6e 50 75 74 54 65 78  |nt$):.IconPutTex|
00005650  74 28 70 72 65 66 73 5f  57 69 6e 64 6f 77 25 2c  |t(prefs_Window%,|
00005660  33 32 2c c3 74 69 74 6c  65 70 74 25 2b 22 20 70  |32,.titlept%+" p|
00005670  74 22 29 0d 18 56 59 f2  49 63 6f 6e 50 75 74 54  |t")..VY.IconPutT|
00005680  65 78 74 28 70 72 65 66  73 5f 57 69 6e 64 6f 77  |ext(prefs_Window|
00005690  25 2c 39 2c 67 72 69 64  66 6f 6e 74 24 29 3a f2  |%,9,gridfont$):.|
000056a0  49 63 6f 6e 50 75 74 54  65 78 74 28 70 72 65 66  |IconPutText(pref|
000056b0  73 5f 57 69 6e 64 6f 77  25 2c 33 35 2c c3 67 72  |s_Window%,35,.gr|
000056c0  69 64 70 74 25 2b 22 20  70 74 22 29 0d 18 60 5c  |idpt%+" pt")..`\|
000056d0  f2 49 63 6f 6e 50 75 74  54 65 78 74 28 70 72 65  |.IconPutText(pre|
000056e0  66 73 5f 57 69 6e 64 6f  77 25 2c 31 33 2c 77 6f  |fs_Window%,13,wo|
000056f0  72 64 73 66 6f 6e 74 24  29 3a f2 49 63 6f 6e 50  |rdsfont$):.IconP|
00005700  75 74 54 65 78 74 28 70  72 65 66 73 5f 57 69 6e  |utText(prefs_Win|
00005710  64 6f 77 25 2c 33 38 2c  c3 77 6f 72 64 73 70 74  |dow%,38,.wordspt|
00005720  25 2b 22 20 70 74 22 29  0d 18 6a 9b f2 49 63 6f  |%+" pt")..j..Ico|
00005730  6e 50 75 74 54 65 78 74  28 70 72 65 66 73 5f 57  |nPutText(prefs_W|
00005740  69 6e 64 6f 77 25 2c 31  37 2c 70 72 65 24 29 3a  |indow%,17,pre$):|
00005750  f2 49 63 6f 6e 50 75 74  54 65 78 74 28 70 72 65  |.IconPutText(pre|
00005760  66 73 5f 57 69 6e 64 6f  77 25 2c 32 33 2c 70 6f  |fs_Window%,23,po|
00005770  73 74 24 29 3a f2 49 63  6f 6e 50 75 74 54 65 78  |st$):.IconPutTex|
00005780  74 28 70 72 65 66 73 5f  57 69 6e 64 6f 77 25 2c  |t(prefs_Window%,|
00005790  32 34 2c 6f 76 65 72 6f  6e 24 29 3a f2 49 63 6f  |24,overon$):.Ico|
000057a0  6e 50 75 74 54 65 78 74  28 70 72 65 66 73 5f 57  |nPutText(prefs_W|
000057b0  69 6e 64 6f 77 25 2c 32  35 2c 6f 76 65 72 6f 66  |indow%,25,overof|
000057c0  66 24 29 0d 18 74 a3 f2  49 63 6f 6e 50 75 74 54  |f$)..t..IconPutT|
000057d0  65 78 74 28 70 72 65 66  73 5f 57 69 6e 64 6f 77  |ext(prefs_Window|
000057e0  25 2c 32 36 2c 75 6e 64  65 72 6f 6e 24 29 3a f2  |%,26,underon$):.|
000057f0  49 63 6f 6e 50 75 74 54  65 78 74 28 70 72 65 66  |IconPutText(pref|
00005800  73 5f 57 69 6e 64 6f 77  25 2c 32 37 2c 75 6e 64  |s_Window%,27,und|
00005810  65 72 6f 66 66 24 29 3a  f2 49 63 6f 6e 50 75 74  |eroff$):.IconPut|
00005820  54 65 78 74 28 70 72 65  66 73 5f 57 69 6e 64 6f  |Text(prefs_Windo|
00005830  77 25 2c 34 31 2c 65 6d  70 68 6f 6e 24 29 3a f2  |w%,41,emphon$):.|
00005840  49 63 6f 6e 50 75 74 54  65 78 74 28 70 72 65 66  |IconPutText(pref|
00005850  73 5f 57 69 6e 64 6f 77  25 2c 34 33 2c 65 6d 70  |s_Window%,43,emp|
00005860  68 6f 66 66 24 29 0d 18  7e 3c f2 73 69 62 28 70  |hoff$)..~<.sib(p|
00005870  72 65 66 73 5f 57 69 6e  64 6f 77 25 2c 35 30 2c  |refs_Window%,50,|
00005880  63 6f 6c 25 29 3a f2 73  69 62 28 70 72 65 66 73  |col%):.sib(prefs|
00005890  5f 57 69 6e 64 6f 77 25  2c 35 31 2c 6d 63 6f 6c  |_Window%,51,mcol|
000058a0  25 29 0d 18 88 3d f2 73  69 62 28 70 72 65 66 73  |%)...=.sib(prefs|
000058b0  5f 57 69 6e 64 6f 77 25  2c 35 33 2c 77 63 6f 6c  |_Window%,53,wcol|
000058c0  25 29 3a f2 73 69 62 28  70 72 65 66 73 5f 57 69  |%):.sib(prefs_Wi|
000058d0  6e 64 6f 77 25 2c 35 34  2c 6c 63 6f 6c 25 29 0d  |ndow%,54,lcol%).|
000058e0  18 92 39 e3 49 25 3d 31  b8 31 36 38 3a e7 73 68  |..9.I%=1.168:.sh|
000058f0  6f 77 25 28 49 25 29 3e  30 20 f2 73 69 63 28 77  |ow%(I%)>0 .sic(w|
00005900  6f 72 64 73 5f 57 69 6e  64 6f 77 25 2c 49 25 2b  |ords_Window%,I%+|
00005910  33 2c 77 63 6f 6c 25 29  0d 18 9c 05 ed 0d 18 a6  |3,wcol%)........|
00005920  25 f2 57 69 6e 64 6f 77  46 6f 72 63 65 44 72 61  |%.WindowForceDra|
00005930  77 28 64 69 73 70 6c 61  79 5f 57 69 6e 64 6f 77  |w(display_Window|
00005940  25 29 0d 18 b0 05 e1 0d  18 ba 05 3a 0d 18 c4 0e  |%).........:....|
00005950  dd f2 67 65 74 70 72 65  66 73 0d 18 ce 33 64 62  |..getprefs...3db|
00005960  6c 25 3d 74 65 6d 70 64  62 6c 25 3a 63 61 70 73  |l%=tempdbl%:caps|
00005970  25 3d 74 65 6d 70 63 61  70 73 25 3a 66 6f 72 63  |%=tempcaps%:forc|
00005980  65 25 3d 74 65 6d 70 66  6f 72 63 65 25 0d 18 d8  |e%=tempforce%...|
00005990  41 63 6f 6c 25 3d 74 65  6d 70 63 6f 6c 25 3a 6d  |Acol%=tempcol%:m|
000059a0  63 6f 6c 25 3d 74 65 6d  70 6d 63 6f 6c 25 3a 77  |col%=tempmcol%:w|
000059b0  63 6f 6c 25 3d 74 65 6d  70 77 63 6f 6c 25 3a 6c  |col%=tempwcol%:l|
000059c0  63 6f 6c 25 3d 74 65 6d  70 6c 63 6f 6c 25 0d 18  |col%=templcol%..|
000059d0  e2 4f 74 69 74 6c 65 66  6f 6e 74 24 3d a4 49 63  |.Otitlefont$=.Ic|
000059e0  6f 6e 54 65 78 74 28 70  72 65 66 73 5f 57 69 6e  |onText(prefs_Win|
000059f0  64 6f 77 25 2c 37 29 3a  74 69 74 6c 65 70 74 25  |dow%,7):titlept%|
00005a00  3d bb a4 49 63 6f 6e 54  65 78 74 28 70 72 65 66  |=..IconText(pref|
00005a10  73 5f 57 69 6e 64 6f 77  25 2c 33 32 29 0d 18 ec  |s_Window%,32)...|
00005a20  4d 67 72 69 64 66 6f 6e  74 24 3d a4 49 63 6f 6e  |Mgridfont$=.Icon|
00005a30  54 65 78 74 28 70 72 65  66 73 5f 57 69 6e 64 6f  |Text(prefs_Windo|
00005a40  77 25 2c 39 29 3a 67 72  69 64 70 74 25 3d bb a4  |w%,9):gridpt%=..|
00005a50  49 63 6f 6e 54 65 78 74  28 70 72 65 66 73 5f 57  |IconText(prefs_W|
00005a60  69 6e 64 6f 77 25 2c 33  35 29 0d 18 f6 50 77 6f  |indow%,35)...Pwo|
00005a70  72 64 73 66 6f 6e 74 24  3d a4 49 63 6f 6e 54 65  |rdsfont$=.IconTe|
00005a80  78 74 28 70 72 65 66 73  5f 57 69 6e 64 6f 77 25  |xt(prefs_Window%|
00005a90  2c 31 33 29 3a 77 6f 72  64 73 70 74 25 3d bb a4  |,13):wordspt%=..|
00005aa0  49 63 6f 6e 54 65 78 74  28 70 72 65 66 73 5f 57  |IconText(prefs_W|
00005ab0  69 6e 64 6f 77 25 2c 33  38 29 0d 19 00 46 70 72  |indow%,38)...Fpr|
00005ac0  65 24 3d a4 49 63 6f 6e  54 65 78 74 28 70 72 65  |e$=.IconText(pre|
00005ad0  66 73 5f 57 69 6e 64 6f  77 25 2c 31 37 29 3a 70  |fs_Window%,17):p|
00005ae0  6f 73 74 24 3d a4 49 63  6f 6e 54 65 78 74 28 70  |ost$=.IconText(p|
00005af0  72 65 66 73 5f 57 69 6e  64 6f 77 25 2c 32 33 29  |refs_Window%,23)|
00005b00  0d 19 0a 4c 6f 76 65 72  6f 6e 24 3d a4 49 63 6f  |...Loveron$=.Ico|
00005b10  6e 54 65 78 74 28 70 72  65 66 73 5f 57 69 6e 64  |nText(prefs_Wind|
00005b20  6f 77 25 2c 32 34 29 3a  6f 76 65 72 6f 66 66 24  |ow%,24):overoff$|
00005b30  3d a4 49 63 6f 6e 54 65  78 74 28 70 72 65 66 73  |=.IconText(prefs|
00005b40  5f 57 69 6e 64 6f 77 25  2c 32 35 29 0d 19 14 4e  |_Window%,25)...N|
00005b50  75 6e 64 65 72 6f 6e 24  3d a4 49 63 6f 6e 54 65  |underon$=.IconTe|
00005b60  78 74 28 70 72 65 66 73  5f 57 69 6e 64 6f 77 25  |xt(prefs_Window%|
00005b70  2c 32 36 29 3a 75 6e 64  65 72 6f 66 66 24 3d a4  |,26):underoff$=.|
00005b80  49 63 6f 6e 54 65 78 74  28 70 72 65 66 73 5f 57  |IconText(prefs_W|
00005b90  69 6e 64 6f 77 25 2c 32  37 29 0d 19 1e 4c 65 6d  |indow%,27)...Lem|
00005ba0  70 68 6f 6e 24 3d a4 49  63 6f 6e 54 65 78 74 28  |phon$=.IconText(|
00005bb0  70 72 65 66 73 5f 57 69  6e 64 6f 77 25 2c 34 31  |prefs_Window%,41|
00005bc0  29 3a 65 6d 70 68 6f 66  66 24 3d a4 49 63 6f 6e  |):emphoff$=.Icon|
00005bd0  54 65 78 74 28 70 72 65  66 73 5f 57 69 6e 64 6f  |Text(prefs_Windo|
00005be0  77 25 2c 34 33 29 0d 19  28 39 e3 49 25 3d 31 b8  |w%,43)..(9.I%=1.|
00005bf0  31 36 38 3a e7 73 68 6f  77 25 28 49 25 29 3e 30  |168:.show%(I%)>0|
00005c00  20 f2 73 69 63 28 77 6f  72 64 73 5f 57 69 6e 64  | .sic(words_Wind|
00005c10  6f 77 25 2c 49 25 2b 33  2c 77 63 6f 6c 25 29 0d  |ow%,I%+3,wcol%).|
00005c20  19 32 05 ed 0d 19 3c 25  f2 57 69 6e 64 6f 77 46  |.2....<%.WindowF|
00005c30  6f 72 63 65 44 72 61 77  28 64 69 73 70 6c 61 79  |orceDraw(display|
00005c40  5f 57 69 6e 64 6f 77 25  29 0d 19 46 05 e1 0d 19  |_Window%)..F....|
00005c50  50 05 3a 0d 19 5a 23 dd  f2 45 76 65 6e 74 5f 53  |P.:..Z#..Event_S|
00005c60  61 76 65 46 69 6c 65 28  66 69 6c 65 24 2c 77 69  |aveFile(file$,wi|
00005c70  6e 64 6f 77 25 29 0d 19  64 10 c8 8e 20 77 69 6e  |ndow%)..d... win|
00005c80  64 6f 77 25 20 ca 0d 19  6e 21 c9 20 73 61 76 65  |dow% ...n!. save|
00005c90  77 73 71 5f 57 69 6e 64  6f 77 25 3a f2 73 61 76  |wsq_Window%:.sav|
00005ca0  65 73 71 75 61 72 65 0d  19 78 13 c9 20 73 6f 6c  |esquare..x.. sol|
00005cb0  76 65 5f 57 69 6e 64 6f  77 25 0d 19 82 12 c9 20  |ve_Window%..... |
00005cc0  69 6e 66 6f 5f 57 69 6e  64 6f 77 25 0d 19 8c 13  |info_Window%....|
00005cd0  c9 20 70 72 65 66 73 5f  57 69 6e 64 6f 77 25 0d  |. prefs_Window%.|
00005ce0  19 96 29 c9 20 73 61 76  65 77 6f 72 64 73 5f 57  |..). savewords_W|
00005cf0  69 6e 64 6f 77 25 3a f2  73 61 76 65 77 6f 72 64  |indow%:.saveword|
00005d00  73 28 66 69 6c 65 24 29  0d 19 a0 15 c9 20 64 69  |s(file$)..... di|
00005d10  73 70 6c 61 79 5f 57 69  6e 64 6f 77 25 0d 19 aa  |splay_Window%...|
00005d20  13 c9 20 77 6f 72 64 73  5f 57 69 6e 64 6f 77 25  |.. words_Window%|
00005d30  0d 19 b4 12 c9 20 6d 61  69 6e 5f 57 69 6e 64 6f  |..... main_Windo|
00005d40  77 25 0d 19 be 05 cb 0d  19 c8 0e f2 4d 65 6e 75  |w%..........Menu|
00005d50  43 6c 6f 73 65 0d 19 d2  05 e1 0d 19 dc 05 3a 0d  |Close.........:.|
00005d60  19 e6 16 dd f2 73 61 76  65 77 6f 72 64 73 28 66  |.....savewords(f|
00005d70  69 6c 65 24 29 0d 19 f0  25 e7 73 61 76 65 66 6f  |ile$)...%.savefo|
00005d80  72 6d 61 74 24 3c 3e 22  70 72 69 6e 74 22 20 66  |rmat$<>"print" f|
00005d90  69 6c 65 3d ae 66 69 6c  65 24 0d 19 fa 24 e3 49  |ile=.file$...$.I|
00005da0  25 3d 31 b8 77 6f 72 64  73 25 3a f2 70 75 74 28  |%=1.words%:.put(|
00005db0  77 6f 72 64 24 28 49 25  29 2c 30 29 3a ed 0d 1a  |word$(I%),0):...|
00005dc0  04 48 e7 73 61 76 65 66  6f 72 6d 61 74 24 3c 3e  |.H.saveformat$<>|
00005dd0  22 70 72 69 6e 74 22 20  d9 23 66 69 6c 65 3a ff  |"print" .#file:.|
00005de0  22 53 45 54 54 59 50 45  20 22 2b 66 69 6c 65 24  |"SETTYPE "+file$|
00005df0  2b 22 20 54 65 78 74 22  3a 77 6f 72 64 73 73 61  |+" Text":wordssa|
00005e00  76 65 64 25 3d 31 0d 1a  0e 05 e1 0d 1a 18 05 3a  |ved%=1.........:|
00005e10  0d 1a 22 14 dd f2 73 61  76 65 6f 77 6e 28 66 69  |.."...saveown(fi|
00005e20  6c 65 24 29 0d 1a 2c 31  c8 94 20 64 69 6d 78 2c  |le$)..,1.. dimx,|
00005e30  77 73 71 78 3a c8 94 20  64 69 6d 79 2c 77 73 71  |wsqx:.. dimy,wsq|
00005e40  79 3a c8 94 20 77 6f 72  64 73 25 2c 77 73 71 77  |y:.. words%,wsqw|
00005e50  6f 72 64 73 25 0d 1a 36  0f 66 69 6c 65 3d ae 66  |ords%..6.file=.f|
00005e60  69 6c 65 24 0d 1a 40 3b  d5 23 66 69 6c 65 2c 77  |ile$..@;.#file,w|
00005e70  73 71 74 69 74 6c 65 24  3a d5 23 66 69 6c 65 2c  |sqtitle$:.#file,|
00005e80  c3 67 61 70 73 3a d5 23  66 69 6c 65 2c c3 64 69  |.gaps:.#file,.di|
00005e90  6d 78 3a d5 23 66 69 6c  65 2c c3 64 69 6d 79 0d  |mx:.#file,.dimy.|
00005ea0  1a 4a 12 d5 23 66 69 6c  65 2c c3 77 6f 72 64 73  |.J..#file,.words|
00005eb0  25 0d 1a 54 10 e3 49 25  3d 31 b8 77 6f 72 64 73  |%..T..I%=1.words|
00005ec0  25 0d 1a 5e 25 d5 23 66  69 6c 65 2c 77 6f 72 64  |%..^%.#file,word|
00005ed0  24 28 49 25 29 3a d5 23  66 69 6c 65 2c c3 6c 65  |$(I%):.#file,.le|
00005ee0  6e 25 28 49 25 29 0d 1a  68 27 d5 23 66 69 6c 65  |n%(I%)..h'.#file|
00005ef0  2c c3 73 74 61 72 74 25  28 49 25 29 3a d5 23 66  |,.start%(I%):.#f|
00005f00  69 6c 65 2c c3 64 69 72  25 28 49 25 29 0d 1a 72  |ile,.dir%(I%)..r|
00005f10  15 d5 23 66 69 6c 65 2c  c3 73 68 6f 77 25 28 49  |..#file,.show%(I|
00005f20  25 29 0d 1a 7c 23 d5 23  66 69 6c 65 2c c3 73 78  |%)..|#.#file,.sx|
00005f30  25 28 49 25 29 3a d5 23  66 69 6c 65 2c c3 73 79  |%(I%):.#file,.sy|
00005f40  25 28 49 25 29 0d 1a 86  23 d5 23 66 69 6c 65 2c  |%(I%)...#.#file,|
00005f50  c3 65 78 25 28 49 25 29  3a d5 23 66 69 6c 65 2c  |.ex%(I%):.#file,|
00005f60  c3 65 79 25 28 49 25 29  0d 1a 90 05 ed 0d 1a 9a  |.ey%(I%)........|
00005f70  13 e3 49 25 3d 31 b8 64  69 6d 78 2a 64 69 6d 79  |..I%=1.dimx*dimy|
00005f80  0d 1a a4 14 d5 23 66 69  6c 65 2c 67 72 69 64 25  |.....#file,grid%|
00005f90  28 49 25 29 0d 1a ae 05  ed 0d 1a b8 0a d9 23 66  |(I%)..........#f|
00005fa0  69 6c 65 0d 1a c2 1c ff  22 53 45 54 54 59 50 45  |ile....."SETTYPE|
00005fb0  20 22 2b 66 69 6c 65 24  2b 22 20 30 33 43 22 0d  | "+file$+" 03C".|
00005fc0  1a cc 31 c8 94 20 64 69  6d 78 2c 77 73 71 78 3a  |..1.. dimx,wsqx:|
00005fd0  c8 94 20 64 69 6d 79 2c  77 73 71 79 3a c8 94 20  |.. dimy,wsqy:.. |
00005fe0  77 6f 72 64 73 25 2c 77  73 71 77 6f 72 64 73 25  |words%,wsqwords%|
00005ff0  0d 1a d6 1e 67 72 69 64  73 61 76 65 64 25 3d 31  |....gridsaved%=1|
00006000  3a 77 6f 72 64 73 73 61  76 65 64 25 3d 31 0d 1a  |:wordssaved%=1..|
00006010  e0 05 e1 0d 1a ea 05 3a  0d 1a f4 10 dd f2 73 61  |.......:......sa|
00006020  76 65 73 71 75 61 72 65  0d 1a fe 28 e7 73 61 76  |vesquare...(.sav|
00006030  65 66 6f 72 6d 61 74 24  3d 22 6f 77 6e 22 20 f2  |eformat$="own" .|
00006040  73 61 76 65 6f 77 6e 28  66 69 6c 65 24 29 3a e1  |saveown(file$):.|
00006050  0d 1b 08 0d f2 63 6f 70  79 6f 76 65 72 0d 1b 12  |.....copyover...|
00006060  31 c8 94 20 64 69 6d 78  2c 77 73 71 78 3a c8 94  |1.. dimx,wsqx:..|
00006070  20 64 69 6d 79 2c 77 73  71 79 3a c8 94 20 77 6f  | dimy,wsqy:.. wo|
00006080  72 64 73 25 2c 77 73 71  77 6f 72 64 73 25 0d 1b  |rds%,wsqwords%..|
00006090  1c 2c e7 73 61 76 65 66  6f 72 6d 61 74 24 3d 22  |.,.saveformat$="|
000060a0  64 72 61 77 22 20 70 61  64 24 3d bd 31 36 30 20  |draw" pad$=.160 |
000060b0  8b 20 70 61 64 24 3d 22  20 22 0d 1b 26 3c 6c 65  |. pad$=" "..&<le|
000060c0  6e 25 3d a4 6c 6f 6e 67  3a 62 24 28 29 3d 22 22  |n%=.long:b$()=""|
000060d0  3a 64 75 6d 6d 79 25 3d  30 3a e7 64 62 6c 25 3d  |:dummy%=0:.dbl%=|
000060e0  2d 31 20 64 25 3d 64 69  6d 78 2a 32 20 8b 20 64  |-1 d%=dimx*2 . d|
000060f0  25 3d 64 69 6d 78 0d 1b  30 23 e3 49 25 3d 31 b8  |%=dimx..0#.I%=1.|
00006100  64 69 6d 79 3a e3 4a 25  3d 31 b8 64 69 6d 78 3a  |dimy:.J%=1.dimx:|
00006110  64 75 6d 6d 79 25 2b 3d  31 0d 1b 3a 3d 62 24 28  |dummy%+=1..:=b$(|
00006120  49 25 29 2b 3d bd 28 67  72 69 64 25 28 64 75 6d  |I%)+=.(grid%(dum|
00006130  6d 79 25 29 29 3a e7 64  62 6c 25 3d 2d 31 20 80  |my%)):.dbl%=-1 .|
00006140  20 4a 25 3c 3e 64 69 6d  78 20 62 24 28 49 25 29  | J%<>dimx b$(I%)|
00006150  2b 3d 70 61 64 24 0d 1b  44 07 ed 3a ed 0d 1b 4e  |+=pad$..D..:...N|
00006160  27 64 69 6d 78 2b 3d 2d  28 64 62 6c 25 2a 64 69  |'dimx+=-(dbl%*di|
00006170  6d 78 29 3a e7 64 62 6c  25 3d 2d 31 20 64 69 6d  |mx):.dbl%=-1 dim|
00006180  78 2d 3d 31 0d 1b 58 25  e7 66 6f 72 63 65 25 3d  |x-=1..X%.force%=|
00006190  30 20 80 20 77 6f 72 64  73 25 3c 3d 36 30 20 63  |0 . words%<=60 c|
000061a0  25 3d 31 3a e5 8d 74 4a  5b 0d 1b 62 2e e7 28 77  |%=1:..tJ[..b..(w|
000061b0  6f 72 64 73 25 3e 28 34  2a 64 69 6d 79 29 20 84  |ords%>(4*dimy) .|
000061c0  20 77 6f 72 64 73 25 3e  31 32 30 29 20 63 25 3d  | words%>120) c%=|
000061d0  34 3a e5 8d 74 4a 5b 0d  1b 6c 32 e7 73 61 76 65  |4:..tJ[..l2.save|
000061e0  66 6f 72 6d 61 74 24 3d  22 64 72 61 77 22 20 80  |format$="draw" .|
000061f0  20 64 69 6d 78 3c 28 6c  65 6e 25 2a 32 29 20 63  | dimx<(len%*2) c|
00006200  25 3d 31 3a e5 8d 74 4a  5b 0d 1b 76 2d e7 77 6f  |%=1:..tJ[..v-.wo|
00006210  72 64 73 25 3e 28 31 2e  33 2a 64 69 6d 79 29 20  |rds%>(1.3*dimy) |
00006220  84 20 77 6f 72 64 73 25  3e 36 30 20 63 25 3d 32  |. words%>60 c%=2|
00006230  3a e5 8d 74 4a 5b 0d 1b  80 08 63 25 3d 31 0d 1b  |:..tJ[....c%=1..|
00006240  8a 1c e7 73 61 76 65 66  6f 72 6d 61 74 24 3d 22  |...saveformat$="|
00006250  69 6d 70 22 20 f2 74 61  62 73 0d 1b 94 2d e7 73  |imp" .tabs...-.s|
00006260  61 76 65 66 6f 72 6d 61  74 24 3c 3e 22 70 72 69  |aveformat$<>"pri|
00006270  6e 74 22 20 66 69 6c 65  3d ae 66 69 6c 65 24 3a  |nt" file=.file$:|
00006280  f2 68 65 61 64 65 72 0d  1b 9e 38 e7 73 61 76 65  |.header...8.save|
00006290  66 6f 72 6d 61 74 24 3c  3e 22 70 72 69 6e 74 22  |format$<>"print"|
000062a0  20 d5 23 66 69 6c 65 2c  77 73 71 74 69 74 6c 65  | .#file,wsqtitle|
000062b0  24 3a 8b 20 f2 70 72 69  6e 74 74 69 74 6c 65 0d  |$:. .printtitle.|
000062c0  1b a8 0b c8 8e 20 63 25  20 ca 0d 1b b2 10 c9 20  |..... c% ...... |
000062d0  31 3a f2 66 6f 72 6d 61  74 31 0d 1b bc 10 c9 20  |1:.format1..... |
000062e0  32 3a f2 66 6f 72 6d 61  74 32 0d 1b c6 10 c9 20  |2:.format2..... |
000062f0  34 3a f2 66 6f 72 6d 61  74 33 0d 1b d0 05 cb 0d  |4:.format3......|
00006300  1b da 5b e7 64 62 6c 25  3d 2d 31 20 80 20 64 69  |..[.dbl%=-1 . di|
00006310  6d 78 2f 32 3d a8 28 64  69 6d 78 2f 32 29 20 64  |mx/2=.(dimx/2) d|
00006320  69 6d 78 3d 64 69 6d 78  2f 32 3a 8b 20 e7 64 62  |imx=dimx/2:. .db|
00006330  6c 25 3d 2d 31 20 80 20  64 69 6d 78 2f 32 3c 3e  |l%=-1 . dimx/2<>|
00006340  a8 28 64 69 6d 78 2f 32  29 20 64 69 6d 78 3d a8  |.(dimx/2) dimx=.|
00006350  28 64 69 6d 78 2f 32 29  2b 31 0d 1b e4 31 c8 94  |(dimx/2)+1...1..|
00006360  20 64 69 6d 78 2c 77 73  71 78 3a c8 94 20 64 69  | dimx,wsqx:.. di|
00006370  6d 79 2c 77 73 71 79 3a  c8 94 20 77 6f 72 64 73  |my,wsqy:.. words|
00006380  25 2c 77 73 71 77 6f 72  64 73 25 0d 1b ee 0d f2  |%,wsqwords%.....|
00006390  63 6f 70 79 62 61 63 6b  0d 1b f8 49 e7 73 61 76  |copyback...I.sav|
000063a0  65 66 6f 72 6d 61 74 24  3c 3e 22 70 72 69 6e 74  |eformat$<>"print|
000063b0  22 20 d5 23 66 69 6c 65  2c bd 31 30 3a d9 23 66  |" .#file,.10:.#f|
000063c0  69 6c 65 3a ff 22 53 45  54 54 59 50 45 20 22 2b  |ile:."SETTYPE "+|
000063d0  66 69 6c 65 24 2b 22 20  54 65 78 74 22 20 8b 20  |file$+" Text" . |
000063e0  f1 0d 1c 02 1e 67 72 69  64 73 61 76 65 64 25 3d  |.....gridsaved%=|
000063f0  31 3a 77 6f 72 64 73 73  61 76 65 64 25 3d 31 0d  |1:wordssaved%=1.|
00006400  1c 0c 05 e1 0d 1c 16 05  3a 0d 1c 20 0f dd f2 73  |........:.. ...s|
00006410  61 76 65 70 72 65 66 73  0d 1c 2a 0d f2 67 65 74  |aveprefs..*..get|
00006420  70 72 65 66 73 0d 1c 34  1e 66 69 6c 65 3d ae 22  |prefs..4.file=."|
00006430  3c 57 6f 72 64 53 71 24  44 69 72 3e 2e 50 72 65  |<WordSq$Dir>.Pre|
00006440  66 73 22 0d 1c 3e 2d d5  23 66 69 6c 65 2c c3 64  |fs"..>-.#file,.d|
00006450  62 6c 25 3a d5 23 66 69  6c 65 2c c3 66 6f 72 63  |bl%:.#file,.forc|
00006460  65 25 3a d5 23 66 69 6c  65 2c c3 63 61 70 73 25  |e%:.#file,.caps%|
00006470  0d 1c 48 1e d5 23 66 69  6c 65 2c c3 63 6f 6c 25  |..H..#file,.col%|
00006480  3a d5 23 66 69 6c 65 2c  c3 6d 63 6f 6c 25 0d 1c  |:.#file,.mcol%..|
00006490  52 1f d5 23 66 69 6c 65  2c c3 77 63 6f 6c 25 3a  |R..#file,.wcol%:|
000064a0  d5 23 66 69 6c 65 2c c3  6c 63 6f 6c 25 0d 1c 5c  |.#file,.lcol%..\|
000064b0  26 d5 23 66 69 6c 65 2c  74 69 74 6c 65 66 6f 6e  |&.#file,titlefon|
000064c0  74 24 3a d5 23 66 69 6c  65 2c c3 74 69 74 6c 65  |t$:.#file,.title|
000064d0  70 74 25 0d 1c 66 24 d5  23 66 69 6c 65 2c 67 72  |pt%..f$.#file,gr|
000064e0  69 64 66 6f 6e 74 24 3a  d5 23 66 69 6c 65 2c c3  |idfont$:.#file,.|
000064f0  67 72 69 64 70 74 25 0d  1c 70 26 d5 23 66 69 6c  |gridpt%..p&.#fil|
00006500  65 2c 77 6f 72 64 73 66  6f 6e 74 24 3a d5 23 66  |e,wordsfont$:.#f|
00006510  69 6c 65 2c c3 77 6f 72  64 73 70 74 25 0d 1c 7a  |ile,.wordspt%..z|
00006520  1c d5 23 66 69 6c 65 2c  70 72 65 24 3a d5 23 66  |..#file,pre$:.#f|
00006530  69 6c 65 2c 70 6f 73 74  24 0d 1c 84 22 d5 23 66  |ile,post$...".#f|
00006540  69 6c 65 2c 6f 76 65 72  6f 6e 24 3a d5 23 66 69  |ile,overon$:.#fi|
00006550  6c 65 2c 6f 76 65 72 6f  66 66 24 0d 1c 8e 24 d5  |le,overoff$...$.|
00006560  23 66 69 6c 65 2c 75 6e  64 65 72 6f 6e 24 3a d5  |#file,underon$:.|
00006570  23 66 69 6c 65 2c 75 6e  64 65 72 6f 66 66 24 0d  |#file,underoff$.|
00006580  1c 98 22 d5 23 66 69 6c  65 2c 65 6d 70 68 6f 6e  |..".#file,emphon|
00006590  24 3a d5 23 66 69 6c 65  2c 65 6d 70 68 6f 66 66  |$:.#file,emphoff|
000065a0  24 0d 1c a2 0a d9 23 66  69 6c 65 0d 1c ac 05 e1  |$.....#file.....|
000065b0  0d 1c b6 05 3a 0d 1c c0  14 dd f2 53 65 74 49 63  |....:......SetIc|
000065c0  6f 6e 28 77 25 2c 69 25  29 0d 1c ca 34 77 69 6d  |on(w%,i%)...4wim|
000065d0  70 25 21 30 3d 77 25 3a  77 69 6d 70 25 21 34 3d  |p%!0=w%:wimp%!4=|
000065e0  69 25 3a 77 69 6d 70 25  21 38 3d 26 32 30 30 30  |i%:wimp%!8=&2000|
000065f0  30 30 3a 77 69 6d 70 25  21 31 32 3d 30 0d 1c d4  |00:wimp%!12=0...|
00006600  21 c8 99 20 22 57 69 6d  70 5f 53 65 74 49 63 6f  |!.. "Wimp_SetIco|
00006610  6e 53 74 61 74 65 22 2c  2c 77 69 6d 70 25 0d 1c  |nState",,wimp%..|
00006620  de 05 e1 0d 1c e8 05 3a  0d 1c f2 10 dd f2 72 65  |.......:......re|
00006630  63 28 74 79 70 65 25 29  0d 1c fc 1d e7 77 6f 72  |c(type%).....wor|
00006640  64 73 25 3c 31 20 64 69  6d 78 3d 30 3a 64 69 6d  |ds%<1 dimx=0:dim|
00006650  79 3d 30 3a e1 0d 1d 06  14 e7 74 79 70 65 25 3d  |y=0:......type%=|
00006660  32 20 67 61 70 73 3d 32  35 0d 1d 10 13 6e 65 65  |2 gaps=25....nee|
00006670  64 73 25 3d c6 8e 6c 65  6e 25 28 29 0d 1d 1a 49  |ds%=..len%()...I|
00006680  61 3d 28 31 2f 28 31 2d  28 67 61 70 73 2f 31 30  |a=(1/(1-(gaps/10|
00006690  30 29 29 29 2a 6e 65 65  64 73 25 3a 64 69 6d 79  |0)))*needs%:dimy|
000066a0  3d a4 72 6f 75 6e 64 28  b6 28 61 2f 31 2e 32 29  |=.round(.(a/1.2)|
000066b0  29 3a 64 69 6d 78 3d a4  72 6f 75 6e 64 28 61 2f  |):dimx=.round(a/|
000066c0  64 69 6d 79 29 0d 1d 24  37 e7 20 77 6f 72 64 73  |dimy)..$7. words|
000066d0  25 3c 3d 31 32 30 20 6d  61 78 68 3d 36 30 20 8b  |%<=120 maxh=60 .|
000066e0  20 6d 61 78 68 3d a8 28  35 39 2d 28 28 77 6f 72  | maxh=.(59-((wor|
000066f0  64 73 25 2d 31 32 30 29  2f 32 29 29 0d 1d 2e 0e  |ds%-120)/2))....|
00006700  6c 65 6e 25 3d a4 6c 6f  6e 67 0d 1d 38 16 e7 6c  |len%=.long..8..l|
00006710  65 6e 25 3e a4 6d 61 78  20 f2 64 72 65 63 3a e1  |en%>.max .drec:.|
00006720  0d 1d 42 38 e7 64 69 6d  79 3c 33 20 64 69 6d 79  |..B8.dimy<3 dimy|
00006730  3d 33 20 8b 20 e7 20 64  69 6d 78 3e 34 30 20 64  |=3 . . dimx>40 d|
00006740  69 6d 78 3d 34 30 3a 64  69 6d 79 3d a4 72 6f 75  |imx=40:dimy=.rou|
00006750  6e 64 28 61 2f 34 30 29  0d 1d 4c 18 e7 6d 61 78  |nd(a/40)..L..max|
00006760  68 3c 64 69 6d 79 20 64  69 6d 79 3d 6d 61 78 68  |h<dimy dimy=maxh|
00006770  0d 1d 56 b2 e7 a4 67 61  70 73 3c 31 30 20 84 20  |..V...gaps<10 . |
00006780  28 64 69 6d 78 3c 6c 65  6e 25 20 80 20 64 69 6d  |(dimx<len% . dim|
00006790  79 3c 6c 65 6e 25 29 20  f2 41 6c 65 72 74 28 22  |y<len%) .Alert("|
000067a0  57 6f 72 64 53 71 22 2c  22 41 6c 6c 20 6f 66 20  |WordSq","All of |
000067b0  74 68 65 73 65 20 77 6f  72 64 73 20 77 69 6c 6c  |these words will|
000067c0  20 6e 6f 74 20 66 69 74  20 69 6e 74 6f 20 74 68  | not fit into th|
000067d0  65 20 6c 61 72 67 65 73  74 20 73 69 7a 65 20 67  |e largest size g|
000067e0  72 69 64 20 2d 20 79 6f  75 20 6d 75 73 74 20 64  |rid - you must d|
000067f0  65 6c 65 74 65 20 61 20  66 65 77 2c 20 6f 72 20  |elete a few, or |
00006800  73 68 6f 72 74 65 6e 20  73 6f 6d 65 20 6f 66 20  |shorten some of |
00006810  74 68 65 20 6c 6f 6e 67  65 72 20 6f 6e 65 73 2e  |the longer ones.|
00006820  22 29 0d 1d 60 17 e7 74  79 70 65 25 3d 32 20 67  |")..`..type%=2 g|
00006830  61 70 73 3d a4 67 61 70  73 0d 1d 6a 12 e7 67 61  |aps=.gaps..j..ga|
00006840  70 73 3c 30 20 67 61 70  73 3d 30 0d 1d 74 27 f2  |ps<0 gaps=0..t'.|
00006850  49 63 6f 6e 50 75 74 54  65 78 74 28 6d 61 69 6e  |IconPutText(main|
00006860  5f 57 69 6e 64 6f 77 25  2c 32 30 2c c3 67 61 70  |_Window%,20,.gap|
00006870  73 29 0d 1d 7e 05 e1 0d  1d 88 05 3a 0d 1d 92 0a  |s)..~......:....|
00006880  dd f2 64 72 65 63 0d 1d  9c 41 49 25 3d 30 3a f5  |..drec...AI%=0:.|
00006890  3a 49 25 2b 3d 31 3a fd  49 25 2a 6c 65 6e 25 3e  |:I%+=1:.I%*len%>|
000068a0  61 2a 30 2e 39 35 3a 64  69 6d 78 3d 6c 65 6e 25  |a*0.95:dimx=len%|
000068b0  3a 64 69 6d 79 3d 49 25  3a e7 64 69 6d 79 3c 33  |:dimy=I%:.dimy<3|
000068c0  20 64 69 6d 79 3d 33 0d  1d a6 3b e7 74 79 70 65  | dimy=3...;.type|
000068d0  25 3d 32 20 67 61 70 73  3d a4 67 61 70 73 3a f2  |%=2 gaps=.gaps:.|
000068e0  49 63 6f 6e 50 75 74 54  65 78 74 28 6d 61 69 6e  |IconPutText(main|
000068f0  5f 57 69 6e 64 6f 77 25  2c 32 30 2c c3 67 61 70  |_Window%,20,.gap|
00006900  73 29 0d 1d b0 05 e1 0d  1d ba 05 3a 0d 1d c4 11  |s).........:....|
00006910  dd a4 6c 65 6e 28 64 75  6d 6d 79 24 29 0d 1d ce  |..len(dummy$)...|
00006920  54 4a 25 3d a9 64 75 6d  6d 79 24 3a e3 49 25 3d  |TJ%=.dummy$:.I%=|
00006930  31 b8 a9 64 75 6d 6d 79  24 3a 43 3d 97 28 c1 64  |1..dummy$:C=.(.d|
00006940  75 6d 6d 79 24 2c 49 25  2c 31 29 29 3a e7 20 43  |ummy$,I%,1)):. C|
00006950  3c 36 35 20 84 20 43 3e  31 32 32 20 84 20 28 43  |<65 . C>122 . (C|
00006960  3e 39 30 20 80 20 43 3c  39 37 29 20 4a 25 2d 3d  |>90 . C<97) J%-=|
00006970  31 0d 1d d8 09 ed 3a 3d  4a 25 0d 1d e2 05 3a 0d  |1.....:=J%....:.|
00006980  1d ec 0a dd a4 6c 6f 6e  67 0d 1d f6 2f 44 3d 30  |.....long.../D=0|
00006990  3a e3 49 25 3d 31 b8 77  6f 72 64 73 25 3a e7 a9  |:.I%=1.words%:..|
000069a0  77 6f 72 64 24 28 49 25  29 3e 44 20 44 3d a9 77  |word$(I%)>D D=.w|
000069b0  6f 72 64 24 28 49 25 29  0d 1e 00 08 ed 3a 3d 44  |ord$(I%).....:=D|
000069c0  0d 1e 0a 05 3a 0d 1e 14  09 dd a4 6d 61 78 0d 1e  |....:......max..|
000069d0  1e 1c e7 64 69 6d 78 3e  64 69 6d 79 20 3d 64 69  |...dimx>dimy =di|
000069e0  6d 78 20 8b 20 3d 64 69  6d 79 0d 1e 28 05 3a 0d  |mx . =dimy..(.:.|
000069f0  1e 32 1b dd a4 72 6f 75  6e 64 28 6e 75 6d 29 3d  |.2...round(num)=|
00006a00  a8 28 6e 75 6d 2b 30 2e  35 29 0d 1e 3c 05 3a 0d  |.(num+0.5)..<.:.|
00006a10  1e 46 0d dd f2 61 64 64  77 6f 72 64 0d 1e 50 7c  |.F...addword..P||
00006a20  77 24 3d a4 49 63 6f 6e  54 65 78 74 28 6d 61 69  |w$=.IconText(mai|
00006a30  6e 5f 57 69 6e 64 6f 77  25 2c 32 36 29 3a e7 a4  |n_Window%,26):..|
00006a40  6c 65 6e 28 77 24 29 3c  33 20 f2 41 6c 65 72 74  |len(w$)<3 .Alert|
00006a50  28 22 57 6f 72 64 53 71  22 2c 22 57 6f 72 64 73  |("WordSq","Words|
00006a60  20 6d 75 73 74 20 62 65  20 74 68 72 65 65 20 61  | must be three a|
00006a70  6c 70 68 61 62 65 74 69  63 61 6c 20 63 68 61 72  |lphabetical char|
00006a80  61 63 74 65 72 73 20 6c  6f 6e 67 20 6f 72 20 6d  |acters long or m|
00006a90  6f 72 65 2e 22 29 3a e1  0d 1e 5a 14 c8 99 22 48  |ore."):...Z..."H|
00006aa0  6f 75 72 67 6c 61 73 73  5f 4f 6e 22 0d 1e 64 93  |ourglass_On"..d.|
00006ab0  e7 77 6f 72 64 73 25 3d  30 20 f2 4d 65 6e 75 45  |.words%=0 .MenuE|
00006ac0  6e 61 62 6c 65 28 6d 61  69 6e 5f 4d 65 6e 75 25  |nable(main_Menu%|
00006ad0  2c 32 29 3a f2 4d 65 6e  75 45 6e 61 62 6c 65 28  |,2):.MenuEnable(|
00006ae0  6d 61 69 6e 5f 4d 65 6e  75 25 2c 33 29 3a f2 4d  |main_Menu%,3):.M|
00006af0  65 6e 75 45 6e 61 62 6c  65 28 6d 61 69 6e 5f 4d  |enuEnable(main_M|
00006b00  65 6e 75 25 2c 35 29 3a  f2 4d 65 6e 75 45 6e 61  |enu%,5):.MenuEna|
00006b10  62 6c 65 28 73 6f 6c 76  65 5f 4d 65 6e 75 25 2c  |ble(solve_Menu%,|
00006b20  32 29 3a f2 4d 65 6e 75  45 6e 61 62 6c 65 28 64  |2):.MenuEnable(d|
00006b30  69 73 70 6c 61 79 5f 4d  65 6e 75 25 2c 32 29 0d  |isplay_Menu%,2).|
00006b40  1e 6e 1e 77 6f 72 64 73  25 2b 3d 31 3a 77 6f 72  |.n.words%+=1:wor|
00006b50  64 24 28 77 6f 72 64 73  25 29 3d 77 24 0d 1e 78  |d$(words%)=w$..x|
00006b60  0d f2 63 6c 65 61 72 61  6c 6c 0d 1e 82 3f f2 75  |..clearall...?.u|
00006b70  70 64 61 74 65 73 6f 6c  76 65 73 74 61 74 65 3a  |pdatesolvestate:|
00006b80  e7 63 61 70 73 25 20 77  6f 72 64 24 28 77 6f 72  |.caps% word$(wor|
00006b90  64 73 25 29 3d a4 63 61  70 73 28 77 6f 72 64 24  |ds%)=.caps(word$|
00006ba0  28 77 6f 72 64 73 25 29  29 0d 1e 8c 24 6c 65 6e  |(words%))...$len|
00006bb0  25 28 77 6f 72 64 73 25  29 3d a4 6c 65 6e 28 77  |%(words%)=.len(w|
00006bc0  6f 72 64 24 28 77 6f 72  64 73 25 29 29 0d 1e 96  |ord$(words%))...|
00006bd0  0c f2 73 6f 72 74 28 31  29 0d 1e a0 3d e3 49 25  |..sort(1)...=.I%|
00006be0  3d 31 b8 77 6f 72 64 73  25 3a f2 49 63 6f 6e 50  |=1.words%:.IconP|
00006bf0  75 74 54 65 78 74 28 77  6f 72 64 73 5f 57 69 6e  |utText(words_Win|
00006c00  64 6f 77 25 2c 49 25 2b  33 2c 77 6f 72 64 24 28  |dow%,I%+3,word$(|
00006c10  49 25 29 29 3a ed 0d 1e  aa 07 f2 77 77 0d 1e b4  |I%)):......ww...|
00006c20  53 f2 72 65 63 28 32 29  3a f2 49 63 6f 6e 50 75  |S.rec(2):.IconPu|
00006c30  74 54 65 78 74 28 6d 61  69 6e 5f 57 69 6e 64 6f  |tText(main_Windo|
00006c40  77 25 2c 31 32 2c c3 64  69 6d 78 29 3a f2 49 63  |w%,12,.dimx):.Ic|
00006c50  6f 6e 50 75 74 54 65 78  74 28 6d 61 69 6e 5f 57  |onPutText(main_W|
00006c60  69 6e 64 6f 77 25 2c 31  36 2c c3 64 69 6d 79 29  |indow%,16,.dimy)|
00006c70  0d 1e be aa e7 77 6f 72  64 73 25 3d 31 20 f2 4d  |.....words%=1 .M|
00006c80  65 6e 75 45 6e 61 62 6c  65 28 77 6f 72 64 73 5f  |enuEnable(words_|
00006c90  4d 65 6e 75 25 2c 32 29  3a e7 77 6f 72 64 73 77  |Menu%,2):.wordsw|
00006ca0  69 6e 64 25 3d 30 20 77  6f 72 64 73 77 69 6e 64  |ind%=0 wordswind|
00006cb0  25 3d 31 3a f2 42 72 69  6e 67 54 6f 54 6f 70 28  |%=1:.BringToTop(|
00006cc0  77 6f 72 64 73 5f 57 69  6e 64 6f 77 25 29 3a f2  |words_Window%):.|
00006cd0  4d 65 6e 75 54 69 63 6b  28 73 6f 6c 76 65 5f 4d  |MenuTick(solve_M|
00006ce0  65 6e 75 25 2c 32 29 3a  f2 4d 65 6e 75 54 69 63  |enu%,2):.MenuTic|
00006cf0  6b 28 6d 61 69 6e 5f 4d  65 6e 75 25 2c 32 29 3a  |k(main_Menu%,2):|
00006d00  f2 4d 65 6e 75 54 69 63  6b 28 64 69 73 70 6c 61  |.MenuTick(displa|
00006d10  79 5f 4d 65 6e 75 25 2c  32 29 0d 1e c8 50 f2 49  |y_Menu%,2)...P.I|
00006d20  63 6f 6e 50 75 74 54 65  78 74 28 6d 61 69 6e 5f  |conPutText(main_|
00006d30  57 69 6e 64 6f 77 25 2c  32 36 2c 22 22 29 3a f2  |Window%,26,""):.|
00006d40  49 63 6f 6e 50 75 74 54  65 78 74 28 73 6f 6c 76  |IconPutText(solv|
00006d50  65 5f 57 69 6e 64 6f 77  25 2c 31 37 2c 22 22 29  |e_Window%,17,"")|
00006d60  3a f2 63 61 72 65 74 28  30 29 0d 1e d2 11 77 6f  |:.caret(0)....wo|
00006d70  72 64 73 73 61 76 65 64  25 3d 30 0d 1e dc 15 c8  |rdssaved%=0.....|
00006d80  99 22 48 6f 75 72 67 6c  61 73 73 5f 4f 66 66 22  |."Hourglass_Off"|
00006d90  0d 1e e6 05 e1 0d 1e f0  05 3a 0d 1e fa 10 dd f2  |.........:......|
00006da0  64 65 6c 65 74 65 77 6f  72 64 0d 1f 04 13 e7 73  |deleteword.....s|
00006db0  65 6c 65 63 74 69 6f 6e  25 3d 30 20 e1 0d 1f 0e  |election%=0 ....|
00006dc0  1e e7 73 6f 6c 76 65 66  6f 72 6d 61 74 24 3c 3e  |..solveformat$<>|
00006dd0  22 6f 77 6e 22 20 e5 8d  44 54 5f 0d 1f 18 60 6f  |"own" ..DT_...`o|
00006de0  25 3d 2d 31 3a 6e 75 6d  62 65 72 25 3d 30 3a e3  |%=-1:number%=0:.|
00006df0  49 25 3d 31 b8 77 6f 72  64 73 25 3a e7 73 65 6c  |I%=1.words%:.sel|
00006e00  65 63 74 65 64 25 28 49  25 29 3d 31 20 80 20 73  |ected%(I%)=1 . s|
00006e10  74 61 72 74 25 28 49 25  29 3c 3e 30 20 80 20 64  |tart%(I%)<>0 . d|
00006e20  69 72 25 28 49 25 29 3c  3e 30 20 6e 75 6d 62 65  |ir%(I%)<>0 numbe|
00006e30  72 25 2b 3d 31 3a ed 3a  8b 20 ed 0d 1f 22 10 e7  |r%+=1:.:. ..."..|
00006e40  6e 75 6d 62 65 72 25 3e  30 20 8c 0d 1f 2c 5e e7  |number%>0 ...,^.|
00006e50  73 65 6c 65 63 74 69 6f  6e 25 3d 31 20 64 24 3d  |selection%=1 d$=|
00006e60  22 54 68 69 73 20 77 6f  72 64 20 66 6f 72 6d 73  |"This word forms|
00006e70  20 22 20 8b 20 64 24 3d  a4 6f 6e 65 6f 72 6d 6f  | " . d$=.oneormo|
00006e80  72 65 28 6e 75 6d 62 65  72 25 29 2b 22 61 6d 6f  |re(number%)+"amo|
00006e90  6e 67 73 74 20 74 68 65  20 73 65 6c 65 63 74 69  |ngst the selecti|
00006ea0  6f 6e 20 66 6f 72 6d 20  22 0d 1f 36 9f 6f 25 3d  |on form "..6.o%=|
00006eb0  a4 57 69 6e 64 6f 77 43  61 6e 63 65 6c 28 22 57  |.WindowCancel("W|
00006ec0  6f 72 64 53 71 22 2c 64  24 2b 22 70 61 72 74 20  |ordSq",d$+"part |
00006ed0  6f 66 20 74 68 65 20 63  75 72 72 65 6e 74 20 77  |of the current w|
00006ee0  6f 72 64 73 71 75 61 72  65 2e 20 43 6f 6e 74 69  |ordsquare. Conti|
00006ef0  6e 75 69 6e 67 20 77 69  74 68 20 74 68 69 73 20  |nuing with this |
00006f00  6f 70 65 72 61 74 69 6f  6e 20 77 69 6c 6c 20 63  |operation will c|
00006f10  61 75 73 65 20 74 68 65  20 77 6f 72 64 73 71 75  |ause the wordsqu|
00006f20  61 72 65 20 74 6f 20 62  65 20 64 65 6c 65 74 65  |are to be delete|
00006f30  64 2e 20 43 6c 69 63 6b  20 4f 4b 20 74 6f 20 64  |d. Click OK to d|
00006f40  65 6c 65 74 65 2e 22 29  0d 1f 40 05 cd 0d 1f 4a  |elete.")..@....J|
00006f50  42 e7 6f 25 3d 30 20 e1  20 8b 20 e7 6f 25 3d 2d  |B.o%=0 . . .o%=-|
00006f60  31 20 80 20 6e 75 6d 62  65 72 25 3e 30 20 f2 57  |1 . number%>0 .W|
00006f70  69 6e 64 6f 77 43 6c 6f  73 65 28 64 69 73 70 6c  |indowClose(displ|
00006f80  61 79 5f 57 69 6e 64 6f  77 25 29 3a f2 6e 67 0d  |ay_Window%):.ng.|
00006f90  1f 54 14 c8 99 22 48 6f  75 72 67 6c 61 73 73 5f  |.T..."Hourglass_|
00006fa0  4f 6e 22 0d 1f 5e 94 6e  75 6d 62 65 72 25 3d 30  |On"..^.number%=0|
00006fb0  3a e3 49 25 3d 31 b8 77  6f 72 64 73 25 3a e7 73  |:.I%=1.words%:.s|
00006fc0  65 6c 65 63 74 65 64 25  28 49 25 29 3d 31 20 77  |elected%(I%)=1 w|
00006fd0  6f 72 64 24 28 49 25 29  3d 22 7e 7e 22 3a 6e 75  |ord$(I%)="~~":nu|
00006fe0  6d 62 65 72 25 2b 3d 31  3a f2 53 65 74 49 63 6f  |mber%+=1:.SetIco|
00006ff0  6e 28 77 6f 72 64 73 5f  57 69 6e 64 6f 77 25 2c  |n(words_Window%,|
00007000  49 25 2b 33 29 3a 73 65  6c 65 63 74 65 64 25 28  |I%+3):selected%(|
00007010  49 25 29 3d 30 3a e7 73  68 6f 77 25 28 49 25 29  |I%)=0:.show%(I%)|
00007020  3e 30 20 73 68 6f 77 25  28 49 25 29 3d 30 3a 68  |>0 show%(I%)=0:h|
00007030  69 67 68 25 2d 3d 31 0d  1f 68 1d ed 3a 73 65 6c  |igh%-=1..h..:sel|
00007040  65 63 74 69 6f 6e 25 3d  30 3a f2 73 65 74 62 75  |ection%=0:.setbu|
00007050  74 74 6f 6e 0d 1f 72 14  f2 73 6f 72 74 28 31 29  |tton..r..sort(1)|
00007060  3a f2 72 65 70 28 30 29  0d 1f 7c 3d e3 49 25 3d  |:.rep(0)..|=.I%=|
00007070  31 b8 77 6f 72 64 73 25  3a f2 49 63 6f 6e 50 75  |1.words%:.IconPu|
00007080  74 54 65 78 74 28 77 6f  72 64 73 5f 57 69 6e 64  |tText(words_Wind|
00007090  6f 77 25 2c 49 25 2b 33  2c 77 6f 72 64 24 28 49  |ow%,I%+3,word$(I|
000070a0  25 29 29 3a ed 0d 1f 86  3b 77 6f 72 64 73 25 2d  |%)):....;words%-|
000070b0  3d 6e 75 6d 62 65 72 25  3a e7 73 6f 6c 76 65 66  |=number%:.solvef|
000070c0  6f 72 6d 61 74 24 3d 22  74 65 78 74 22 20 77 73  |ormat$="text" ws|
000070d0  71 77 6f 72 64 73 25 2d  3d 6e 75 6d 62 65 72 25  |qwords%-=number%|
000070e0  0d 1f 90 25 f2 75 70 64  61 74 65 73 6f 6c 76 65  |...%.updatesolve|
000070f0  73 74 61 74 65 3a 6e 65  65 64 73 25 3d c6 8e 6c  |state:needs%=..l|
00007100  65 6e 25 28 29 0d 1f 9a  0f e7 77 6f 72 64 73 25  |en%().....words%|
00007110  3d 30 20 8c 0d 1f a4 aa  f2 4d 65 6e 75 44 69 73  |=0 ......MenuDis|
00007120  61 62 6c 65 28 6d 61 69  6e 5f 4d 65 6e 75 25 2c  |able(main_Menu%,|
00007130  33 29 3a f2 4d 65 6e 75  44 69 73 61 62 6c 65 28  |3):.MenuDisable(|
00007140  6d 61 69 6e 5f 4d 65 6e  75 25 2c 32 29 3a f2 4d  |main_Menu%,2):.M|
00007150  65 6e 75 44 69 73 61 62  6c 65 28 73 6f 6c 76 65  |enuDisable(solve|
00007160  5f 4d 65 6e 75 25 2c 32  29 3a f2 4d 65 6e 75 44  |_Menu%,2):.MenuD|
00007170  69 73 61 62 6c 65 28 6d  61 69 6e 5f 4d 65 6e 75  |isable(main_Menu|
00007180  25 2c 35 29 3a f2 4d 65  6e 75 44 69 73 61 62 6c  |%,5):.MenuDisabl|
00007190  65 28 64 69 73 70 6c 61  79 5f 4d 65 6e 75 25 2c  |e(display_Menu%,|
000071a0  32 29 3a f2 57 69 6e 64  6f 77 43 6c 6f 73 65 28  |2):.WindowClose(|
000071b0  77 6f 72 64 73 5f 57 69  6e 64 6f 77 25 29 0d 1f  |words_Window%)..|
000071c0  ae 4f f2 4d 65 6e 75 54  69 63 6b 28 6d 61 69 6e  |.O.MenuTick(main|
000071d0  5f 4d 65 6e 75 25 2c 32  29 3a f2 4d 65 6e 75 54  |_Menu%,2):.MenuT|
000071e0  69 63 6b 28 73 6f 6c 76  65 5f 4d 65 6e 75 25 2c  |ick(solve_Menu%,|
000071f0  32 29 3a f2 4d 65 6e 75  54 69 63 6b 28 64 69 73  |2):.MenuTick(dis|
00007200  70 6c 61 79 5f 4d 65 6e  75 25 2c 32 29 0d 1f b8  |play_Menu%,2)...|
00007210  1e 77 6f 72 64 73 77 69  6e 64 25 3d 30 3a 77 6f  |.wordswind%=0:wo|
00007220  72 64 73 73 61 76 65 64  25 3d 31 0d 1f c2 05 cd  |rdssaved%=1.....|
00007230  0d 1f cc 1b e7 77 6f 72  64 73 25 3e 30 20 77 6f  |.....words%>0 wo|
00007240  72 64 73 73 61 76 65 64  25 3d 30 0d 1f d6 50 f2  |rdssaved%=0...P.|
00007250  49 63 6f 6e 50 75 74 54  65 78 74 28 6d 61 69 6e  |IconPutText(main|
00007260  5f 57 69 6e 64 6f 77 25  2c 32 36 2c 22 22 29 3a  |_Window%,26,""):|
00007270  f2 49 63 6f 6e 50 75 74  54 65 78 74 28 73 6f 6c  |.IconPutText(sol|
00007280  76 65 5f 57 69 6e 64 6f  77 25 2c 31 37 2c 22 22  |ve_Window%,17,""|
00007290  29 3a f2 63 61 72 65 74  28 30 29 0d 1f e0 36 f2  |):.caret(0)...6.|
000072a0  77 77 3a e7 64 69 73 70  77 69 6e 64 25 3d 31 20  |ww:.dispwind%=1 |
000072b0  f2 57 69 6e 64 6f 77 46  6f 72 63 65 44 72 61 77  |.WindowForceDraw|
000072c0  28 64 69 73 70 6c 61 79  5f 57 69 6e 64 6f 77 25  |(display_Window%|
000072d0  29 0d 1f ea 5b e7 73 6f  6c 76 65 66 6f 72 6d 61  |)...[.solveforma|
000072e0  74 24 3d 22 74 65 78 74  22 20 67 61 70 73 3d a4  |t$="text" gaps=.|
000072f0  67 61 70 73 3a f2 49 63  6f 6e 50 75 74 54 65 78  |gaps:.IconPutTex|
00007300  74 28 6d 61 69 6e 5f 57  69 6e 64 6f 77 25 2c 32  |t(main_Window%,2|
00007310  30 2c c3 67 61 70 73 29  3a c8 99 22 48 6f 75 72  |0,.gaps):.."Hour|
00007320  67 6c 61 73 73 5f 4f 66  66 22 3a e1 0d 1f f4 2f  |glass_Off":..../|
00007330  67 61 70 73 3d 32 35 3a  f2 49 63 6f 6e 50 75 74  |gaps=25:.IconPut|
00007340  54 65 78 74 28 6d 61 69  6e 5f 57 69 6e 64 6f 77  |Text(main_Window|
00007350  25 2c 32 30 2c c3 67 61  70 73 29 0d 1f fe 53 f2  |%,20,.gaps)...S.|
00007360  72 65 63 28 32 29 3a f2  49 63 6f 6e 50 75 74 54  |rec(2):.IconPutT|
00007370  65 78 74 28 6d 61 69 6e  5f 57 69 6e 64 6f 77 25  |ext(main_Window%|
00007380  2c 31 32 2c c3 64 69 6d  78 29 3a f2 49 63 6f 6e  |,12,.dimx):.Icon|
00007390  50 75 74 54 65 78 74 28  6d 61 69 6e 5f 57 69 6e  |PutText(main_Win|
000073a0  64 6f 77 25 2c 31 36 2c  c3 64 69 6d 79 29 0d 20  |dow%,16,.dimy). |
000073b0  08 15 c8 99 22 48 6f 75  72 67 6c 61 73 73 5f 4f  |...."Hourglass_O|
000073c0  66 66 22 0d 20 12 05 e1  0d 20 1c 05 3a 0d 20 26  |ff". .... ..:. &|
000073d0  0f dd f2 61 6d 65 6e 64  77 6f 72 64 0d 20 30 14  |...amendword. 0.|
000073e0  e7 73 65 6c 65 63 74 69  6f 6e 25 3c 3e 31 20 e1  |.selection%<>1 .|
000073f0  0d 20 3a 7c 77 24 3d a4  49 63 6f 6e 54 65 78 74  |. :|w$=.IconText|
00007400  28 6d 61 69 6e 5f 57 69  6e 64 6f 77 25 2c 32 36  |(main_Window%,26|
00007410  29 3a e7 a4 6c 65 6e 28  77 24 29 3c 33 20 f2 41  |):..len(w$)<3 .A|
00007420  6c 65 72 74 28 22 57 6f  72 64 53 71 22 2c 22 57  |lert("WordSq","W|
00007430  6f 72 64 73 20 6d 75 73  74 20 62 65 20 74 68 72  |ords must be thr|
00007440  65 65 20 61 6c 70 68 61  62 65 74 69 63 61 6c 20  |ee alphabetical |
00007450  63 68 61 72 61 63 74 65  72 73 20 6c 6f 6e 67 20  |characters long |
00007460  6f 72 20 6d 6f 72 65 2e  22 29 3a e1 0d 20 44 1a  |or more."):.. D.|
00007470  e7 73 6f 6c 76 65 66 6f  72 6d 61 74 24 3d 22 22  |.solveformat$=""|
00007480  20 e5 8d 74 4a 60 0d 20  4e 60 6f 25 3d 2d 31 3a  | ..tJ`. N`o%=-1:|
00007490  6e 75 6d 62 65 72 25 3d  30 3a e3 49 25 3d 31 b8  |number%=0:.I%=1.|
000074a0  77 6f 72 64 73 25 3a e7  73 65 6c 65 63 74 65 64  |words%:.selected|
000074b0  25 28 49 25 29 3d 31 20  80 20 73 74 61 72 74 25  |%(I%)=1 . start%|
000074c0  28 49 25 29 3c 3e 30 20  80 20 64 69 72 25 28 49  |(I%)<>0 . dir%(I|
000074d0  25 29 3c 3e 30 20 6e 75  6d 62 65 72 25 2b 3d 31  |%)<>0 number%+=1|
000074e0  3a ed 3a 8b 20 ed 0d 20  58 10 e7 6e 75 6d 62 65  |:.:. .. X..numbe|
000074f0  72 25 3e 30 20 8c 0d 20  62 5e e7 73 65 6c 65 63  |r%>0 .. b^.selec|
00007500  74 69 6f 6e 25 3d 31 20  64 24 3d 22 54 68 69 73  |tion%=1 d$="This|
00007510  20 77 6f 72 64 20 66 6f  72 6d 73 20 22 20 8b 20  | word forms " . |
00007520  64 24 3d a4 6f 6e 65 6f  72 6d 6f 72 65 28 6e 75  |d$=.oneormore(nu|
00007530  6d 62 65 72 25 29 2b 22  61 6d 6f 6e 67 73 74 20  |mber%)+"amongst |
00007540  74 68 65 20 73 65 6c 65  63 74 69 6f 6e 20 66 6f  |the selection fo|
00007550  72 6d 20 22 0d 20 6c 9e  6f 25 3d a4 57 69 6e 64  |rm ". l.o%=.Wind|
00007560  6f 77 43 61 6e 63 65 6c  28 22 57 6f 72 64 53 71  |owCancel("WordSq|
00007570  22 2c 64 24 2b 22 70 61  72 74 20 6f 66 20 74 68  |",d$+"part of th|
00007580  65 20 63 75 72 72 65 6e  74 20 77 6f 72 64 73 71  |e current wordsq|
00007590  75 61 72 65 2e 20 43 6f  6e 74 69 6e 75 69 6e 67  |uare. Continuing|
000075a0  20 77 69 74 68 20 74 68  69 73 20 6f 70 65 72 61  | with this opera|
000075b0  74 69 6f 6e 20 77 69 6c  6c 20 63 61 75 73 65 20  |tion will cause |
000075c0  74 68 65 20 77 6f 72 64  73 71 75 61 72 65 20 74  |the wordsquare t|
000075d0  6f 20 62 65 20 64 65 6c  65 74 65 64 2e 20 43 6c  |o be deleted. Cl|
000075e0  69 63 6b 20 4f 4b 20 74  6f 20 61 6d 65 6e 64 2e  |ick OK to amend.|
000075f0  22 29 0d 20 76 05 cd 0d  20 80 42 e7 6f 25 3d 30  |"). v... .B.o%=0|
00007600  20 e1 20 8b 20 e7 6f 25  3d 2d 31 20 80 20 6e 75  | . . .o%=-1 . nu|
00007610  6d 62 65 72 25 3e 30 20  f2 57 69 6e 64 6f 77 43  |mber%>0 .WindowC|
00007620  6c 6f 73 65 28 64 69 73  70 6c 61 79 5f 57 69 6e  |lose(display_Win|
00007630  64 6f 77 25 29 3a f2 6e  67 0d 20 8a 14 c8 99 22  |dow%):.ng. ...."|
00007640  48 6f 75 72 67 6c 61 73  73 5f 4f 6e 22 0d 20 94  |Hourglass_On". .|
00007650  2b e3 49 25 3d 31 b8 77  6f 72 64 73 25 3a e7 73  |+.I%=1.words%:.s|
00007660  65 6c 65 63 74 65 64 25  28 49 25 29 3d 31 20 64  |elected%(I%)=1 d|
00007670  75 6d 6d 79 25 3d 49 25  0d 20 9e 4f ed 3a 77 6f  |ummy%=I%. .O.:wo|
00007680  72 64 24 28 64 75 6d 6d  79 25 29 3d a4 49 63 6f  |rd$(dummy%)=.Ico|
00007690  6e 54 65 78 74 28 6d 61  69 6e 5f 57 69 6e 64 6f  |nText(main_Windo|
000076a0  77 25 2c 32 36 29 3a 6c  65 6e 25 28 64 75 6d 6d  |w%,26):len%(dumm|
000076b0  79 25 29 3d a4 6c 65 6e  28 77 6f 72 64 24 28 64  |y%)=.len(word$(d|
000076c0  75 6d 6d 79 25 29 29 0d  20 a8 50 f2 49 63 6f 6e  |ummy%)). .P.Icon|
000076d0  50 75 74 54 65 78 74 28  6d 61 69 6e 5f 57 69 6e  |PutText(main_Win|
000076e0  64 6f 77 25 2c 32 36 2c  22 22 29 3a f2 49 63 6f  |dow%,26,""):.Ico|
000076f0  6e 50 75 74 54 65 78 74  28 73 6f 6c 76 65 5f 57  |nPutText(solve_W|
00007700  69 6e 64 6f 77 25 2c 31  37 2c 22 22 29 3a f2 63  |indow%,17,""):.c|
00007710  61 72 65 74 28 30 29 0d  20 b2 24 f2 53 65 74 49  |aret(0). .$.SetI|
00007720  63 6f 6e 28 77 6f 72 64  73 5f 57 69 6e 64 6f 77  |con(words_Window|
00007730  25 2c 64 75 6d 6d 79 25  2b 33 29 0d 20 bc 46 f2  |%,dummy%+3). .F.|
00007740  73 6f 72 74 28 31 29 3a  e3 49 25 3d 31 b8 77 6f  |sort(1):.I%=1.wo|
00007750  72 64 73 25 3a f2 49 63  6f 6e 50 75 74 54 65 78  |rds%:.IconPutTex|
00007760  74 28 77 6f 72 64 73 5f  57 69 6e 64 6f 77 25 2c  |t(words_Window%,|
00007770  49 25 2b 33 2c 77 6f 72  64 24 28 49 25 29 29 3a  |I%+3,word$(I%)):|
00007780  ed 0d 20 c6 07 f2 77 77  0d 20 d0 2f 73 65 6c 65  |.. ...ww. ./sele|
00007790  63 74 65 64 25 28 64 75  6d 6d 79 25 29 3d 30 3a  |cted%(dummy%)=0:|
000077a0  73 65 6c 65 63 74 69 6f  6e 25 3d 30 3a f2 73 65  |selection%=0:.se|
000077b0  74 62 75 74 74 6f 6e 0d  20 da 15 f2 75 70 64 61  |tbutton. ...upda|
000077c0  74 65 73 6f 6c 76 65 73  74 61 74 65 0d 20 e4 53  |tesolvestate. .S|
000077d0  f2 72 65 63 28 32 29 3a  f2 49 63 6f 6e 50 75 74  |.rec(2):.IconPut|
000077e0  54 65 78 74 28 6d 61 69  6e 5f 57 69 6e 64 6f 77  |Text(main_Window|
000077f0  25 2c 31 32 2c c3 64 69  6d 78 29 3a f2 49 63 6f  |%,12,.dimx):.Ico|
00007800  6e 50 75 74 54 65 78 74  28 6d 61 69 6e 5f 57 69  |nPutText(main_Wi|
00007810  6e 64 6f 77 25 2c 31 36  2c c3 64 69 6d 79 29 0d  |ndow%,16,.dimy).|
00007820  20 ee 11 77 6f 72 64 73  73 61 76 65 64 25 3d 30  | ..wordssaved%=0|
00007830  0d 20 f8 15 c8 99 22 48  6f 75 72 67 6c 61 73 73  |. ...."Hourglass|
00007840  5f 4f 66 66 22 0d 21 02  05 e1 0d 21 0c 05 3a 0d  |_Off".!....!..:.|
00007850  21 16 11 dd f2 73 6f 72  74 28 74 79 70 65 25 29  |!....sort(type%)|
00007860  0d 21 20 20 e7 74 79 70  65 25 3d 32 20 74 79 70  |.!  .type%=2 typ|
00007870  65 25 3d 31 3a 72 25 3d  31 20 8b 20 72 25 3d 30  |e%=1:r%=1 . r%=0|
00007880  0d 21 2a 16 50 25 3d 77  6f 72 64 73 25 81 32 3a  |.!*.P%=words%.2:|
00007890  e7 50 25 3d 30 e1 0d 21  34 17 f5 3a 52 25 3d 77  |.P%=0..!4..:R%=w|
000078a0  6f 72 64 73 25 2d 50 25  3a 51 25 3d 31 0d 21 3e  |ords%-P%:Q%=1.!>|
000078b0  0b f5 3a 57 25 3d 51 25  0d 21 48 0e f5 3a 55 25  |..:W%=Q%.!H..:U%|
000078c0  3d 57 25 2b 50 25 0d 21  52 2c e7 74 79 70 65 25  |=W%+P%.!R,.type%|
000078d0  3d 31 80 77 6f 72 64 24  28 57 25 29 3c 3d 77 6f  |=1.word$(W%)<=wo|
000078e0  72 64 24 28 55 25 29 65  66 25 3d 31 3a e5 8d 74  |rd$(U%)ef%=1:..t|
000078f0  44 61 0d 21 5c 2a e7 74  79 70 65 25 3d 30 80 6c  |Da.!\*.type%=0.l|
00007900  65 6e 25 28 57 25 29 3e  3d 6c 65 6e 25 28 55 25  |en%(W%)>=len%(U%|
00007910  29 65 66 25 3d 31 3a e5  8d 74 44 61 0d 21 66 19  |)ef%=1:..tDa.!f.|
00007920  c8 94 77 6f 72 64 24 28  57 25 29 2c 77 6f 72 64  |..word$(W%),word|
00007930  24 28 55 25 29 0d 21 70  a7 e7 72 25 3d 30 20 c8  |$(U%).!p..r%=0 .|
00007940  94 6c 65 6e 25 28 57 25  29 2c 6c 65 6e 25 28 55  |.len%(W%),len%(U|
00007950  25 29 3a c8 94 73 74 61  72 74 25 28 57 25 29 2c  |%):..start%(W%),|
00007960  73 74 61 72 74 25 28 55  25 29 3a c8 94 64 69 72  |start%(U%):..dir|
00007970  25 28 57 25 29 2c 64 69  72 25 28 55 25 29 3a c8  |%(W%),dir%(U%):.|
00007980  94 73 68 6f 77 25 28 57  25 29 2c 73 68 6f 77 25  |.show%(W%),show%|
00007990  28 55 25 29 3a c8 94 73  78 25 28 57 25 29 2c 73  |(U%):..sx%(W%),s|
000079a0  78 25 28 55 25 29 3a c8  94 73 79 25 28 57 25 29  |x%(U%):..sy%(W%)|
000079b0  2c 73 79 25 28 55 25 29  3a c8 94 65 78 25 28 57  |,sy%(U%):..ex%(W|
000079c0  25 29 2c 65 78 25 28 55  25 29 3a c8 94 65 79 25  |%),ex%(U%):..ey%|
000079d0  28 57 25 29 2c 65 79 25  28 55 25 29 0d 21 7a 0a  |(W%),ey%(U%).!z.|
000079e0  57 25 2d 3d 50 25 0d 21  84 1b fd 57 25 3c 31 84  |W%-=P%.!...W%<1.|
000079f0  65 66 25 3d 31 3a 65 66  25 3d 30 3a 51 25 2b 3d  |ef%=1:ef%=0:Q%+=|
00007a00  31 0d 21 8e 12 fd 51 25  3e 52 25 3a 50 25 3d 50  |1.!...Q%>R%:P%=P|
00007a10  25 81 32 0d 21 98 09 fd  50 25 3d 30 0d 21 a2 05  |%.2.!...P%=0.!..|
00007a20  e1 0d 21 ac 05 3a 0d 21  b6 10 dd f2 72 65 70 28  |..!..:.!....rep(|
00007a30  74 79 70 65 25 29 0d 21  c0 22 e3 49 25 3d 31 b8  |type%).!.".I%=1.|
00007a40  77 6f 72 64 73 25 3a e7  77 6f 72 64 24 28 49 25  |words%:.word$(I%|
00007a50  29 3d 22 7e 7e 22 20 8c  0d 21 ca 10 77 6f 72 64  |)="~~" ..!..word|
00007a60  24 28 49 25 29 3d 22 22  0d 21 d4 73 e7 74 79 70  |$(I%)="".!.s.typ|
00007a70  65 25 3d 30 20 6c 65 6e  25 28 49 25 29 3d 30 3a  |e%=0 len%(I%)=0:|
00007a80  73 74 61 72 74 25 28 49  25 29 3d 30 3a 64 69 72  |start%(I%)=0:dir|
00007a90  25 28 49 25 29 3d 30 3a  73 65 6c 65 63 74 65 64  |%(I%)=0:selected|
00007aa0  25 28 49 25 29 3d 30 3a  73 68 6f 77 25 28 49 25  |%(I%)=0:show%(I%|
00007ab0  29 3d 30 3a 73 78 25 28  49 25 29 3d 30 3a 73 79  |)=0:sx%(I%)=0:sy|
00007ac0  25 28 49 25 29 3d 30 3a  65 78 25 28 49 25 29 3d  |%(I%)=0:ex%(I%)=|
00007ad0  30 3a 65 79 25 28 49 25  29 3d 30 0d 21 de 05 cd  |0:ey%(I%)=0.!...|
00007ae0  0d 21 e8 05 ed 0d 21 f2  05 e1 0d 21 fc 05 3a 0d  |.!....!....!..:.|
00007af0  22 06 11 dd f2 62 75 6d  70 78 28 69 6e 63 25 29  |"....bumpx(inc%)|
00007b00  0d 22 10 0f e7 77 6f 72  64 73 25 3d 30 20 e1 0d  |."...words%=0 ..|
00007b10  22 1a 19 e7 62 75 74 74  6f 6e 25 3d 31 20 69 6e  |"...button%=1 in|
00007b20  63 25 3d 2d 69 6e 63 25  0d 22 24 2b e7 20 28 64  |c%=-inc%."$+. (d|
00007b30  69 6d 78 2a 64 69 6d 79  29 3c 28 6e 65 65 64 73  |imx*dimy)<(needs|
00007b40  25 2a 31 2e 31 32 29 20  80 20 69 6e 63 25 3d 2d  |%*1.12) . inc%=-|
00007b50  31 20 e1 0d 22 2e 2e e7  20 28 64 69 6d 78 3d 34  |1 .."... (dimx=4|
00007b60  30 20 80 20 69 6e 63 25  3e 30 29 20 84 20 28 64  |0 . inc%>0) . (d|
00007b70  69 6d 78 3d 30 20 80 20  69 6e 63 25 3c 30 29 20  |imx=0 . inc%<0) |
00007b80  e1 0d 22 38 26 64 69 6d  78 2b 3d 69 6e 63 25 3a  |.."8&dimx+=inc%:|
00007b90  e7 20 a4 67 61 70 73 3c  31 30 3a 64 69 6d 78 2d  |. .gaps<10:dimx-|
00007ba0  3d 69 6e 63 25 3a e1 0d  22 42 27 f2 49 63 6f 6e  |=inc%:.."B'.Icon|
00007bb0  50 75 74 54 65 78 74 28  6d 61 69 6e 5f 57 69 6e  |PutText(main_Win|
00007bc0  64 6f 77 25 2c 31 32 2c  c3 64 69 6d 78 29 0d 22  |dow%,12,.dimx)."|
00007bd0  4c 32 67 61 70 73 3d a4  67 61 70 73 3a f2 49 63  |L2gaps=.gaps:.Ic|
00007be0  6f 6e 50 75 74 54 65 78  74 28 6d 61 69 6e 5f 57  |onPutText(main_W|
00007bf0  69 6e 64 6f 77 25 2c 32  30 2c c3 67 61 70 73 29  |indow%,20,.gaps)|
00007c00  0d 22 56 05 e1 0d 22 60  05 3a 0d 22 6a 11 dd f2  |."V..."`.:."j...|
00007c10  62 75 6d 70 79 28 69 6e  63 25 29 0d 22 74 0f e7  |bumpy(inc%)."t..|
00007c20  77 6f 72 64 73 25 3d 30  20 e1 0d 22 7e 19 e7 62  |words%=0 .."~..b|
00007c30  75 74 74 6f 6e 25 3d 31  20 69 6e 63 25 3d 2d 69  |utton%=1 inc%=-i|
00007c40  6e 63 25 0d 22 88 35 e7  20 28 64 69 6d 78 2a 64  |nc%.".5. (dimx*d|
00007c50  69 6d 79 29 3c 28 6e 65  65 64 73 25 2a 28 31 2b  |imy)<(needs%*(1+|
00007c60  28 67 61 70 73 2f 31 30  30 29 29 29 20 80 20 69  |(gaps/100))) . i|
00007c70  6e 63 25 3d 2d 31 20 e1  0d 22 92 30 e7 20 28 64  |nc%=-1 ..".0. (d|
00007c80  69 6d 79 3d 6d 61 78 68  20 80 20 69 6e 63 25 3e  |imy=maxh . inc%>|
00007c90  30 29 20 84 20 28 64 69  6d 79 3d 30 20 80 20 69  |0) . (dimy=0 . i|
00007ca0  6e 63 25 3c 30 29 20 e1  0d 22 9c 26 64 69 6d 79  |nc%<0) ..".&dimy|
00007cb0  2b 3d 69 6e 63 25 3a e7  20 a4 67 61 70 73 3c 31  |+=inc%:. .gaps<1|
00007cc0  30 3a 64 69 6d 79 2d 3d  69 6e 63 25 3a e1 0d 22  |0:dimy-=inc%:.."|
00007cd0  a6 27 f2 49 63 6f 6e 50  75 74 54 65 78 74 28 6d  |.'.IconPutText(m|
00007ce0  61 69 6e 5f 57 69 6e 64  6f 77 25 2c 31 36 2c c3  |ain_Window%,16,.|
00007cf0  64 69 6d 79 29 0d 22 b0  32 67 61 70 73 3d a4 67  |dimy).".2gaps=.g|
00007d00  61 70 73 3a f2 49 63 6f  6e 50 75 74 54 65 78 74  |aps:.IconPutText|
00007d10  28 6d 61 69 6e 5f 57 69  6e 64 6f 77 25 2c 32 30  |(main_Window%,20|
00007d20  2c c3 67 61 70 73 29 0d  22 ba 05 e1 0d 22 c4 05  |,.gaps)."...."..|
00007d30  3a 0d 22 ce 14 dd f2 62  75 6d 70 67 61 70 73 28  |:."....bumpgaps(|
00007d40  69 6e 63 25 29 0d 22 d8  16 e7 67 61 70 73 3c 31  |inc%)."...gaps<1|
00007d50  30 20 f2 72 65 63 28 30  29 3a e1 0d 22 e2 19 e7  |0 .rec(0):.."...|
00007d60  62 75 74 74 6f 6e 25 3d  31 20 69 6e 63 25 3d 2d  |button%=1 inc%=-|
00007d70  69 6e 63 25 0d 22 ec 1b  e7 20 28 67 61 70 73 3d  |inc%."... (gaps=|
00007d80  31 30 20 80 20 69 6e 63  25 3d 2d 31 29 20 e1 0d  |10 . inc%=-1) ..|
00007d90  22 f6 1c e7 20 28 67 61  70 73 3d 6d 61 78 68 20  |"... (gaps=maxh |
00007da0  80 20 69 6e 63 25 3d 31  29 20 e1 0d 23 00 0e 67  |. inc%=1) ..#..g|
00007db0  61 70 73 2b 3d 69 6e 63  25 0d 23 0a 27 f2 49 63  |aps+=inc%.#.'.Ic|
00007dc0  6f 6e 50 75 74 54 65 78  74 28 6d 61 69 6e 5f 57  |onPutText(main_W|
00007dd0  69 6e 64 6f 77 25 2c 32  30 2c c3 67 61 70 73 29  |indow%,20,.gaps)|
00007de0  0d 23 14 53 f2 72 65 63  28 30 29 3a f2 49 63 6f  |.#.S.rec(0):.Ico|
00007df0  6e 50 75 74 54 65 78 74  28 6d 61 69 6e 5f 57 69  |nPutText(main_Wi|
00007e00  6e 64 6f 77 25 2c 31 32  2c c3 64 69 6d 78 29 3a  |ndow%,12,.dimx):|
00007e10  f2 49 63 6f 6e 50 75 74  54 65 78 74 28 6d 61 69  |.IconPutText(mai|
00007e20  6e 5f 57 69 6e 64 6f 77  25 2c 31 36 2c c3 64 69  |n_Window%,16,.di|
00007e30  6d 79 29 0d 23 1e 05 e1  0d 23 28 05 3a 0d 23 32  |my).#....#(.:.#2|
00007e40  1c dd a4 62 75 6d 70 70  74 28 69 6e 63 25 2c 64  |...bumppt(inc%,d|
00007e50  75 6d 6d 79 25 2c 64 25  29 0d 23 3c 39 e7 20 28  |ummy%,d%).#<9. (|
00007e60  64 75 6d 6d 79 25 3d 36  20 80 20 69 6e 63 25 3d  |dummy%=6 . inc%=|
00007e70  2d 31 29 20 84 20 28 64  75 6d 6d 79 25 3d 32 34  |-1) . (dummy%=24|
00007e80  20 80 20 69 6e 63 25 3d  31 29 3a 3d 64 75 6d 6d  | . inc%=1):=dumm|
00007e90  79 25 0d 23 46 19 e7 62  75 74 74 6f 6e 25 3d 31  |y%.#F..button%=1|
00007ea0  20 69 6e 63 25 3d 2d 69  6e 63 25 0d 23 50 3d 64  | inc%=-inc%.#P=d|
00007eb0  75 6d 6d 79 25 2b 3d 69  6e 63 25 3a f2 49 63 6f  |ummy%+=inc%:.Ico|
00007ec0  6e 50 75 74 54 65 78 74  28 70 72 65 66 73 5f 57  |nPutText(prefs_W|
00007ed0  69 6e 64 6f 77 25 2c 64  25 2c c3 64 75 6d 6d 79  |indow%,d%,.dummy|
00007ee0  25 2b 22 20 70 74 22 29  0d 23 5a 0b 3d 64 75 6d  |%+" pt").#Z.=dum|
00007ef0  6d 79 25 0d 23 64 05 3a  0d 23 6e 0a dd a4 67 61  |my%.#d.:.#n...ga|
00007f00  70 73 0d 23 78 16 e7 64  69 6d 78 2a 64 69 6d 79  |ps.#x..dimx*dimy|
00007f10  3d 30 20 3d 67 61 70 73  0d 23 82 33 3d a4 72 6f  |=0 =gaps.#.3=.ro|
00007f20  75 6e 64 28 28 28 28 64  69 6d 78 2a 64 69 6d 79  |und((((dimx*dimy|
00007f30  29 2d 6e 65 65 64 73 25  29 2f 28 64 69 6d 78 2a  |)-needs%)/(dimx*|
00007f40  64 69 6d 79 29 29 2a 31  30 30 29 0d 23 8c 05 3a  |dimy))*100).#..:|
00007f50  0d 23 96 17 dd a4 6f 6e  65 6f 72 6d 6f 72 65 28  |.#....oneormore(|
00007f60  64 75 6d 6d 79 25 29 0d  23 a0 19 e7 20 64 75 6d  |dummy%).#... dum|
00007f70  6d 79 25 3d 31 20 3d 22  31 20 77 6f 72 64 20 22  |my%=1 ="1 word "|
00007f80  0d 23 aa 1b e7 20 64 75  6d 6d 79 25 3d 30 20 3d  |.#... dummy%=0 =|
00007f90  22 4e 6f 20 77 6f 72 64  73 20 22 0d 23 b4 16 3d  |"No words ".#..=|
00007fa0  c3 64 75 6d 6d 79 25 2b  22 20 77 6f 72 64 73 20  |.dummy%+" words |
00007fb0  22 0d 23 be 05 3a 0d 23  c8 12 dd a4 6e 6f 6e 65  |".#..:.#....none|
00007fc0  28 64 75 6d 6d 79 25 29  0d 23 d2 25 e7 64 75 6d  |(dummy%).#.%.dum|
00007fd0  6d 79 25 3d 30 20 3d 22  4e 6f 6e 65 20 22 20 8b  |my%=0 ="None " .|
00007fe0  20 3d c3 64 75 6d 6d 79  25 2b 22 20 22 0d 23 dc  | =.dummy%+" ".#.|
00007ff0  05 3a 0d 23 e6 0c dd f2  63 72 65 61 74 65 0d 23  |.:.#....create.#|
00008000  f0 54 e7 20 77 6f 72 64  73 25 3c 31 20 f2 41 6c  |.T. words%<1 .Al|
00008010  65 72 74 28 22 57 6f 72  64 53 71 22 2c 22 54 68  |ert("WordSq","Th|
00008020  65 72 65 20 61 72 65 20  6e 6f 20 77 6f 72 64 73  |ere are no words|
00008030  20 74 6f 20 62 65 20 70  6c 61 63 65 64 20 69 6e  | to be placed in|
00008040  20 61 20 77 6f 72 64 73  71 75 61 72 65 21 22 29  | a wordsquare!")|
00008050  3a e1 0d 23 fa 58 64 25  3d 30 3a e7 77 6f 72 64  |:..#.Xd%=0:.word|
00008060  73 25 3c 31 32 31 20 e5  8d 54 62 64 20 8b 3a e7  |s%<121 ..Tbd .:.|
00008070  28 64 62 6c 25 3d 30 20  80 20 64 69 6d 78 3c 28  |(dbl%=0 . dimx<(|
00008080  28 6c 65 6e 25 2a 32 29  2b 31 29 29 20 84 20 28  |(len%*2)+1)) . (|
00008090  64 62 6c 25 3d 2d 31 20  80 20 64 69 6d 78 3c 28  |dbl%=-1 . dimx<(|
000080a0  6c 65 6e 25 2b 31 29 29  20 8c 0d 24 04 26 e7 20  |len%+1)) ..$.&. |
000080b0  64 62 6c 25 3d 30 20 64  25 3d 28 6c 65 6e 25 2a  |dbl%=0 d%=(len%*|
000080c0  32 29 2b 31 20 8b 20 64  25 3d 6c 65 6e 25 2b 31  |2)+1 . d%=len%+1|
000080d0  0d 24 0e 92 f2 41 6c 65  72 74 28 22 57 6f 72 64  |.$...Alert("Word|
000080e0  53 71 22 2c 22 54 68 65  20 6e 75 6d 62 65 72 20  |Sq","The number |
000080f0  6f 66 20 77 6f 72 64 73  20 6d 65 61 6e 73 20 74  |of words means t|
00008100  68 61 74 20 74 68 65 20  67 72 69 64 20 6d 75 73  |hat the grid mus|
00008110  74 20 62 65 20 61 74 20  6c 65 61 73 74 20 22 2b  |t be at least "+|
00008120  c3 64 25 2b 22 20 63 68  61 72 61 63 74 65 72 73  |.d%+" characters|
00008130  20 61 63 72 6f 73 73 2e  20 20 50 6c 65 61 73 65  | across.  Please|
00008140  20 72 65 73 65 74 20 74  68 69 73 20 76 61 6c 75  | reset this valu|
00008150  65 20 61 6e 64 20 74 72  79 20 61 67 61 69 6e 2e  |e and try again.|
00008160  22 29 0d 24 18 05 cd 0d  24 22 0b e7 64 25 3e 30  |").$....$"..d%>0|
00008170  20 e1 0d 24 2c 27 77 73  71 74 69 74 6c 65 24 3d  | ..$,'wsqtitle$=|
00008180  a4 49 63 6f 6e 54 65 78  74 28 6d 61 69 6e 5f 57  |.IconText(main_W|
00008190  69 6e 64 6f 77 25 2c 39  29 0d 24 36 c4 e7 28 64  |indow%,9).$6..(d|
000081a0  69 6d 78 2a 64 69 6d 79  29 3c 28 31 2e 31 2a 6e  |imx*dimy)<(1.1*n|
000081b0  65 65 64 73 25 29 20 84  20 28 64 69 6d 78 3c 6c  |eeds%) . (dimx<l|
000081c0  65 6e 25 20 80 20 64 69  6d 79 3c 6c 65 6e 25 29  |en% . dimy<len%)|
000081d0  20 f2 41 6c 65 72 74 28  22 57 6f 72 64 53 71 22  | .Alert("WordSq"|
000081e0  2c 22 41 6c 6c 20 6f 66  20 74 68 65 73 65 20 77  |,"All of these w|
000081f0  6f 72 64 73 20 77 69 6c  6c 20 6e 6f 74 20 66 69  |ords will not fi|
00008200  74 20 69 6e 74 6f 20 74  68 65 20 6c 61 72 67 65  |t into the large|
00008210  73 74 20 73 69 7a 65 20  67 72 69 64 20 2d 20 79  |st size grid - y|
00008220  6f 75 20 6d 75 73 74 20  64 65 6c 65 74 65 20 61  |ou must delete a|
00008230  20 66 65 77 2c 20 6f 72  20 73 68 6f 72 74 65 6e  | few, or shorten|
00008240  20 73 6f 6d 65 20 6f 66  20 74 68 65 20 6c 6f 6e  | some of the lon|
00008250  67 65 72 20 6f 6e 65 73  2e 22 29 3a e1 0d 24 40  |ger ones."):..$@|
00008260  14 c8 99 22 48 6f 75 72  67 6c 61 73 73 5f 4f 6e  |..."Hourglass_On|
00008270  22 0d 24 4a 17 77 73 71  78 3d 64 69 6d 78 3a 77  |".$J.wsqx=dimx:w|
00008280  73 71 79 3d 64 69 6d 79  0d 24 54 2a 6e 6f 74 25  |sqy=dimy.$T*not%|
00008290  3d 30 3a 70 6c 61 25 3d  30 3a 46 25 3d 30 3a 73  |=0:pla%=0:F%=0:s|
000082a0  74 61 72 74 78 25 3d 30  3a 73 74 61 72 74 79 25  |tartx%=0:starty%|
000082b0  3d 30 0d 24 5e 2a 67 72  69 64 25 28 29 3d 30 3a  |=0.$^*grid%()=0:|
000082c0  73 74 61 72 74 25 28 29  3d 30 3a 64 69 72 25 28  |start%()=0:dir%(|
000082d0  29 3d 30 3a f2 73 6f 72  74 28 30 29 0d 24 68 2a  |)=0:.sort(0).$h*|
000082e0  5a 25 3d 30 3a e3 49 25  3d 31 b8 77 6f 72 64 73  |Z%=0:.I%=1.words|
000082f0  25 3a 77 24 3d a4 73 74  72 69 70 28 77 6f 72 64  |%:w$=.strip(word|
00008300  24 28 49 25 29 29 0d 24  72 13 41 25 3d 30 3a 74  |$(I%)).$r.A%=0:t|
00008310  72 25 3d 30 3a 46 25 3d  30 0d 24 7c 0c f5 3a 74  |r%=0:F%=0.$|..:t|
00008320  72 25 2b 3d 31 0d 24 86  38 e7 a6 2d 31 31 33 20  |r%+=1.$.8..-113 |
00008330  f2 41 6c 65 72 74 28 22  57 6f 72 64 53 71 22 2c  |.Alert("WordSq",|
00008340  22 43 72 65 61 74 69 6f  6e 20 69 6e 74 65 72 72  |"Creation interr|
00008350  75 70 74 65 64 2e 22 29  3a 5a 25 3d 31 0d 24 90  |upted."):Z%=1.$.|
00008360  13 41 25 3d b3 28 64 69  6d 78 2a 64 69 6d 79 29  |.A%=.(dimx*dimy)|
00008370  0d 24 9a 2f e7 20 67 72  69 64 25 28 41 25 29 3c  |.$./. grid%(A%)<|
00008380  3e 30 20 80 20 67 72 69  64 25 28 41 25 29 3c 3e  |>0 . grid%(A%)<>|
00008390  97 28 c0 77 24 2c 31 29  29 20 e5 8d 74 50 64 0d  |.(.w$,1)) ..tPd.|
000083a0  24 a4 0e f2 65 6e 64 73  3a f2 66 69 74 0d 24 ae  |$...ends:.fit.$.|
000083b0  2d fd 46 25 3d 31 20 84  20 5a 25 3d 31 20 84 20  |-.F%=1 . Z%=1 . |
000083c0  74 72 25 3e 3d 28 64 69  6d 78 2a 64 69 6d 79 29  |tr%>=(dimx*dimy)|
000083d0  2b 64 69 6d 78 2b 64 69  6d 79 0d 24 b8 22 e7 5a  |+dimx+dimy.$.".Z|
000083e0  25 3d 31 20 49 25 3d 77  6f 72 64 73 25 2b 31 3a  |%=1 I%=words%+1:|
000083f0  ed 3a f2 6e 67 3a 5a 25  3d 30 3a e1 0d 24 c2 4a  |.:.ng:Z%=0:..$.J|
00008400  e7 74 72 25 3e 3d 28 64  69 6d 78 2a 64 69 6d 79  |.tr%>=(dimx*dimy|
00008410  29 2b 64 69 6d 78 2b 64  69 6d 79 20 6e 6f 74 25  |)+dimx+dimy not%|
00008420  2b 3d 31 3a 73 74 61 72  74 25 28 49 25 29 3d 30  |+=1:start%(I%)=0|
00008430  3a 64 69 72 25 28 49 25  29 3d 39 39 3a 8b 20 70  |:dir%(I%)=99:. p|
00008440  6c 61 25 2b 3d 31 0d 24  cc 50 f2 49 63 6f 6e 50  |la%+=1.$.P.IconP|
00008450  75 74 54 65 78 74 28 6d  61 69 6e 5f 57 69 6e 64  |utText(main_Wind|
00008460  6f 77 25 2c 36 2c 22 43  72 65 61 74 69 6e 67 20  |ow%,6,"Creating |
00008470  2d 20 22 2b a4 6f 6e 65  6f 72 6d 6f 72 65 28 70  |- "+.oneormore(p|
00008480  6c 61 25 29 2b 22 70 6c  61 63 65 64 20 73 6f 20  |la%)+"placed so |
00008490  66 61 72 2e 22 29 0d 24  d6 29 e7 64 69 72 25 28  |far.").$.).dir%(|
000084a0  49 25 29 3c 3e 39 39 20  f2 70 6f 73 69 74 69 6f  |I%)<>99 .positio|
000084b0  6e 73 28 49 25 2c 64 69  72 25 28 49 25 29 29 0d  |ns(I%,dir%(I%)).|
000084c0  24 e0 3b c8 99 22 48 6f  75 72 67 6c 61 73 73 5f  |$.;.."Hourglass_|
000084d0  50 65 72 63 65 6e 74 61  67 65 22 2c a4 72 6f 75  |Percentage",.rou|
000084e0  6e 64 28 28 70 6c 61 25  2b 6e 6f 74 25 29 2f 77  |nd((pla%+not%)/w|
000084f0  6f 72 64 73 25 2a 31 30  30 29 0d 24 ea 62 ed 3a  |ords%*100).$.b.:|
00008500  f2 67 61 70 73 3a f2 73  6f 72 74 28 31 29 3a f2  |.gaps:.sort(1):.|
00008510  49 63 6f 6e 50 75 74 54  65 78 74 28 6d 61 69 6e  |IconPutText(main|
00008520  5f 57 69 6e 64 6f 77 25  2c 36 2c a4 6f 6e 65 6f  |_Window%,6,.oneo|
00008530  72 6d 6f 72 65 28 70 6c  61 25 29 2b 22 70 6c 61  |rmore(pla%)+"pla|
00008540  63 65 64 20 2d 20 22 2b  c3 77 73 71 67 61 70 73  |ced - "+.wsqgaps|
00008550  2b 22 25 20 67 61 70 73  2e 20 22 29 0d 24 f4 24  |+"% gaps. ").$.$|
00008560  c8 99 22 48 6f 75 72 67  6c 61 73 73 5f 4f 66 66  |.."Hourglass_Off|
00008570  22 3a 77 73 71 77 6f 72  64 73 25 3d 70 6c 61 25  |":wsqwords%=pla%|
00008580  0d 24 fe 91 e7 20 70 6c  61 25 3d 30 20 f2 41 6c  |.$... pla%=0 .Al|
00008590  65 72 74 28 22 57 6f 72  64 53 71 22 2c 22 49 6e  |ert("WordSq","In|
000085a0  20 66 61 63 74 2c 20 6e  6f 20 77 6f 72 64 73 20  | fact, no words |
000085b0  63 6f 75 6c 64 20 62 65  20 70 6c 61 63 65 64 2e  |could be placed.|
000085c0  20 54 72 79 20 69 6e 63  72 65 61 73 69 6e 67 20  | Try increasing |
000085d0  74 68 65 20 67 72 69 64  20 73 69 7a 65 2e 22 29  |the grid size.")|
000085e0  3a f2 49 63 6f 6e 50 75  74 54 65 78 74 28 6d 61  |:.IconPutText(ma|
000085f0  69 6e 5f 57 69 6e 64 6f  77 25 2c 36 2c 22 4e 6f  |in_Window%,6,"No|
00008600  20 67 72 69 64 20 66 6f  72 6d 65 64 2e 22 29 3a  | grid formed."):|
00008610  e1 0d 25 08 0d e7 6e 6f  74 25 3e 30 20 8c 0d 25  |..%...not%>0 ..%|
00008620  12 21 e7 6e 6f 74 25 3d  31 20 64 24 3d 22 49 74  |.!.not%=1 d$="It|
00008630  20 22 20 8b 20 64 24 3d  22 54 68 65 79 20 22 0d  | " . d$="They ".|
00008640  25 1c ce f2 41 6c 65 72  74 28 22 57 6f 72 64 53  |%...Alert("WordS|
00008650  71 22 2c 22 57 68 65 6e  20 63 72 65 61 74 69 6e  |q","When creatin|
00008660  67 20 74 68 65 20 77 6f  72 64 73 71 75 61 72 65  |g the wordsquare|
00008670  2c 20 22 2b a4 6f 6e 65  6f 72 6d 6f 72 65 28 6e  |, "+.oneormore(n|
00008680  6f 74 25 29 2b 22 63 6f  75 6c 64 20 6e 6f 74 20  |ot%)+"could not |
00008690  62 65 20 70 6c 61 63 65  64 2e 20 22 2b 64 24 2b  |be placed. "+d$+|
000086a0  22 77 69 6c 6c 20 72 65  6d 61 69 6e 20 69 6e 20  |"will remain in |
000086b0  6d 65 6d 6f 72 79 20 61  6e 64 20 61 70 70 65 61  |memory and appea|
000086c0  72 20 73 65 6c 65 63 74  65 64 20 69 6e 20 74 68  |r selected in th|
000086d0  65 20 77 6f 72 64 20 6c  69 73 74 20 77 69 6e 64  |e word list wind|
000086e0  6f 77 2c 20 62 75 74 20  77 69 6c 6c 20 6e 6f 74  |ow, but will not|
000086f0  20 73 68 6f 77 20 75 70  20 6f 6e 20 74 68 65 20  | show up on the |
00008700  77 6f 72 64 73 71 75 61  72 65 2e 22 29 0d 25 26  |wordsquare.").%&|
00008710  2b f2 63 6c 65 61 72 61  6c 6c 3a 73 65 6c 65 63  |+.clearall:selec|
00008720  74 65 64 77 6f 72 64 24  3d 22 22 3a e3 49 25 3d  |tedword$="":.I%=|
00008730  31 b8 77 6f 72 64 73 25  0d 25 30 6e e7 64 69 72  |1.words%.%0n.dir|
00008740  25 28 49 25 29 3d 39 39  20 64 69 72 25 28 49 25  |%(I%)=99 dir%(I%|
00008750  29 3d 30 3a f2 53 65 74  49 63 6f 6e 28 77 6f 72  |)=0:.SetIcon(wor|
00008760  64 73 5f 57 69 6e 64 6f  77 25 2c 49 25 2b 33 29  |ds_Window%,I%+3)|
00008770  3a 73 65 6c 65 63 74 65  64 25 28 49 25 29 3d 31  |:selected%(I%)=1|
00008780  3a 73 65 6c 65 63 74 69  6f 6e 25 2b 3d 31 3a 73  |:selection%+=1:s|
00008790  65 6c 65 63 74 65 64 77  6f 72 64 24 3d 77 6f 72  |electedword$=wor|
000087a0  64 24 28 49 25 29 0d 25  3a 10 ed 3a f2 73 65 74  |d$(I%).%:..:.set|
000087b0  62 75 74 74 6f 6e 0d 25  44 2a e7 73 65 6c 65 63  |button.%D*.selec|
000087c0  74 69 6f 6e 25 3d 31 20  64 24 3d 73 65 6c 65 63  |tion%=1 d$=selec|
000087d0  74 65 64 77 6f 72 64 24  20 8b 20 64 24 3d 22 22  |tedword$ . d$=""|
000087e0  0d 25 4e 54 f2 49 63 6f  6e 50 75 74 54 65 78 74  |.%NT.IconPutText|
000087f0  28 6d 61 69 6e 5f 57 69  6e 64 6f 77 25 2c 32 36  |(main_Window%,26|
00008800  2c 64 24 29 3a f2 49 63  6f 6e 50 75 74 54 65 78  |,d$):.IconPutTex|
00008810  74 28 73 6f 6c 76 65 5f  57 69 6e 64 6f 77 25 2c  |t(solve_Window%,|
00008820  31 37 2c 64 24 29 3a f2  63 61 72 65 74 28 a9 64  |17,d$):.caret(.d|
00008830  24 2f 32 29 0d 25 58 05  cd 0d 25 62 51 f2 4d 65  |$/2).%X...%bQ.Me|
00008840  6e 75 45 6e 61 62 6c 65  28 6d 61 69 6e 5f 4d 65  |nuEnable(main_Me|
00008850  6e 75 25 2c 34 29 3a f2  4d 65 6e 75 45 6e 61 62  |nu%,4):.MenuEnab|
00008860  6c 65 28 6d 61 69 6e 5f  4d 65 6e 75 25 2c 35 29  |le(main_Menu%,5)|
00008870  3a f2 4d 65 6e 75 45 6e  61 62 6c 65 28 6d 61 69  |:.MenuEnable(mai|
00008880  6e 5f 4d 65 6e 75 25 2c  36 29 0d 25 6c 31 f2 64  |n_Menu%,6).%l1.d|
00008890  69 73 70 6c 61 79 3a 73  6f 6c 76 65 66 6f 72 6d  |isplay:solveform|
000088a0  61 74 24 3d 22 6f 77 6e  22 3a f2 75 70 64 61 74  |at$="own":.updat|
000088b0  65 73 6f 6c 76 65 73 74  61 74 65 0d 25 76 4a f2  |esolvestate.%vJ.|
000088c0  49 63 6f 6e 50 75 74 54  65 78 74 28 73 6f 6c 76  |IconPutText(solv|
000088d0  65 5f 57 69 6e 64 6f 77  25 2c 35 2c 22 55 73 69  |e_Window%,5,"Usi|
000088e0  6e 67 20 77 6f 72 64 73  71 75 61 72 65 20 66 72  |ng wordsquare fr|
000088f0  6f 6d 20 63 72 65 61 74  6f 72 20 70 72 6f 67 72  |om creator progr|
00008900  61 6d 2e 22 29 0d 25 80  2c e7 73 6f 6c 76 65 77  |am.").%.,.solvew|
00008910  69 6e 64 25 20 f2 42 72  69 6e 67 54 6f 54 6f 70  |ind% .BringToTop|
00008920  28 64 69 73 70 6c 61 79  5f 57 69 6e 64 6f 77 25  |(display_Window%|
00008930  29 0d 25 8a 24 77 73 71  78 3d 64 69 6d 78 3a 77  |).%.$wsqx=dimx:w|
00008940  73 71 79 3d 64 69 6d 79  3a 67 72 69 64 73 61 76  |sqy=dimy:gridsav|
00008950  65 64 25 3d 30 0d 25 94  05 e1 0d 25 9e 05 3a 0d  |ed%=0.%....%..:.|
00008960  25 a8 0e dd a4 63 61 70  73 28 64 24 29 0d 25 b2  |%....caps(d$).%.|
00008970  07 ea 4b 25 0d 25 bc 0e  e7 a9 64 24 3d 30 20 3d  |..K%.%....d$=0 =|
00008980  22 22 0d 25 c6 1e e3 4b  25 3d 31 b8 a9 64 24 3a  |"".%...K%=1..d$:|
00008990  63 68 25 3d 97 28 c1 64  24 2c 4b 25 2c 31 29 29  |ch%=.(.d$,K%,1))|
000089a0  0d 25 d0 2a e7 63 68 25  3e 39 36 20 80 20 63 68  |.%.*.ch%>96 . ch|
000089b0  25 3c 31 32 33 20 c1 64  24 2c 4b 25 2c 31 29 3d  |%<123 .d$,K%,1)=|
000089c0  bd 28 63 68 25 80 32 32  33 29 0d 25 da 05 ed 0d  |.(ch%.223).%....|
000089d0  25 e4 07 3d 64 24 0d 25  ee 05 3a 0d 25 f8 0a dd  |%..=d$.%..:.%...|
000089e0  f2 65 6e 64 73 0d 26 02  43 70 6f 3d 41 25 3a 70  |.ends.&.Cpo=A%:p|
000089f0  6f 2d 3d 31 3a f5 3a 70  6f 2b 3d 31 3a fd a8 28  |o-=1:.:po+=1:..(|
00008a00  70 6f 2f 64 69 6d 78 29  3d 70 6f 2f 64 69 6d 78  |po/dimx)=po/dimx|
00008a10  3a 6d 65 25 3d 70 6f 3a  6d 77 25 3d 6d 65 25 2d  |:me%=po:mw%=me%-|
00008a20  28 64 69 6d 78 2d 31 29  0d 26 0c 05 e1 0d 26 16  |(dimx-1).&....&.|
00008a30  05 3a 0d 26 20 09 dd f2  66 69 74 0d 26 2a 0c 4c  |.:.& ...fit.&*.L|
00008a40  25 3d a9 77 24 2d 31 0d  26 34 43 e7 41 25 2d 4c  |%=.w$-1.&4C.A%-L|
00008a50  25 3e 3d 6d 77 25 20 80  20 41 25 2d 28 64 69 6d  |%>=mw% . A%-(dim|
00008a60  78 2a 4c 25 29 3e 3d 31  20 f2 66 69 6c 6c 28 2d  |x*L%)>=1 .fill(-|
00008a70  31 2c 2d 64 69 6d 78 29  3a 64 69 72 25 28 49 25  |1,-dimx):dir%(I%|
00008a80  29 3d 38 3a e7 20 46 25  20 e1 0d 26 3e 4a e7 41  |)=8:. F% ..&>J.A|
00008a90  25 2d 4c 25 3e 3d 6d 77  25 20 80 20 41 25 2b 28  |%-L%>=mw% . A%+(|
00008aa0  64 69 6d 78 2a 4c 25 29  3c 3d 64 69 6d 78 2a 64  |dimx*L%)<=dimx*d|
00008ab0  69 6d 79 20 f2 66 69 6c  6c 28 2d 31 2c 64 69 6d  |imy .fill(-1,dim|
00008ac0  78 29 3a 64 69 72 25 28  49 25 29 3d 36 3a e7 20  |x):dir%(I%)=6:. |
00008ad0  46 25 20 e1 0d 26 48 49  e7 41 25 2b 4c 25 3c 3d  |F% ..&HI.A%+L%<=|
00008ae0  6d 65 25 20 80 20 41 25  2b 28 64 69 6d 78 2a 4c  |me% . A%+(dimx*L|
00008af0  25 29 3c 3d 64 69 6d 78  2a 64 69 6d 79 20 f2 66  |%)<=dimx*dimy .f|
00008b00  69 6c 6c 28 31 2c 64 69  6d 78 29 3a 64 69 72 25  |ill(1,dimx):dir%|
00008b10  28 49 25 29 3d 34 3a e7  20 46 25 20 e1 0d 26 52  |(I%)=4:. F% ..&R|
00008b20  42 e7 41 25 2b 4c 25 3c  3d 6d 65 25 20 80 20 41  |B.A%+L%<=me% . A|
00008b30  25 2d 28 64 69 6d 78 2a  4c 25 29 3e 3d 31 20 f2  |%-(dimx*L%)>=1 .|
00008b40  66 69 6c 6c 28 31 2c 2d  64 69 6d 78 29 3a 64 69  |fill(1,-dimx):di|
00008b50  72 25 28 49 25 29 3d 32  3a e7 20 46 25 20 e1 0d  |r%(I%)=2:. F% ..|
00008b60  26 5c 2d e7 41 25 2d 4c  25 3e 3d 6d 77 25 20 f2  |&\-.A%-L%>=mw% .|
00008b70  66 69 6c 6c 28 2d 31 2c  30 29 3a 64 69 72 25 28  |fill(-1,0):dir%(|
00008b80  49 25 29 3d 37 3a e7 20  46 25 20 e1 0d 26 66 35  |I%)=7:. F% ..&f5|
00008b90  e7 41 25 2d 28 64 69 6d  78 2a 4c 25 29 3e 3d 31  |.A%-(dimx*L%)>=1|
00008ba0  20 f2 66 69 6c 6c 28 30  2c 2d 64 69 6d 78 29 3a  | .fill(0,-dimx):|
00008bb0  64 69 72 25 28 49 25 29  3d 31 3a e7 20 46 25 20  |dir%(I%)=1:. F% |
00008bc0  e1 0d 26 70 3c e7 41 25  2b 28 64 69 6d 78 2a 4c  |..&p<.A%+(dimx*L|
00008bd0  25 29 3c 3d 64 69 6d 78  2a 64 69 6d 79 20 f2 66  |%)<=dimx*dimy .f|
00008be0  69 6c 6c 28 30 2c 64 69  6d 78 29 3a 64 69 72 25  |ill(0,dimx):dir%|
00008bf0  28 49 25 29 3d 35 3a e7  20 46 25 20 e1 0d 26 7a  |(I%)=5:. F% ..&z|
00008c00  2c e7 41 25 2b 4c 25 3c  3d 6d 65 25 3a f2 66 69  |,.A%+L%<=me%:.fi|
00008c10  6c 6c 28 31 2c 30 29 3a  64 69 72 25 28 49 25 29  |ll(1,0):dir%(I%)|
00008c20  3d 33 3a e7 20 46 25 20  e1 0d 26 84 05 e1 0d 26  |=3:. F% ..&....&|
00008c30  8e 05 3a 0d 26 98 0f dd  f2 66 69 6c 6c 28 78 2c  |..:.&....fill(x,|
00008c40  79 29 0d 26 a2 1d 70 25  3d 41 25 3a e3 4b 25 3d  |y).&..p%=A%:.K%=|
00008c50  32 b8 a9 77 24 3a 70 25  2b 3d 28 78 2b 79 29 0d  |2..w$:p%+=(x+y).|
00008c60  26 ac 37 e7 67 72 69 64  25 28 70 25 29 3c 3e 97  |&.7.grid%(p%)<>.|
00008c70  28 c1 77 24 2c 4b 25 2c  31 29 29 80 20 67 72 69  |(.w$,K%,1)). gri|
00008c80  64 25 28 70 25 29 3c 3e  30 20 4b 25 3d a9 77 24  |d%(p%)<>0 K%=.w$|
00008c90  2b 31 3a ed 3a e1 0d 26  b6 05 ed 0d 26 c0 11 73  |+1:.:..&....&..s|
00008ca0  74 61 72 74 25 28 49 25  29 3d 41 25 0d 26 ca 3b  |tart%(I%)=A%.&.;|
00008cb0  70 25 3d 41 25 3a e3 4b  25 3d 31 b8 a9 77 24 3a  |p%=A%:.K%=1..w$:|
00008cc0  67 72 69 64 25 28 70 25  29 3d 97 28 c1 77 24 2c  |grid%(p%)=.(.w$,|
00008cd0  4b 25 2c 31 29 29 3a 70  25 2b 3d 28 78 2b 79 29  |K%,1)):p%+=(x+y)|
00008ce0  3a ed 3a 46 25 3d 31 0d  26 d4 05 e1 0d 26 de 05  |:.:F%=1.&....&..|
00008cf0  3a 0d 26 e8 0a dd f2 67  61 70 73 0d 26 f2 48 77  |:.&....gaps.&.Hw|
00008d00  73 71 67 61 70 73 3d 30  3a e3 49 25 3d 31 b8 64  |sqgaps=0:.I%=1.d|
00008d10  69 6d 78 2a 64 69 6d 79  3a e7 67 72 69 64 25 28  |imx*dimy:.grid%(|
00008d20  49 25 29 3d 30 20 67 72  69 64 25 28 49 25 29 3d  |I%)=0 grid%(I%)=|
00008d30  b3 28 32 36 29 2b 36 34  3a 77 73 71 67 61 70 73  |.(26)+64:wsqgaps|
00008d40  2b 3d 31 0d 26 fc 2f ed  3a 77 73 71 67 61 70 73  |+=1.&./.:wsqgaps|
00008d50  3d a4 72 6f 75 6e 64 28  28 77 73 71 67 61 70 73  |=.round((wsqgaps|
00008d60  2f 28 64 69 6d 78 2a 64  69 6d 79 29 29 2a 31 30  |/(dimx*dimy))*10|
00008d70  30 29 0d 27 06 05 e1 0d  27 10 05 3a 0d 27 1a 0d  |0).'....'..:.'..|
00008d80  dd f2 66 6f 72 6d 61 74  31 0d 27 24 10 e3 49 25  |..format1.'$..I%|
00008d90  3d 31 b8 77 6f 72 64 73  25 0d 27 2e 29 e7 49 25  |=1.words%.'.).I%|
00008da0  3d 31 20 f2 75 6e 64 65  72 20 8b 20 e7 49 25 3d  |=1 .under . .I%=|
00008db0  64 69 6d 79 2b 31 20 f2  6f 76 65 72 3a e5 8d 44  |dimy+1 .over:..D|
00008dc0  56 67 0d 27 38 50 e7 73  61 76 65 66 6f 72 6d 61  |Vg.'8P.saveforma|
00008dd0  74 24 3d 22 64 72 61 77  22 20 d5 23 66 69 6c 65  |t$="draw" .#file|
00008de0  2c 22 5c 31 22 3b 3a 8b  e7 73 61 76 65 66 6f 72  |,"\1";:..savefor|
00008df0  6d 61 74 24 3d 22 69 6d  70 22 20 d5 23 66 69 6c  |mat$="imp" .#fil|
00008e00  65 2c 22 7b 22 22 47 72  69 64 22 22 20 6f 6e 7d  |e,"{""Grid"" on}|
00008e10  22 3b 0d 27 42 45 e7 49  25 3c 3d 64 69 6d 79 20  |";.'BE.I%<=dimy |
00008e20  f2 70 75 74 28 62 24 28  49 25 29 2c 31 29 3a 8b  |.put(b$(I%),1):.|
00008e30  20 e7 73 61 76 65 66 6f  72 6d 61 74 24 3c 3e 22  | .saveformat$<>"|
00008e40  69 6d 70 22 20 f2 70 75  74 28 a4 70 61 64 28 64  |imp" .put(.pad(d|
00008e50  69 6d 78 29 2c 31 29 0d  27 4c 51 e7 73 61 76 65  |imx),1).'LQ.save|
00008e60  66 6f 72 6d 61 74 24 3d  22 64 72 61 77 22 20 d5  |format$="draw" .|
00008e70  23 66 69 6c 65 2c 22 5c  32 22 3b 3a 8b e7 73 61  |#file,"\2";:..sa|
00008e80  76 65 66 6f 72 6d 61 74  24 3d 22 69 6d 70 22 20  |veformat$="imp" |
00008e90  d5 23 66 69 6c 65 2c 22  7b 22 22 57 6f 72 64 73  |.#file,"{""Words|
00008ea0  22 22 20 6f 6e 7d 22 3b  0d 27 56 13 f2 70 75 74  |"" on}";.'V..put|
00008eb0  28 a4 70 61 64 28 33 29  2c 31 29 0d 27 60 17 f2  |(.pad(3),1).'`..|
00008ec0  70 75 74 28 77 6f 72 64  24 28 49 25 29 2c 30 29  |put(word$(I%),0)|
00008ed0  3a ed 0d 27 6a 2a e7 77  6f 72 64 73 25 3d 64 69  |:..'j*.words%=di|
00008ee0  6d 79 20 f2 6f 76 65 72  3a e1 3a 8b e7 20 77 6f  |my .over:.:.. wo|
00008ef0  72 64 73 25 3e 3d 64 69  6d 79 20 e1 0d 27 74 64  |rds%>=dimy ..'td|
00008f00  e3 49 25 3d 77 6f 72 64  73 25 2b 31 20 b8 20 64  |.I%=words%+1 . d|
00008f10  69 6d 79 3a e7 73 61 76  65 66 6f 72 6d 61 74 24  |imy:.saveformat$|
00008f20  3d 22 64 72 61 77 22 20  d5 23 66 69 6c 65 2c 22  |="draw" .#file,"|
00008f30  5c 31 22 3b 3a 8b e7 73  61 76 65 66 6f 72 6d 61  |\1";:..saveforma|
00008f40  74 24 3d 22 69 6d 70 22  20 d5 23 66 69 6c 65 2c  |t$="imp" .#file,|
00008f50  22 7b 22 22 47 72 69 64  22 22 20 6f 6e 7d 22 3b  |"{""Grid"" on}";|
00008f60  0d 27 7e 14 f2 70 75 74  28 62 24 28 49 25 29 2c  |.'~..put(b$(I%),|
00008f70  30 29 3a ed 0d 27 88 05  e1 0d 27 92 05 e1 0d 27  |0):..'....'....'|
00008f80  9c 05 3a 0d 27 a6 0d dd  f2 66 6f 72 6d 61 74 32  |..:.'....format2|
00008f90  0d 27 b0 4c e7 a8 28 77  6f 72 64 73 25 2f 32 29  |.'.L..(words%/2)|
00008fa0  3c 3e 77 6f 72 64 73 25  2f 32 20 43 31 3d a8 28  |<>words%/2 C1=.(|
00008fb0  77 6f 72 64 73 25 2f 32  29 2b 31 3a 43 32 3d 77  |words%/2)+1:C2=w|
00008fc0  6f 72 64 73 25 2d 43 31  3a 8b 20 43 31 3d 77 6f  |ords%-C1:. C1=wo|
00008fd0  72 64 73 25 2f 32 3a 43  32 3d 43 31 0d 27 ba 0c  |rds%/2:C2=C1.'..|
00008fe0  e3 49 25 3d 31 b8 43 31  0d 27 c4 29 e7 49 25 3d  |.I%=1.C1.'.).I%=|
00008ff0  31 20 f2 75 6e 64 65 72  20 8b 20 e7 49 25 3d 64  |1 .under . .I%=d|
00009000  69 6d 79 2b 31 20 f2 6f  76 65 72 3a e5 8d 64 6c  |imy+1 .over:..dl|
00009010  67 0d 27 ce 51 e7 73 61  76 65 66 6f 72 6d 61 74  |g.'.Q.saveformat|
00009020  24 3d 22 64 72 61 77 22  20 d5 23 66 69 6c 65 2c  |$="draw" .#file,|
00009030  22 5c 31 22 3b 3a 8b 20  e7 73 61 76 65 66 6f 72  |"\1";:. .savefor|
00009040  6d 61 74 24 3d 22 69 6d  70 22 20 d5 23 66 69 6c  |mat$="imp" .#fil|
00009050  65 2c 22 7b 22 22 47 72  69 64 22 22 20 6f 6e 7d  |e,"{""Grid"" on}|
00009060  22 3b 0d 27 d8 45 e7 49  25 3c 3d 64 69 6d 79 20  |";.'.E.I%<=dimy |
00009070  f2 70 75 74 28 62 24 28  49 25 29 2c 31 29 3a 8b  |.put(b$(I%),1):.|
00009080  20 e7 73 61 76 65 66 6f  72 6d 61 74 24 3c 3e 22  | .saveformat$<>"|
00009090  69 6d 70 22 20 f2 70 75  74 28 a4 70 61 64 28 64  |imp" .put(.pad(d|
000090a0  69 6d 78 29 2c 31 29 0d  27 e2 52 e7 73 61 76 65  |imx),1).'.R.save|
000090b0  66 6f 72 6d 61 74 24 3d  22 64 72 61 77 22 20 d5  |format$="draw" .|
000090c0  23 66 69 6c 65 2c 22 5c  32 22 3b 3a 8b 20 e7 73  |#file,"\2";:. .s|
000090d0  61 76 65 66 6f 72 6d 61  74 24 3d 22 69 6d 70 22  |aveformat$="imp"|
000090e0  20 d5 23 66 69 6c 65 2c  22 7b 22 22 57 6f 72 64  | .#file,"{""Word|
000090f0  73 22 22 20 6f 6e 7d 22  3b 0d 27 ec 5c f2 70 75  |s"" on}";.'.\.pu|
00009100  74 28 a4 70 61 64 28 33  29 2c 31 29 3a f2 70 75  |t(.pad(3),1):.pu|
00009110  74 28 77 6f 72 64 24 28  49 25 29 2c 31 29 3a f2  |t(word$(I%),1):.|
00009120  70 75 74 28 a4 70 61 64  28 6c 65 6e 25 2d a9 77  |put(.pad(len%-.w|
00009130  6f 72 64 24 28 49 25 29  2b 31 29 2c 31 29 3a f2  |ord$(I%)+1),1):.|
00009140  70 75 74 28 77 6f 72 64  24 28 43 31 2b 49 25 29  |put(word$(C1+I%)|
00009150  2c 30 29 3a ed 0d 27 f6  22 e7 43 31 3d 64 69 6d  |,0):..'.".C1=dim|
00009160  79 20 f2 6f 76 65 72 3a  e1 3a 8b e7 20 43 31 3e  |y .over:.:.. C1>|
00009170  3d 64 69 6d 79 20 e1 0d  28 00 51 e7 73 61 76 65  |=dimy ..(.Q.save|
00009180  66 6f 72 6d 61 74 24 3d  22 64 72 61 77 22 20 d5  |format$="draw" .|
00009190  23 66 69 6c 65 2c 22 5c  31 22 3b 3a 8b 20 e7 73  |#file,"\1";:. .s|
000091a0  61 76 65 66 6f 72 6d 61  74 24 3d 22 69 6d 70 22  |aveformat$="imp"|
000091b0  20 d5 23 66 69 6c 65 2c  22 7b 22 22 47 72 69 64  | .#file,"{""Grid|
000091c0  22 22 20 6f 6e 7d 22 3b  0d 28 0a 24 e3 49 25 3d  |"" on}";.(.$.I%=|
000091d0  43 31 2b 31 20 b8 20 64  69 6d 79 3a f2 70 75 74  |C1+1 . dimy:.put|
000091e0  28 62 24 28 49 25 29 2c  30 29 3a ed 0d 28 14 09  |(b$(I%),0):..(..|
000091f0  f2 6f 76 65 72 0d 28 1e  05 e1 0d 28 28 05 3a 0d  |.over.(....((.:.|
00009200  28 32 0d dd f2 66 6f 72  6d 61 74 33 0d 28 3c 41  |(2...format3.(<A|
00009210  43 25 3d 77 6f 72 64 73  25 2d 28 28 64 69 6d 79  |C%=words%-((dimy|
00009220  2b 31 29 2a 32 29 3a 44  25 3d 43 25 2b 31 3a f5  |+1)*2):D%=C%+1:.|
00009230  3a 44 25 2d 3d 31 3a fd  a8 28 44 25 2f 34 29 3d  |:D%-=1:..(D%/4)=|
00009240  44 25 2f 34 3a 45 25 3d  43 25 2d 44 25 0d 28 46  |D%/4:E%=C%-D%.(F|
00009250  29 e7 20 45 25 3d 30 3a  45 25 3d 34 3a 43 31 3d  |). E%=0:E%=4:C1=|
00009260  44 25 2f 34 3a 43 32 3d  43 31 3a 43 33 3d 43 31  |D%/4:C2=C1:C3=C1|
00009270  3a 43 34 3d 43 33 0d 28  50 2a e7 20 45 25 3d 31  |:C4=C3.(P*. E%=1|
00009280  3a 43 31 3d 28 44 25 2f  34 29 2b 31 3a 43 32 3d  |:C1=(D%/4)+1:C2=|
00009290  44 25 2f 34 3a 43 33 3d  43 32 3a 43 34 3d 43 33  |D%/4:C3=C2:C4=C3|
000092a0  0d 28 5a 30 e7 20 45 25  3d 32 3a 43 31 3d 28 44  |.(Z0. E%=2:C1=(D|
000092b0  25 2f 34 29 2b 31 3a 43  32 3d 28 44 25 2f 34 29  |%/4)+1:C2=(D%/4)|
000092c0  2b 31 3a 43 33 3d 44 25  2f 34 3a 43 34 3d 43 33  |+1:C3=D%/4:C4=C3|
000092d0  0d 28 64 36 e7 20 45 25  3d 33 3a 43 31 3d 28 44  |.(d6. E%=3:C1=(D|
000092e0  25 2f 34 29 2b 31 3a 43  32 3d 28 44 25 2f 34 29  |%/4)+1:C2=(D%/4)|
000092f0  2b 31 3a 43 33 3d 28 44  25 2f 34 29 2b 31 3a 43  |+1:C3=(D%/4)+1:C|
00009300  34 3d 44 25 2f 34 0d 28  6e 0e e3 49 25 3d 31 b8  |4=D%/4.(n..I%=1.|
00009310  64 69 6d 79 0d 28 78 0f  e7 49 25 3d 31 f2 75 6e  |dimy.(x..I%=1.un|
00009320  64 65 72 0d 28 82 51 e7  73 61 76 65 66 6f 72 6d  |der.(.Q.saveform|
00009330  61 74 24 3d 22 64 72 61  77 22 20 d5 23 66 69 6c  |at$="draw" .#fil|
00009340  65 2c 22 5c 31 22 3b 3a  8b 20 e7 73 61 76 65 66  |e,"\1";:. .savef|
00009350  6f 72 6d 61 74 24 3d 22  69 6d 70 22 20 d5 23 66  |ormat$="imp" .#f|
00009360  69 6c 65 2c 22 7b 22 22  47 72 69 64 22 22 20 6f  |ile,"{""Grid"" o|
00009370  6e 7d 22 3b 0d 28 8c 71  f2 70 75 74 28 62 24 28  |n}";.(.q.put(b$(|
00009380  49 25 29 2c 31 29 3a f2  70 75 74 28 a4 70 61 64  |I%),1):.put(.pad|
00009390  28 33 29 2c 31 29 3a e7  73 61 76 65 66 6f 72 6d  |(3),1):.saveform|
000093a0  61 74 24 3d 22 64 72 61  77 22 20 d5 23 66 69 6c  |at$="draw" .#fil|
000093b0  65 2c 22 5c 32 22 3b 3a  8b 20 e7 73 61 76 65 66  |e,"\2";:. .savef|
000093c0  6f 72 6d 61 74 24 3d 22  69 6d 70 22 20 d5 23 66  |ormat$="imp" .#f|
000093d0  69 6c 65 2c 22 7b 22 22  57 6f 72 64 73 22 22 20  |ile,"{""Words"" |
000093e0  6f 6e 7d 22 3b 0d 28 96  65 f2 70 75 74 28 77 6f  |on}";.(.e.put(wo|
000093f0  72 64 24 28 43 31 2b 43  32 2b 49 25 29 2c 31 29  |rd$(C1+C2+I%),1)|
00009400  3a f2 70 75 74 28 a4 70  61 64 28 6c 65 6e 25 2b  |:.put(.pad(len%+|
00009410  31 2d a9 77 6f 72 64 24  28 43 31 2b 43 32 2b 49  |1-.word$(C1+C2+I|
00009420  25 29 29 2c 31 29 3a f2  70 75 74 28 77 6f 72 64  |%)),1):.put(word|
00009430  24 28 64 69 6d 79 2b 43  31 2b 43 32 2b 43 33 2b  |$(dimy+C1+C2+C3+|
00009440  31 2b 49 25 29 2c 30 29  3a ed 0d 28 a0 51 e7 73  |1+I%),0):..(.Q.s|
00009450  61 76 65 66 6f 72 6d 61  74 24 3d 22 64 72 61 77  |aveformat$="draw|
00009460  22 20 d5 23 66 69 6c 65  2c 22 5c 31 22 3b 3a 8b  |" .#file,"\1";:.|
00009470  20 e7 73 61 76 65 66 6f  72 6d 61 74 24 3d 22 69  | .saveformat$="i|
00009480  6d 70 22 20 d5 23 66 69  6c 65 2c 22 7b 22 22 47  |mp" .#file,"{""G|
00009490  72 69 64 22 22 20 6f 6e  7d 22 3b 0d 28 aa 19 f2  |rid"" on}";.(...|
000094a0  6f 76 65 72 3a f2 70 75  74 28 a4 70 61 64 28 33  |over:.put(.pad(3|
000094b0  29 2c 31 29 0d 28 b4 52  e7 73 61 76 65 66 6f 72  |),1).(.R.savefor|
000094c0  6d 61 74 24 3d 22 64 72  61 77 22 20 d5 23 66 69  |mat$="draw" .#fi|
000094d0  6c 65 2c 22 5c 32 22 3b  3a 8b 20 e7 73 61 76 65  |le,"\2";:. .save|
000094e0  66 6f 72 6d 61 74 24 3d  22 69 6d 70 22 20 d5 23  |format$="imp" .#|
000094f0  66 69 6c 65 2c 22 7b 22  22 57 6f 72 64 73 22 22  |file,"{""Words""|
00009500  20 6f 6e 7d 22 3b 0d 28  be 6d f2 70 75 74 28 77  | on}";.(.m.put(w|
00009510  6f 72 64 24 28 64 69 6d  79 2b 43 31 2b 43 32 2b  |ord$(dimy+C1+C2+|
00009520  31 29 2c 31 29 3a f2 70  75 74 28 a4 70 61 64 28  |1),1):.put(.pad(|
00009530  6c 65 6e 25 2b 31 2d a9  77 6f 72 64 24 28 64 69  |len%+1-.word$(di|
00009540  6d 79 2b 43 31 2b 43 32  2b 31 29 29 2c 31 29 3a  |my+C1+C2+1)),1):|
00009550  f2 70 75 74 28 77 6f 72  64 24 28 64 69 6d 79 2b  |.put(word$(dimy+|
00009560  64 69 6d 79 2b 43 31 2b  43 32 2b 43 33 2b 32 29  |dimy+C1+C2+C3+2)|
00009570  2c 30 29 0d 28 c8 0c e3  49 25 3d 31 b8 43 31 0d  |,0).(...I%=1.C1.|
00009580  28 d2 52 e7 73 61 76 65  66 6f 72 6d 61 74 24 3d  |(.R.saveformat$=|
00009590  22 64 72 61 77 22 20 d5  23 66 69 6c 65 2c 22 5c  |"draw" .#file,"\|
000095a0  32 22 3b 3a 8b 20 e7 73  61 76 65 66 6f 72 6d 61  |2";:. .saveforma|
000095b0  74 24 3d 22 69 6d 70 22  20 d5 23 66 69 6c 65 2c  |t$="imp" .#file,|
000095c0  22 7b 22 22 57 6f 72 64  73 22 22 20 6f 6e 7d 22  |"{""Words"" on}"|
000095d0  3b 0d 28 dc 35 f2 70 75  74 28 77 6f 72 64 24 28  |;.(.5.put(word$(|
000095e0  49 25 29 2c 31 29 3a f2  70 75 74 28 a4 70 61 64  |I%),1):.put(.pad|
000095f0  28 6c 65 6e 25 2b 31 2d  a9 77 6f 72 64 24 28 49  |(len%+1-.word$(I|
00009600  25 29 29 2c 31 29 0d 28  e6 73 e7 49 25 3c 43 31  |%)),1).(.s.I%<C1|
00009610  20 84 20 28 49 25 3d 43  31 20 80 20 45 25 3e 3d  | . (I%=C1 . E%>=|
00009620  32 29 20 f2 70 75 74 28  77 6f 72 64 24 28 43 31  |2) .put(word$(C1|
00009630  2b 49 25 29 2c 31 29 3a  f2 70 75 74 28 a4 70 61  |+I%),1):.put(.pa|
00009640  64 28 64 69 6d 78 2b 33  2d 28 6c 65 6e 25 2b 31  |d(dimx+3-(len%+1|
00009650  2d a9 77 6f 72 64 24 28  49 25 29 2b a9 77 6f 72  |-.word$(I%)+.wor|
00009660  64 24 28 49 25 29 2b a9  77 6f 72 64 24 28 43 31  |d$(I%)+.word$(C1|
00009670  2b 49 25 29 29 29 2c 31  29 0d 28 f0 68 e7 49 25  |+I%))),1).(.h.I%|
00009680  3c 43 31 20 84 20 28 49  25 3d 43 31 20 80 20 45  |<C1 . (I%=C1 . E|
00009690  25 3e 3d 33 29 20 f2 70  75 74 28 77 6f 72 64 24  |%>=3) .put(word$|
000096a0  28 64 69 6d 79 2b 43 31  2b 43 32 2b 31 2b 49 25  |(dimy+C1+C2+1+I%|
000096b0  29 2c 31 29 3a f2 70 75  74 28 a4 70 61 64 28 6c  |),1):.put(.pad(l|
000096c0  65 6e 25 2b 31 2d a9 77  6f 72 64 24 28 64 69 6d  |en%+1-.word$(dim|
000096d0  79 2b 43 31 2b 43 32 2b  31 2b 49 25 29 29 2c 31  |y+C1+C2+1+I%)),1|
000096e0  29 0d 28 fa 43 e7 49 25  3c 43 31 20 84 20 28 49  |).(.C.I%<C1 . (I|
000096f0  25 3d 43 31 20 80 20 45  25 3e 3d 34 29 20 f2 70  |%=C1 . E%>=4) .p|
00009700  75 74 28 77 6f 72 64 24  28 64 69 6d 79 2b 64 69  |ut(word$(dimy+di|
00009710  6d 79 2b 43 31 2b 43 32  2b 43 33 2b 32 2b 49 25  |my+C1+C2+C3+2+I%|
00009720  29 2c 30 29 0d 29 04 05  ed 0d 29 0e 05 e1 0d 29  |),0).)....)....)|
00009730  18 05 3a 0d 29 22 0a dd  f2 74 61 62 73 0d 29 2c  |..:.)"...tabs.),|
00009740  0f 63 61 73 65 25 3d a4  63 61 73 65 0d 29 36 26  |.case%=.case.)6&|
00009750  e7 63 61 73 65 25 3d 30  20 61 3d 32 2e 37 3a 62  |.case%=0 a=2.7:b|
00009760  3d 30 2e 34 34 20 8b 20  61 3d 34 3a 62 3d 30 2e  |=0.44 . a=4:b=0.|
00009770  36 35 0d 29 40 0b c8 8e  20 63 25 20 ca 0d 29 4a  |65.)@... c% ..)J|
00009780  45 c9 20 31 3a 74 31 25  3d 28 64 69 6d 78 2a 28  |E. 1:t1%=(dimx*(|
00009790  33 2e 36 35 2b 28 28 67  72 69 64 70 74 25 2d 36  |3.65+((gridpt%-6|
000097a0  29 2a 30 2e 36 29 29 29  2b 32 32 3a 74 61 62 24  |)*0.6)))+22:tab$|
000097b0  3d 22 74 61 62 73 20 22  2b c3 74 31 25 2b 22 70  |="tabs "+.t1%+"p|
000097c0  74 22 0d 29 54 76 c9 20  32 3a 74 31 25 3d 28 64  |t".)Tv. 2:t1%=(d|
000097d0  69 6d 78 2a 28 33 2e 36  35 2b 28 28 67 72 69 64  |imx*(3.65+((grid|
000097e0  70 74 25 2d 36 29 2a 30  2e 36 29 29 29 2b 32 32  |pt%-6)*0.6)))+22|
000097f0  3a 74 32 25 3d 74 31 25  2b 35 2b 28 6c 65 6e 25  |:t2%=t1%+5+(len%|
00009800  2a 28 61 2b 28 28 77 6f  72 64 73 70 74 25 2d 36  |*(a+((wordspt%-6|
00009810  29 2a 62 29 29 29 3a 74  61 62 24 3d 22 74 61 62  |)*b))):tab$="tab|
00009820  73 20 22 2b c3 74 31 25  2b 22 70 74 2c 22 2b c3  |s "+.t1%+"pt,"+.|
00009830  74 32 25 2b 22 70 74 22  0d 29 5e a5 c9 20 34 3a  |t2%+"pt".)^.. 4:|
00009840  74 31 25 3d 31 35 2b 28  6c 65 6e 25 2a 28 61 2b  |t1%=15+(len%*(a+|
00009850  28 28 77 6f 72 64 73 70  74 25 2d 36 29 2a 62 29  |((wordspt%-6)*b)|
00009860  29 29 3a 74 32 25 3d 28  64 69 6d 78 2a 28 33 2e  |)):t2%=(dimx*(3.|
00009870  36 35 2b 28 28 67 72 69  64 70 74 25 2d 36 29 2a  |65+((gridpt%-6)*|
00009880  30 2e 36 29 29 29 2b 32  32 3a 74 33 25 3d 74 32  |0.6)))+22:t3%=t2|
00009890  25 2b 31 35 2b 28 6c 65  6e 25 2a 28 61 2b 28 28  |%+15+(len%*(a+((|
000098a0  77 6f 72 64 73 70 74 25  2d 36 29 2a 62 29 29 29  |wordspt%-6)*b)))|
000098b0  3a 74 61 62 24 3d 22 74  61 62 73 20 22 2b c3 74  |:tab$="tabs "+.t|
000098c0  31 25 2b 22 70 74 2c 22  2b c3 74 32 25 2b 22 70  |1%+"pt,"+.t2%+"p|
000098d0  74 2c 22 2b c3 74 33 25  2b 22 70 74 22 0d 29 68  |t,"+.t3%+"pt".)h|
000098e0  05 cb 0d 29 72 05 e1 0d  29 7c 05 3a 0d 29 86 0c  |...)r...)|.:.)..|
000098f0  dd f2 68 65 61 64 65 72  0d 29 90 14 c8 8e 20 73  |..header.).... s|
00009900  61 76 65 66 6f 72 6d 61  74 24 20 ca 0d 29 9a 0c  |aveformat$ ..)..|
00009910  c9 20 22 74 65 78 74 22  0d 29 a4 ad c9 20 22 64  |. "text".)... "d|
00009920  72 61 77 22 3a 68 65 61  64 65 72 24 3d 22 5c 21  |raw":header$="\!|
00009930  20 31 22 2b bd 31 30 2b  22 5c 46 20 30 20 22 2b  | 1"+.10+"\F 0 "+|
00009940  74 69 74 6c 65 66 6f 6e  74 24 2b 22 20 22 2b c3  |titlefont$+" "+.|
00009950  74 69 74 6c 65 70 74 25  2b bd 31 30 2b 22 5c 46  |titlept%+.10+"\F|
00009960  20 31 20 22 2b 67 72 69  64 66 6f 6e 74 24 2b 22  | 1 "+gridfont$+"|
00009970  20 22 2b c3 67 72 69 64  70 74 25 2b bd 31 30 2b  | "+.gridpt%+.10+|
00009980  22 5c 46 20 32 20 22 2b  77 6f 72 64 73 66 6f 6e  |"\F 2 "+wordsfon|
00009990  74 24 2b 22 20 22 2b c3  77 6f 72 64 73 70 74 25  |t$+" "+.wordspt%|
000099a0  2b bd 31 30 2b 22 5c 4c  22 2b c3 28 a4 72 6f 75  |+.10+"\L"+.(.rou|
000099b0  6e 64 28 67 72 69 64 70  74 25 2a 31 2e 30 38 29  |nd(gridpt%*1.08)|
000099c0  29 2b bd 31 30 0d 29 ae  39 68 65 61 64 65 72 24  |)+.10.).9header$|
000099d0  2b 3d 22 5c 50 22 2b c3  28 a4 72 6f 75 6e 64 28  |+="\P"+.(.round(|
000099e0  28 67 72 69 64 70 74 25  2a 31 2e 30 38 29 2f 31  |(gridpt%*1.08)/1|
000099f0  2e 37 35 29 29 2b bd 31  30 2b 22 5c 30 22 0d 29  |.75))+.10+"\0".)|
00009a00  b8 12 d5 23 66 69 6c 65  2c 68 65 61 64 65 72 24  |...#file,header$|
00009a10  0d 29 c2 af c9 20 22 69  6d 70 22 3a 68 65 61 64  |.)... "imp":head|
00009a20  65 72 24 3d 22 7b 64 65  66 69 6e 65 20 73 74 79  |er$="{define sty|
00009a30  6c 65 20 22 22 54 69 74  6c 65 22 22 3b 66 6f 6e  |le ""Title"";fon|
00009a40  74 20 22 2b 74 69 74 6c  65 66 6f 6e 74 24 2b 22  |t "+titlefont$+"|
00009a50  3b 66 6f 6e 74 73 69 7a  65 20 22 2b c3 74 69 74  |;fontsize "+.tit|
00009a60  6c 65 70 74 25 2b 22 70  74 3b 22 2b 74 61 62 24  |lept%+"pt;"+tab$|
00009a70  2b 22 7d 7b 64 65 66 69  6e 65 20 73 74 79 6c 65  |+"}{define style|
00009a80  20 22 22 47 72 69 64 22  22 3b 66 6f 6e 74 20 22  | ""Grid"";font "|
00009a90  2b 67 72 69 64 66 6f 6e  74 24 2b 22 3b 66 6f 6e  |+gridfont$+";fon|
00009aa0  74 73 69 7a 65 20 22 2b  c3 67 72 69 64 70 74 25  |tsize "+.gridpt%|
00009ab0  2b 22 70 74 3b 22 2b 74  61 62 24 2b 22 7d 22 0d  |+"pt;"+tab$+"}".|
00009ac0  29 cc 6b 68 65 61 64 65  72 24 2b 3d 22 7b 64 65  |).kheader$+="{de|
00009ad0  66 69 6e 65 20 73 74 79  6c 65 20 22 22 57 6f 72  |fine style ""Wor|
00009ae0  64 73 22 22 3b 66 6f 6e  74 20 22 2b 77 6f 72 64  |ds"";font "+word|
00009af0  73 66 6f 6e 74 24 2b 22  3b 66 6f 6e 74 73 69 7a  |sfont$+";fontsiz|
00009b00  65 20 22 2b c3 77 6f 72  64 73 70 74 25 2b 22 70  |e "+.wordspt%+"p|
00009b10  74 3b 22 2b 74 61 62 24  2b 22 7d 7b 22 22 54 69  |t;"+tab$+"}{""Ti|
00009b20  74 6c 65 22 22 20 6f 6e  7d 22 0d 29 d6 13 d5 23  |tle"" on}".)...#|
00009b30  66 69 6c 65 2c 68 65 61  64 65 72 24 3b 0d 29 e0  |file,header$;.).|
00009b40  05 cb 0d 29 ea 05 e1 0d  29 f4 05 3a 0d 29 fe 0d  |...)....)..:.)..|
00009b50  dd a4 70 61 64 28 64 25  29 0d 2a 08 20 e7 20 73  |..pad(d%).*. . s|
00009b60  61 76 65 66 6f 72 6d 61  74 24 3d 22 69 6d 70 22  |aveformat$="imp"|
00009b70  20 3d 22 7b 74 61 62 7d  22 0d 2a 12 23 e7 20 73  | ="{tab}".*.#. s|
00009b80  61 76 65 66 6f 72 6d 61  74 24 3d 22 64 72 61 77  |aveformat$="draw|
00009b90  22 20 3d c4 64 25 2c bd  31 36 30 29 0d 2a 1c 0d  |" =.d%,.160).*..|
00009ba0  3d c4 64 25 2c 22 20 22  29 0d 2a 26 05 3a 0d 2a  |=.d%," ").*&.:.*|
00009bb0  30 10 dd f2 70 75 74 28  64 24 2c 64 25 29 0d 2a  |0...put(d$,d%).*|
00009bc0  3a 25 e7 73 61 76 65 66  6f 72 6d 61 74 24 3d 22  |:%.saveformat$="|
00009bd0  70 72 69 6e 74 22 20 f1  64 24 3b 3a e7 64 25 3d  |print" .d$;:.d%=|
00009be0  30 20 f1 0d 2a 44 34 e7  73 61 76 65 66 6f 72 6d  |0 ..*D4.saveform|
00009bf0  61 74 24 3c 3e 22 70 72  69 6e 74 22 20 d5 23 66  |at$<>"print" .#f|
00009c00  69 6c 65 2c 64 24 3b 3a  e7 64 25 3d 30 20 d5 23  |ile,d$;:.d%=0 .#|
00009c10  66 69 6c 65 2c 22 22 0d  2a 4e 05 e1 0d 2a 58 05  |file,"".*N...*X.|
00009c20  3a 0d 2a 62 0a dd f2 6f  76 65 72 0d 2a 6c 35 e7  |:.*b...over.*l5.|
00009c30  73 61 76 65 66 6f 72 6d  61 74 24 3d 22 64 72 61  |saveformat$="dra|
00009c40  77 22 20 61 24 3d 22 5c  31 22 3a 62 24 3d a4 70  |w" a$="\1":b$=.p|
00009c50  61 64 28 64 69 6d 78 29  3a 63 24 3d 22 5c 32 22  |ad(dimx):c$="\2"|
00009c60  0d 2a 76 18 e7 73 61 76  65 66 6f 72 6d 61 74 24  |.*v..saveformat$|
00009c70  3d 22 69 6d 70 22 20 8c  0d 2a 80 1c e7 63 25 3d  |="imp" ..*...c%=|
00009c80  34 20 62 24 3d 22 7b 74  61 62 7d 22 20 8b 20 62  |4 b$="{tab}" . b|
00009c90  24 3d 22 22 0d 2a 8a 2a  61 24 3d 22 7b 22 22 47  |$="".*.*a$="{""G|
00009ca0  72 69 64 22 22 20 6f 6e  7d 22 3a 63 24 3d 22 7b  |rid"" on}":c$="{|
00009cb0  22 22 57 6f 72 64 73 22  22 20 6f 6e 7d 22 0d 2a  |""Words"" on}".*|
00009cc0  94 05 cd 0d 2a 9e 31 e7  73 61 76 65 66 6f 72 6d  |....*.1.saveform|
00009cd0  61 74 24 3d 22 74 65 78  74 22 20 61 24 3d 22 22  |at$="text" a$=""|
00009ce0  3a 62 24 3d a4 70 61 64  28 64 69 6d 78 29 3a 63  |:b$=.pad(dimx):c|
00009cf0  24 3d 22 22 0d 2a a8 47  e7 73 61 76 65 66 6f 72  |$="".*.G.savefor|
00009d00  6d 61 74 24 3c 3e 22 70  72 69 6e 74 22 20 84 20  |mat$<>"print" . |
00009d10  6f 76 65 72 6f 6e 24 3d  22 22 20 84 20 6f 76 65  |overon$="" . ove|
00009d20  72 6f 66 66 24 3d 22 22  20 f2 70 75 74 28 61 24  |roff$="" .put(a$|
00009d30  2b 62 24 2b 63 24 2c 31  29 3a e1 0d 2a b2 3b f2  |+b$+c$,1):..*.;.|
00009d40  67 65 74 65 63 68 6f 28  6f 76 65 72 6f 6e 24 29  |getecho(overon$)|
00009d50  3a f2 70 75 74 28 a4 70  61 64 28 64 69 6d 78 29  |:.put(.pad(dimx)|
00009d60  2c 31 29 3a f2 67 65 74  65 63 68 6f 28 6f 76 65  |,1):.getecho(ove|
00009d70  72 6f 66 66 24 29 0d 2a  bc 05 e1 0d 2a c6 05 3a  |roff$).*....*..:|
00009d80  0d 2a d0 0b dd f2 75 6e  64 65 72 0d 2a da 43 e7  |.*....under.*.C.|
00009d90  73 61 76 65 66 6f 72 6d  61 74 24 3c 3e 22 70 72  |saveformat$<>"pr|
00009da0  69 6e 74 22 20 84 20 75  6e 64 65 72 6f 6e 24 3d  |int" . underon$=|
00009db0  22 22 20 84 20 75 6e 64  65 72 6f 66 66 24 3d 22  |"" . underoff$="|
00009dc0  22 20 f2 70 75 74 28 22  22 2c 30 29 3a e1 0d 2a  |" .put("",0):..*|
00009dd0  e4 3d f2 67 65 74 65 63  68 6f 28 75 6e 64 65 72  |.=.getecho(under|
00009de0  6f 6e 24 29 3a f2 70 75  74 28 a4 70 61 64 28 64  |on$):.put(.pad(d|
00009df0  69 6d 78 29 2c 30 29 3a  f2 67 65 74 65 63 68 6f  |imx),0):.getecho|
00009e00  28 75 6e 64 65 72 6f 66  66 24 29 0d 2a ee 05 e1  |(underoff$).*...|
00009e10  0d 2a f8 05 3a 0d 2b 02  09 dd f2 70 72 65 0d 2b  |.*..:.+....pre.+|
00009e20  0c 25 e7 73 61 76 65 66  6f 72 6d 61 74 24 3c 3e  |.%.saveformat$<>|
00009e30  22 70 72 69 6e 74 22 20  84 20 70 72 65 24 3d 22  |"print" . pre$="|
00009e40  22 20 e1 0d 2b 16 12 f2  67 65 74 65 63 68 6f 28  |" ..+...getecho(|
00009e50  70 72 65 24 29 0d 2b 20  05 e1 0d 2b 2a 05 3a 0d  |pre$).+ ...+*.:.|
00009e60  2b 34 0a dd f2 70 6f 73  74 0d 2b 3e 26 e7 73 61  |+4...post.+>&.sa|
00009e70  76 65 66 6f 72 6d 61 74  24 3c 3e 22 70 72 69 6e  |veformat$<>"prin|
00009e80  74 22 20 84 20 70 6f 73  74 24 3d 22 22 20 e1 0d  |t" . post$="" ..|
00009e90  2b 48 13 f2 67 65 74 65  63 68 6f 28 70 6f 73 74  |+H..getecho(post|
00009ea0  24 29 0d 2b 52 05 e1 0d  2b 5c 05 3a 0d 2b 66 10  |$).+R...+\.:.+f.|
00009eb0  dd f2 70 72 69 6e 74 74  69 74 6c 65 0d 2b 70 2a  |..printtitle.+p*|
00009ec0  e7 65 6d 70 68 6f 6e 24  3d 22 22 20 84 20 65 6d  |.emphon$="" . em|
00009ed0  70 68 6f 66 66 24 3d 22  22 20 f1 77 73 71 74 69  |phoff$="" .wsqti|
00009ee0  74 6c 65 24 3a e1 0d 2b  7a 33 f2 67 65 74 65 63  |tle$:..+z3.getec|
00009ef0  68 6f 28 65 6d 70 68 6f  6e 24 29 3a f1 77 73 71  |ho(emphon$):.wsq|
00009f00  74 69 74 6c 65 24 3a f2  67 65 74 65 63 68 6f 28  |title$:.getecho(|
00009f10  65 6d 70 68 6f 66 66 24  29 0d 2b 84 05 e1 0d 2b  |emphoff$).+....+|
00009f20  8e 05 3a 0d 2b 98 11 dd  f2 67 65 74 65 63 68 6f  |..:.+....getecho|
00009f30  28 64 24 29 0d 2b a2 08  64 25 3d 31 0d 2b ac 65  |(d$).+..d%=1.+.e|
00009f40  e3 4b 25 3d 31 b8 a9 64  24 3a 64 75 6d 6d 79 24  |.K%=1..d$:dummy$|
00009f50  3d 22 22 3a e7 c1 64 24  2c 4b 25 2c 31 29 3d 22  |="":..d$,K%,1)="|
00009f60  2c 22 20 64 75 6d 6d 79  24 3d c1 64 24 2c 64 25  |," dummy$=.d$,d%|
00009f70  2c 4b 25 2d 64 25 29 3a  64 25 3d 4b 25 2b 31 3a  |,K%-d%):d%=K%+1:|
00009f80  8b 20 e7 20 4b 25 3d a9  64 24 20 64 75 6d 6d 79  |. . K%=.d$ dummy|
00009f90  24 3d c1 64 24 2c 64 25  2c 4b 25 2d 64 25 2b 31  |$=.d$,d%,K%-d%+1|
00009fa0  29 0d 2b b6 1d e7 64 75  6d 6d 79 24 3c 3e 22 22  |).+...dummy$<>""|
00009fb0  20 f1 bd 31 3b bd bb 64  75 6d 6d 79 24 3b 0d 2b  | ..1;..dummy$;.+|
00009fc0  c0 05 ed 0d 2b ca 05 e1  0d 2b d4 05 3a 0d 2b de  |....+....+..:.+.|
00009fd0  0f dd f2 63 61 72 65 74  28 63 25 29 0d 2b e8 51  |...caret(c%).+.Q|
00009fe0  e7 63 25 3e 31 30 30 30  20 80 20 73 6f 6c 76 65  |.c%>1000 . solve|
00009ff0  77 69 6e 64 25 20 63 25  2d 3d 31 30 30 30 3a f2  |wind% c%-=1000:.|
0000a000  49 63 6f 6e 43 61 72 65  74 28 73 6f 6c 76 65 5f  |IconCaret(solve_|
0000a010  57 69 6e 64 6f 77 25 2c  31 37 2c 63 25 29 3a e1  |Window%,17,c%):.|
0000a020  20 8b 20 e7 63 25 3e 31  30 30 30 20 e1 0d 2b f2  | . .c%>1000 ..+.|
0000a030  2f e7 73 6f 6c 76 65 77  69 6e 64 25 20 f2 49 63  |/.solvewind% .Ic|
0000a040  6f 6e 43 61 72 65 74 28  73 6f 6c 76 65 5f 57 69  |onCaret(solve_Wi|
0000a050  6e 64 6f 77 25 2c 31 37  2c 63 25 29 0d 2b fc 44  |ndow%,17,c%).+.D|
0000a060  e7 6d 61 69 6e 77 69 6e  64 25 20 80 20 73 6f 6c  |.mainwind% . sol|
0000a070  76 65 66 6f 72 6d 61 74  24 3c 3e 22 74 65 78 74  |veformat$<>"text|
0000a080  22 20 f2 49 63 6f 6e 43  61 72 65 74 28 6d 61 69  |" .IconCaret(mai|
0000a090  6e 5f 57 69 6e 64 6f 77  25 2c 32 36 2c 63 25 29  |n_Window%,26,c%)|
0000a0a0  0d 2c 06 05 e1 0d 2c 10  05 3a 0d 2c 1a 11 dd a4  |.,....,..:.,....|
0000a0b0  6e 65 77 28 65 78 74 72  61 24 29 0d 2c 24 66 6d  |new(extra$).,$fm|
0000a0c0  65 73 73 61 67 65 24 3d  22 59 6f 75 20 68 61 76  |essage$="You hav|
0000a0d0  65 20 6e 6f 74 20 73 61  76 65 64 20 79 6f 75 72  |e not saved your|
0000a0e0  20 22 3a e7 77 6f 72 64  73 73 61 76 65 64 25 3d  | ":.wordssaved%=|
0000a0f0  30 20 6d 65 73 73 61 67  65 24 2b 3d 22 77 6f 72  |0 message$+="wor|
0000a100  64 73 22 3a e7 67 72 69  64 73 61 76 65 64 25 3d  |ds":.gridsaved%=|
0000a110  30 20 6d 65 73 73 61 67  65 24 2b 3d 22 20 6f 72  |0 message$+=" or|
0000a120  22 0d 2c 2e 36 e7 67 72  69 64 73 61 76 65 64 25  |".,.6.gridsaved%|
0000a130  3d 30 20 6d 65 73 73 61  67 65 24 2b 3d 22 20 67  |=0 message$+=" g|
0000a140  72 69 64 2e 20 22 20 8b  20 6d 65 73 73 61 67 65  |rid. " . message|
0000a150  24 2b 3d 22 2e 20 22 0d  2c 38 34 6d 65 73 73 61  |$+=". ".,84messa|
0000a160  67 65 24 2b 3d 22 41 72  65 20 79 6f 75 20 73 75  |ge$+="Are you su|
0000a170  72 65 20 79 6f 75 20 77  61 6e 74 20 74 6f 20 22  |re you want to "|
0000a180  2b 65 78 74 72 61 24 2b  22 3f 22 0d 2c 42 2d e7  |+extra$+"?".,B-.|
0000a190  77 6f 72 64 73 73 61 76  65 64 25 3d 31 20 80 20  |wordssaved%=1 . |
0000a1a0  67 72 69 64 73 61 76 65  64 25 3d 31 20 6d 65 73  |gridsaved%=1 mes|
0000a1b0  73 61 67 65 24 3d 22 22  0d 2c 4c 39 e7 20 6d 65  |sage$="".,L9. me|
0000a1c0  73 73 61 67 65 24 3c 3e  22 22 3a e7 a4 57 69 6e  |ssage$<>"":..Win|
0000a1d0  64 6f 77 43 61 6e 63 65  6c 28 22 57 6f 72 64 53  |dowCancel("WordS|
0000a1e0  71 22 2c 6d 65 73 73 61  67 65 24 29 3d 30 20 3d  |q",message$)=0 =|
0000a1f0  30 0d 2c 56 06 3d 31 0d  2c 60 05 3a 0d 2c 6a 0b  |0.,V.=1.,`.:.,j.|
0000a200  dd f2 72 65 73 65 74 0d  2c 74 14 c8 99 22 48 6f  |..reset.,t..."Ho|
0000a210  75 72 67 6c 61 73 73 5f  4f 6e 22 0d 2c 7e 0d f2  |urglass_On".,~..|
0000a220  63 6c 6f 73 65 61 6c 6c  0d 2c 88 4d 73 65 6c 65  |closeall.,.Msele|
0000a230  63 74 69 6f 6e 25 3d 30  3a 77 6f 72 64 24 28 29  |ction%=0:word$()|
0000a240  3d 22 22 3a 67 72 69 64  25 28 29 3d 30 3a 73 74  |="":grid%()=0:st|
0000a250  61 72 74 25 28 29 3d 30  3a 64 69 72 25 28 29 3d  |art%()=0:dir%()=|
0000a260  30 3a 6c 65 6e 25 28 29  3d 30 3a f2 73 65 74 62  |0:len%()=0:.setb|
0000a270  75 74 74 6f 6e 0d 2c 92  44 77 6f 72 64 73 25 3d  |utton.,.Dwords%=|
0000a280  30 3a 67 61 70 73 3d 32  35 3a 64 69 6d 78 3d 30  |0:gaps=25:dimx=0|
0000a290  3a 64 69 6d 79 3d 30 3a  73 6f 6c 76 65 66 6f 72  |:dimy=0:solvefor|
0000a2a0  6d 61 74 24 3d 22 22 3a  68 69 67 68 25 3d 30 3a  |mat$="":high%=0:|
0000a2b0  73 68 6f 77 25 28 29 3d  30 0d 2c 9c 3c 73 78 25  |show%()=0.,.<sx%|
0000a2c0  28 29 3d 30 3a 73 79 25  28 29 3d 30 3a 65 78 25  |()=0:sy%()=0:ex%|
0000a2d0  28 29 3d 30 3a 65 79 25  28 29 3d 30 3a 73 68 6f  |()=0:ey%()=0:sho|
0000a2e0  77 25 3d 30 3a 66 6f 75  6e 64 25 3d 30 3a 64 6f  |w%=0:found%=0:do|
0000a2f0  6e 65 25 3d 30 0d 2c a6  4c 77 73 71 78 3d 30 3a  |ne%=0.,.Lwsqx=0:|
0000a300  77 73 71 79 3d 30 3a 77  73 71 77 6f 72 64 73 25  |wsqy=0:wsqwords%|
0000a310  3d 30 3a 77 6f 72 64 73  73 61 76 65 64 25 3d 31  |=0:wordssaved%=1|
0000a320  3a 67 72 69 64 73 61 76  65 64 25 3d 31 3a 73 74  |:gridsaved%=1:st|
0000a330  61 72 74 78 25 3d 30 3a  73 74 61 72 74 79 25 3d  |artx%=0:starty%=|
0000a340  30 0d 2c b0 31 f7 3a e3  49 25 3d 31 b8 31 30 3a  |0.,.1.:.I%=1.10:|
0000a350  f3 64 25 3a f2 49 63 6f  6e 45 6e 61 62 6c 65 28  |.d%:.IconEnable(|
0000a360  6d 61 69 6e 5f 57 69 6e  64 6f 77 25 2c 64 25 29  |main_Window%,d%)|
0000a370  3a ed 0d 2c ba 63 f2 49  63 6f 6e 50 75 74 54 65  |:..,.c.IconPutTe|
0000a380  78 74 28 6d 61 69 6e 5f  57 69 6e 64 6f 77 25 2c  |xt(main_Window%,|
0000a390  35 2c 22 4e 6f 20 77 6f  72 64 73 20 65 6e 74 65  |5,"No words ente|
0000a3a0  72 65 64 2e 22 29 3a f2  49 63 6f 6e 50 75 74 54  |red."):.IconPutT|
0000a3b0  65 78 74 28 6d 61 69 6e  5f 57 69 6e 64 6f 77 25  |ext(main_Window%|
0000a3c0  2c 36 2c 22 4e 6f 20 67  72 69 64 20 66 6f 72 6d  |,6,"No grid form|
0000a3d0  65 64 2e 22 29 0d 2c c4  6f f2 49 63 6f 6e 50 75  |ed.").,.o.IconPu|
0000a3e0  74 54 65 78 74 28 6d 61  69 6e 5f 57 69 6e 64 6f  |tText(main_Windo|
0000a3f0  77 25 2c 31 32 2c c3 64  69 6d 78 29 3a f2 49 63  |w%,12,.dimx):.Ic|
0000a400  6f 6e 50 75 74 54 65 78  74 28 6d 61 69 6e 5f 57  |onPutText(main_W|
0000a410  69 6e 64 6f 77 25 2c 31  36 2c c3 64 69 6d 79 29  |indow%,16,.dimy)|
0000a420  3a f2 49 63 6f 6e 50 75  74 54 65 78 74 28 6d 61  |:.IconPutText(ma|
0000a430  69 6e 5f 57 69 6e 64 6f  77 25 2c 32 30 2c c3 67  |in_Window%,20,.g|
0000a440  61 70 73 29 0d 2c ce 87  f2 49 63 6f 6e 50 75 74  |aps).,...IconPut|
0000a450  54 65 78 74 28 73 6f 6c  76 65 5f 57 69 6e 64 6f  |Text(solve_Windo|
0000a460  77 25 2c 35 2c 22 4e 6f  20 77 6f 72 64 73 71 75  |w%,5,"No wordsqu|
0000a470  61 72 65 20 63 75 72 72  65 6e 74 6c 79 20 61 76  |are currently av|
0000a480  61 69 6c 61 62 6c 65 2e  22 29 3a f2 49 63 6f 6e  |ailable."):.Icon|
0000a490  50 75 74 54 65 78 74 28  73 6f 6c 76 65 5f 57 69  |PutText(solve_Wi|
0000a4a0  6e 64 6f 77 25 2c 36 2c  22 4e 6f 20 77 6f 72 64  |ndow%,6,"No word|
0000a4b0  73 20 61 76 61 69 6c 61  62 6c 65 20 2d 20 4e 6f  |s available - No|
0000a4c0  6e 65 20 73 68 6f 77 6e  2e 22 29 0d 2c d8 70 f2  |ne shown.").,.p.|
0000a4d0  49 63 6f 6e 50 75 74 54  65 78 74 28 6d 61 69 6e  |IconPutText(main|
0000a4e0  5f 57 69 6e 64 6f 77 25  2c 32 36 2c 22 22 29 3a  |_Window%,26,""):|
0000a4f0  f2 49 63 6f 6e 50 75 74  54 65 78 74 28 73 6f 6c  |.IconPutText(sol|
0000a500  76 65 5f 57 69 6e 64 6f  77 25 2c 31 37 2c 22 22  |ve_Window%,17,""|
0000a510  29 3a f2 49 63 6f 6e 50  75 74 54 65 78 74 28 6d  |):.IconPutText(m|
0000a520  61 69 6e 5f 57 69 6e 64  6f 77 25 2c 39 2c 22 3c  |ain_Window%,9,"<|
0000a530  55 6e 74 69 74 6c 65 64  3e 22 29 0d 2c e2 90 e3  |Untitled>").,...|
0000a540  49 25 3d 34 20 b8 20 31  37 31 3a f2 49 63 6f 6e  |I%=4 . 171:.Icon|
0000a550  50 75 74 54 65 78 74 28  77 6f 72 64 73 5f 57 69  |PutText(words_Wi|
0000a560  6e 64 6f 77 25 2c 49 25  2c 22 22 29 3a f2 73 69  |ndow%,I%,""):.si|
0000a570  63 28 77 6f 72 64 73 5f  57 69 6e 64 6f 77 25 2c  |c(words_Window%,|
0000a580  49 25 2c 37 29 3a e7 73  65 6c 65 63 74 65 64 25  |I%,7):.selected%|
0000a590  28 49 25 2d 33 29 3d 31  20 73 65 6c 65 63 74 65  |(I%-3)=1 selecte|
0000a5a0  64 25 28 49 25 2d 33 29  3d 30 3a f2 53 65 74 49  |d%(I%-3)=0:.SetI|
0000a5b0  63 6f 6e 28 77 6f 72 64  73 5f 57 69 6e 64 6f 77  |con(words_Window|
0000a5c0  25 2c 49 25 29 3a ed 3a  8b 20 ed 0d 2c ec 07 f2  |%,I%):.:. ..,...|
0000a5d0  77 77 0d 2c f6 5d e7 77  6f 72 64 73 77 69 6e 64  |ww.,.].wordswind|
0000a5e0  25 3d 31 20 f2 4d 65 6e  75 54 69 63 6b 28 64 69  |%=1 .MenuTick(di|
0000a5f0  73 70 6c 61 79 5f 4d 65  6e 75 25 2c 32 29 3a f2  |splay_Menu%,2):.|
0000a600  4d 65 6e 75 54 69 63 6b  28 6d 61 69 6e 5f 4d 65  |MenuTick(main_Me|
0000a610  6e 75 25 2c 32 29 3a f2  4d 65 6e 75 54 69 63 6b  |nu%,2):.MenuTick|
0000a620  28 73 6f 6c 76 65 5f 4d  65 6e 75 25 2c 32 29 0d  |(solve_Menu%,2).|
0000a630  2d 00 8d f2 4d 65 6e 75  44 69 73 61 62 6c 65 28  |-...MenuDisable(|
0000a640  6d 61 69 6e 5f 4d 65 6e  75 25 2c 32 29 3a f2 4d  |main_Menu%,2):.M|
0000a650  65 6e 75 44 69 73 61 62  6c 65 28 6d 61 69 6e 5f  |enuDisable(main_|
0000a660  4d 65 6e 75 25 2c 33 29  3a f2 4d 65 6e 75 44 69  |Menu%,3):.MenuDi|
0000a670  73 61 62 6c 65 28 6d 61  69 6e 5f 4d 65 6e 75 25  |sable(main_Menu%|
0000a680  2c 34 29 3a f2 4d 65 6e  75 44 69 73 61 62 6c 65  |,4):.MenuDisable|
0000a690  28 6d 61 69 6e 5f 4d 65  6e 75 25 2c 35 29 3a f2  |(main_Menu%,5):.|
0000a6a0  4d 65 6e 75 44 69 73 61  62 6c 65 28 64 69 73 70  |MenuDisable(disp|
0000a6b0  6c 61 79 5f 4d 65 6e 75  25 2c 32 29 0d 2d 0a 1f  |lay_Menu%,2).-..|
0000a6c0  f2 4d 65 6e 75 44 69 73  61 62 6c 65 28 73 6f 6c  |.MenuDisable(sol|
0000a6d0  76 65 5f 4d 65 6e 75 25  2c 32 29 0d 2d 14 1f f2  |ve_Menu%,2).-...|
0000a6e0  4d 65 6e 75 44 69 73 61  62 6c 65 28 77 6f 72 64  |MenuDisable(word|
0000a6f0  73 5f 4d 65 6e 75 25 2c  32 29 0d 2d 1e 36 73 65  |s_Menu%,2).-.6se|
0000a700  6c 65 63 74 65 64 25 28  29 3d 30 3a 6d 61 69 6e  |lected%()=0:main|
0000a710  77 69 6e 64 25 3d 30 3a  73 6f 6c 76 65 77 69 6e  |wind%=0:solvewin|
0000a720  64 25 3d 30 3a 64 69 73  70 77 69 6e 64 25 3d 30  |d%=0:dispwind%=0|
0000a730  0d 2d 28 15 c8 99 22 48  6f 75 72 67 6c 61 73 73  |.-(..."Hourglass|
0000a740  5f 4f 66 66 22 0d 2d 32  05 e1 0d 2d 3c 05 3a 0d  |_Off".-2...-<.:.|
0000a750  2d 46 08 dd f2 6e 67 0d  2d 50 43 67 72 69 64 25  |-F...ng.-PCgrid%|
0000a760  28 29 3d 30 3a 73 74 61  72 74 25 28 29 3d 30 3a  |()=0:start%()=0:|
0000a770  64 69 72 25 28 29 3d 30  3a 73 6f 6c 76 65 66 6f  |dir%()=0:solvefo|
0000a780  72 6d 61 74 24 3d 22 22  3a 68 69 67 68 25 3d 30  |rmat$="":high%=0|
0000a790  3a 73 68 6f 77 25 28 29  3d 30 0d 2d 5a 43 77 73  |:show%()=0.-ZCws|
0000a7a0  71 78 3d 30 3a 77 73 71  79 3d 30 3a 77 73 71 77  |qx=0:wsqy=0:wsqw|
0000a7b0  6f 72 64 73 25 3d 30 3a  67 72 69 64 73 61 76 65  |ords%=0:gridsave|
0000a7c0  64 25 3d 31 3a 73 68 6f  77 25 3d 30 3a 66 6f 75  |d%=1:show%=0:fou|
0000a7d0  6e 64 25 3d 30 3a 64 6f  6e 65 25 3d 30 0d 2d 64  |nd%=0:done%=0.-d|
0000a7e0  32 f2 49 63 6f 6e 50 75  74 54 65 78 74 28 6d 61  |2.IconPutText(ma|
0000a7f0  69 6e 5f 57 69 6e 64 6f  77 25 2c 36 2c 22 4e 6f  |in_Window%,6,"No|
0000a800  20 67 72 69 64 20 66 6f  72 6d 65 64 2e 22 29 0d  | grid formed.").|
0000a810  2d 6e 87 f2 49 63 6f 6e  50 75 74 54 65 78 74 28  |-n..IconPutText(|
0000a820  73 6f 6c 76 65 5f 57 69  6e 64 6f 77 25 2c 35 2c  |solve_Window%,5,|
0000a830  22 4e 6f 20 77 6f 72 64  73 71 75 61 72 65 20 63  |"No wordsquare c|
0000a840  75 72 72 65 6e 74 6c 79  20 61 76 61 69 6c 61 62  |urrently availab|
0000a850  6c 65 2e 22 29 3a f2 49  63 6f 6e 50 75 74 54 65  |le."):.IconPutTe|
0000a860  78 74 28 73 6f 6c 76 65  5f 57 69 6e 64 6f 77 25  |xt(solve_Window%|
0000a870  2c 36 2c 22 4e 6f 20 77  6f 72 64 73 20 61 76 61  |,6,"No words ava|
0000a880  69 6c 61 62 6c 65 20 2d  20 4e 6f 6e 65 20 73 68  |ilable - None sh|
0000a890  6f 77 6e 2e 22 29 0d 2d  78 54 f2 4d 65 6e 75 44  |own.").-xT.MenuD|
0000a8a0  69 73 61 62 6c 65 28 6d  61 69 6e 5f 4d 65 6e 75  |isable(main_Menu|
0000a8b0  25 2c 34 29 3a f2 4d 65  6e 75 44 69 73 61 62 6c  |%,4):.MenuDisabl|
0000a8c0  65 28 6d 61 69 6e 5f 4d  65 6e 75 25 2c 35 29 3a  |e(main_Menu%,5):|
0000a8d0  f2 4d 65 6e 75 44 69 73  61 62 6c 65 28 6d 61 69  |.MenuDisable(mai|
0000a8e0  6e 5f 4d 65 6e 75 25 2c  36 29 0d 2d 82 28 e3 49  |n_Menu%,6).-.(.I|
0000a8f0  25 3d 34 b8 31 37 31 3a  f2 73 69 63 28 77 6f 72  |%=4.171:.sic(wor|
0000a900  64 73 5f 57 69 6e 64 6f  77 25 2c 49 25 2c 37 29  |ds_Window%,I%,7)|
0000a910  3a ed 0d 2d 8c 37 e7 5a  25 3d 31 20 c8 99 22 48  |:..-.7.Z%=1 .."H|
0000a920  6f 75 72 67 6c 61 73 73  5f 4f 6e 22 3a f2 73 6f  |ourglass_On":.so|
0000a930  72 74 28 31 29 3a c8 99  22 48 6f 75 72 67 6c 61  |rt(1):.."Hourgla|
0000a940  73 73 5f 4f 66 66 22 3a  e1 0d 2d 96 19 67 61 70  |ss_Off":..-..gap|
0000a950  73 3d 32 35 3a 64 69 6d  78 3d 30 3a 64 69 6d 79  |s=25:dimx=0:dimy|
0000a960  3d 30 0d 2d a0 27 f2 49  63 6f 6e 50 75 74 54 65  |=0.-.'.IconPutTe|
0000a970  78 74 28 6d 61 69 6e 5f  57 69 6e 64 6f 77 25 2c  |xt(main_Window%,|
0000a980  32 30 2c c3 67 61 70 73  29 0d 2d aa 05 e1 0d 2d  |20,.gaps).-....-|
0000a990  b4 05 3a 0d 2d be 0e dd  f2 63 6c 6f 73 65 61 6c  |..:.-....closeal|
0000a9a0  6c 0d 2d c8 90 f2 57 69  6e 64 6f 77 43 6c 6f 73  |l.-...WindowClos|
0000a9b0  65 28 64 69 73 70 6c 61  79 5f 57 69 6e 64 6f 77  |e(display_Window|
0000a9c0  25 29 3a f2 57 69 6e 64  6f 77 43 6c 6f 73 65 28  |%):.WindowClose(|
0000a9d0  6d 61 69 6e 5f 57 69 6e  64 6f 77 25 29 3a f2 57  |main_Window%):.W|
0000a9e0  69 6e 64 6f 77 43 6c 6f  73 65 28 73 6f 6c 76 65  |indowClose(solve|
0000a9f0  5f 57 69 6e 64 6f 77 25  29 3a f2 57 69 6e 64 6f  |_Window%):.Windo|
0000aa00  77 43 6c 6f 73 65 28 77  6f 72 64 73 5f 57 69 6e  |wClose(words_Win|
0000aa10  64 6f 77 25 29 3a f2 57  69 6e 64 6f 77 43 6c 6f  |dow%):.WindowClo|
0000aa20  73 65 28 70 72 65 66 73  5f 57 69 6e 64 6f 77 25  |se(prefs_Window%|
0000aa30  29 0d 2d d2 29 77 6f 72  64 73 77 69 6e 64 25 3d  |).-.)wordswind%=|
0000aa40  30 3a 73 6f 6c 76 65 77  69 6e 64 25 3d 30 3a 64  |0:solvewind%=0:d|
0000aa50  69 73 70 77 69 6e 64 25  3d 30 0d 2d dc 05 e1 0d  |ispwind%=0.-....|
0000aa60  2d e6 05 3a 0d 2d f0 0d  dd f2 64 69 73 70 6c 61  |-..:.-....displa|
0000aa70  79 0d 2d fa 36 64 75 6d  6d 79 25 3d 30 3a e3 49  |y.-.6dummy%=0:.I|
0000aa80  25 3d 31 b8 64 69 6d 79  3a 64 75 6d 6d 79 24 3d  |%=1.dimy:dummy$=|
0000aa90  22 22 3a e3 4a 25 3d 31  b8 64 69 6d 78 3a 64 75  |"":.J%=1.dimx:du|
0000aaa0  6d 6d 79 25 2b 3d 31 0d  2e 04 32 64 75 6d 6d 79  |mmy%+=1...2dummy|
0000aab0  24 2b 3d bd 28 67 72 69  64 25 28 64 75 6d 6d 79  |$+=.(grid%(dummy|
0000aac0  25 29 29 3a e7 4a 25 3c  3e 64 69 6d 78 20 64 75  |%)):.J%<>dimx du|
0000aad0  6d 6d 79 24 2b 3d 22 20  22 0d 2e 0e 2a ed 3a e7  |mmy$+=" "...*.:.|
0000aae0  a9 64 75 6d 6d 79 24 3c  37 39 20 64 75 6d 6d 79  |.dummy$<79 dummy|
0000aaf0  24 2b 3d c4 37 39 2d a9  64 75 6d 6d 79 24 2c 22  |$+=.79-.dummy$,"|
0000ab00  20 22 29 0d 2e 18 2f f2  49 63 6f 6e 50 75 74 54  | ").../.IconPutT|
0000ab10  65 78 74 28 64 69 73 70  6c 61 79 5f 57 69 6e 64  |ext(display_Wind|
0000ab20  6f 77 25 2c 49 25 2b 31  2c 64 75 6d 6d 79 24 29  |ow%,I%+1,dummy$)|
0000ab30  3a ed 0d 2e 22 48 e7 64  69 6d 79 3c 36 30 20 e3  |:..."H.dimy<60 .|
0000ab40  49 25 3d 64 69 6d 79 2b  31 b8 36 30 3a f2 49 63  |I%=dimy+1.60:.Ic|
0000ab50  6f 6e 50 75 74 54 65 78  74 28 64 69 73 70 6c 61  |onPutText(displa|
0000ab60  79 5f 57 69 6e 64 6f 77  25 2c 49 25 2b 31 2c c4  |y_Window%,I%+1,.|
0000ab70  37 39 2c 22 20 22 29 29  3a ed 0d 2e 2c 3b f2 72  |79," ")):...,;.r|
0000ab80  65 73 69 7a 65 28 64 69  73 70 6c 61 79 5f 57 69  |esize(display_Wi|
0000ab90  6e 64 6f 77 25 2c 30 2c  2d 38 34 2d 28 64 69 6d  |ndow%,0,-84-(dim|
0000aba0  79 2a 34 34 29 2c 35 34  2b 28 64 69 6d 78 2a 33  |y*44),54+(dimx*3|
0000abb0  32 29 2c 30 29 0d 2e 36  05 e1 0d 2e 40 05 3a 0d  |2),0)..6....@.:.|
0000abc0  2e 4a 16 dd f2 75 70 64  61 74 65 73 6f 6c 76 65  |.J...updatesolve|
0000abd0  73 74 61 74 65 0d 2e 54  15 c8 8e 20 73 6f 6c 76  |state..T... solv|
0000abe0  65 66 6f 72 6d 61 74 24  20 ca 0d 2e 5e 0b c9 20  |eformat$ ...^.. |
0000abf0  22 6f 77 6e 22 0d 2e 68  96 77 6f 72 64 73 74 61  |"own"..h.wordsta|
0000ac00  74 75 73 24 3d a4 6f 6e  65 6f 72 6d 6f 72 65 28  |tus$=.oneormore(|
0000ac10  77 73 71 77 6f 72 64 73  25 29 2b 22 69 6e 20 74  |wsqwords%)+"in t|
0000ac20  68 65 20 67 72 69 64 20  2d 20 22 2b a4 6e 6f 6e  |he grid - "+.non|
0000ac30  65 28 68 69 67 68 25 29  2b 22 73 68 6f 77 6e 20  |e(high%)+"shown |
0000ac40  2d 20 22 2b a4 6e 6f 6e  65 28 73 65 6c 65 63 74  |- "+.none(select|
0000ac50  69 6f 6e 25 29 2b 22 73  65 6c 65 63 74 65 64 2e  |ion%)+"selected.|
0000ac60  22 3a f2 49 63 6f 6e 50  75 74 54 65 78 74 28 73  |":.IconPutText(s|
0000ac70  6f 6c 76 65 5f 57 69 6e  64 6f 77 25 2c 36 2c 77  |olve_Window%,6,w|
0000ac80  6f 72 64 73 74 61 74 75  73 24 29 0d 2e 72 76 77  |ordstatus$)..rvw|
0000ac90  6f 72 64 73 74 61 74 75  73 24 3d a4 6f 6e 65 6f  |ordstatus$=.oneo|
0000aca0  72 6d 6f 72 65 28 77 6f  72 64 73 25 29 2b 22 65  |rmore(words%)+"e|
0000acb0  6e 74 65 72 65 64 20 2d  20 22 2b a4 6e 6f 6e 65  |ntered - "+.none|
0000acc0  28 73 65 6c 65 63 74 69  6f 6e 25 29 2b 22 73 65  |(selection%)+"se|
0000acd0  6c 65 63 74 65 64 2e 22  3a f2 49 63 6f 6e 50 75  |lected.":.IconPu|
0000ace0  74 54 65 78 74 28 6d 61  69 6e 5f 57 69 6e 64 6f  |tText(main_Windo|
0000acf0  77 25 2c 35 2c 77 6f 72  64 73 74 61 74 75 73 24  |w%,5,wordstatus$|
0000ad00  29 0d 2e 7c 0c c9 20 22  74 65 78 74 22 0d 2e 86  |)..|.. "text"...|
0000ad10  96 77 6f 72 64 73 74 61  74 75 73 24 3d a4 6f 6e  |.wordstatus$=.on|
0000ad20  65 6f 72 6d 6f 72 65 28  77 73 71 77 6f 72 64 73  |eormore(wsqwords|
0000ad30  25 29 2b 22 69 6e 20 74  68 65 20 67 72 69 64 20  |%)+"in the grid |
0000ad40  2d 20 22 2b a4 6e 6f 6e  65 28 68 69 67 68 25 29  |- "+.none(high%)|
0000ad50  2b 22 73 68 6f 77 6e 20  2d 20 22 2b a4 6e 6f 6e  |+"shown - "+.non|
0000ad60  65 28 73 65 6c 65 63 74  69 6f 6e 25 29 2b 22 73  |e(selection%)+"s|
0000ad70  65 6c 65 63 74 65 64 2e  22 3a f2 49 63 6f 6e 50  |elected.":.IconP|
0000ad80  75 74 54 65 78 74 28 73  6f 6c 76 65 5f 57 69 6e  |utText(solve_Win|
0000ad90  64 6f 77 25 2c 36 2c 77  6f 72 64 73 74 61 74 75  |dow%,6,wordstatu|
0000ada0  73 24 29 0d 2e 90 77 77  6f 72 64 73 74 61 74 75  |s$)...wwordstatu|
0000adb0  73 24 3d a4 6f 6e 65 6f  72 6d 6f 72 65 28 77 73  |s$=.oneormore(ws|
0000adc0  71 77 6f 72 64 73 25 29  2b 22 66 6f 75 6e 64 20  |qwords%)+"found |
0000add0  2d 20 22 2b a4 6e 6f 6e  65 28 73 65 6c 65 63 74  |- "+.none(select|
0000ade0  69 6f 6e 25 29 2b 22 73  65 6c 65 63 74 65 64 2e  |ion%)+"selected.|
0000adf0  22 3a f2 49 63 6f 6e 50  75 74 54 65 78 74 28 6d  |":.IconPutText(m|
0000ae00  61 69 6e 5f 57 69 6e 64  6f 77 25 2c 35 2c 77 6f  |ain_Window%,5,wo|
0000ae10  72 64 73 74 61 74 75 73  24 29 0d 2e 9a 08 c9 20  |rdstatus$)..... |
0000ae20  22 22 0d 2e a4 76 77 6f  72 64 73 74 61 74 75 73  |""...vwordstatus|
0000ae30  24 3d a4 6f 6e 65 6f 72  6d 6f 72 65 28 77 6f 72  |$=.oneormore(wor|
0000ae40  64 73 25 29 2b 22 65 6e  74 65 72 65 64 20 2d 20  |ds%)+"entered - |
0000ae50  22 2b a4 6e 6f 6e 65 28  73 65 6c 65 63 74 69 6f  |"+.none(selectio|
0000ae60  6e 25 29 2b 22 73 65 6c  65 63 74 65 64 2e 22 3a  |n%)+"selected.":|
0000ae70  f2 49 63 6f 6e 50 75 74  54 65 78 74 28 6d 61 69  |.IconPutText(mai|
0000ae80  6e 5f 57 69 6e 64 6f 77  25 2c 35 2c 77 6f 72 64  |n_Window%,5,word|
0000ae90  73 74 61 74 75 73 24 29  0d 2e ae 05 cb 0d 2e b8  |status$)........|
0000aea0  05 e1 0d 2e c2 05 3a 0d  2e cc 0f dd f2 73 65 74  |......:......set|
0000aeb0  62 75 74 74 6f 6e 0d 2e  d6 2e e7 73 65 6c 65 63  |button.....selec|
0000aec0  74 69 6f 6e 25 3c 32 20  64 24 3d 22 20 57 6f 72  |tion%<2 d$=" Wor|
0000aed0  64 22 20 8b 20 64 24 3d  22 20 53 65 6c 65 63 74  |d" . d$=" Select|
0000aee0  69 6f 6e 22 0d 2e e0 2d  f2 49 63 6f 6e 50 75 74  |ion"...-.IconPut|
0000aef0  54 65 78 74 28 6d 61 69  6e 5f 57 69 6e 64 6f 77  |Text(main_Window|
0000af00  25 2c 32 35 2c 22 44 65  6c 65 74 65 22 2b 64 24  |%,25,"Delete"+d$|
0000af10  29 0d 2e ea 2d f2 49 63  6f 6e 50 75 74 54 65 78  |)...-.IconPutTex|
0000af20  74 28 73 6f 6c 76 65 5f  57 69 6e 64 6f 77 25 2c  |t(solve_Window%,|
0000af30  38 2c 22 52 65 6d 6f 76  65 22 2b 64 24 29 0d 2e  |8,"Remove"+d$)..|
0000af40  f4 2b f2 49 63 6f 6e 50  75 74 54 65 78 74 28 73  |.+.IconPutText(s|
0000af50  6f 6c 76 65 5f 57 69 6e  64 6f 77 25 2c 39 2c 22  |olve_Window%,9,"|
0000af60  53 68 6f 77 22 2b 64 24  29 0d 2e fe 05 e1 0d 2f  |Show"+d$)....../|
0000af70  08 05 3a 0d 2f 12 0e dd  f2 66 69 6e 64 28 64 24  |..:./....find(d$|
0000af80  29 0d 2f 1c 14 c8 99 22  48 6f 75 72 67 6c 61 73  |)./...."Hourglas|
0000af90  73 5f 4f 6e 22 0d 2f 26  11 77 24 3d a4 73 74 72  |s_On"./&.w$=.str|
0000afa0  69 70 28 64 24 29 0d 2f  30 14 46 25 3d 30 3a 49  |ip(d$)./0.F%=0:I|
0000afb0  25 3d 77 6f 72 64 73 25  2b 31 0d 2f 3a 13 e3 41  |%=words%+1./:..A|
0000afc0  25 3d 31 b8 64 69 6d 78  2a 64 69 6d 79 0d 2f 44  |%=1.dimx*dimy./D|
0000afd0  2f c8 99 22 48 6f 75 72  67 6c 61 73 73 5f 50 65  |/.."Hourglass_Pe|
0000afe0  72 63 65 6e 74 61 67 65  22 2c 41 25 2f 28 64 69  |rcentage",A%/(di|
0000aff0  6d 78 2a 64 69 6d 79 29  2a 31 30 30 0d 2f 4e 20  |mx*dimy)*100./N |
0000b000  e7 67 72 69 64 25 28 41  25 29 3d 97 c0 64 24 2c  |.grid%(A%)=..d$,|
0000b010  31 29 20 f2 6e 65 78 74  73 74 65 70 0d 2f 58 05  |1) .nextstep./X.|
0000b020  ed 0d 2f 62 15 c8 99 22  48 6f 75 72 67 6c 61 73  |../b..."Hourglas|
0000b030  73 5f 4f 66 66 22 0d 2f  6c 63 e7 46 25 3d 30 20  |s_Off"./lc.F%=0 |
0000b040  f2 41 6c 65 72 74 28 22  57 6f 72 64 53 71 22 2c  |.Alert("WordSq",|
0000b050  22 54 68 65 20 77 6f 72  64 20 27 22 2b 64 24 2b  |"The word '"+d$+|
0000b060  22 27 20 64 6f 65 73 20  6e 6f 74 20 65 78 69 73  |"' does not exis|
0000b070  74 20 69 6e 20 74 68 65  20 63 75 72 72 65 6e 74  |t in the current|
0000b080  6c 79 20 6c 6f 61 64 65  64 20 77 6f 72 64 73 71  |ly loaded wordsq|
0000b090  75 61 72 65 2e 22 29 3a  e1 0d 2f 76 80 e7 46 25  |uare."):../v..F%|
0000b0a0  3e 31 20 80 20 a4 70 61  6c 69 6e 64 72 6f 6d 65  |>1 . .palindrome|
0000b0b0  28 64 24 29 3d 30 20 f2  41 6c 65 72 74 28 22 57  |(d$)=0 .Alert("W|
0000b0c0  6f 72 64 53 71 22 2c 22  4d 6f 72 65 20 74 68 61  |ordSq","More tha|
0000b0d0  6e 20 6f 6e 65 20 6f 63  63 75 72 72 65 6e 63 65  |n one occurrence|
0000b0e0  20 6f 66 20 22 2b 67 69  62 62 65 74 24 2b 22 20  | of "+gibbet$+" |
0000b0f0  68 61 73 20 62 65 65 6e  20 66 6f 75 6e 64 2c 20  |has been found, |
0000b100  73 6f 20 69 74 20 77 69  6c 6c 20 62 65 20 69 67  |so it will be ig|
0000b110  6e 6f 72 65 64 22 29 3a  e1 0d 2f 80 14 c8 99 22  |nored"):../...."|
0000b120  48 6f 75 72 67 6c 61 73  73 5f 4f 6e 22 0d 2f 8a  |Hourglass_On"./.|
0000b130  39 64 24 3d a4 49 63 6f  6e 54 65 78 74 28 73 6f  |9d$=.IconText(so|
0000b140  6c 76 65 5f 57 69 6e 64  6f 77 25 2c 31 37 29 3a  |lve_Window%,17):|
0000b150  e7 63 61 70 73 25 3d 2d  31 20 64 24 3d a4 63 61  |.caps%=-1 d$=.ca|
0000b160  70 73 28 64 24 29 0d 2f  94 6c 77 6f 72 64 73 25  |ps(d$)./.lwords%|
0000b170  2b 3d 31 3a 77 73 71 77  6f 72 64 73 25 2b 3d 31  |+=1:wsqwords%+=1|
0000b180  3a 77 6f 72 64 24 28 77  6f 72 64 73 25 29 3d 64  |:word$(words%)=d|
0000b190  24 3a 6c 65 6e 25 28 77  6f 72 64 73 25 29 3d a4  |$:len%(words%)=.|
0000b1a0  6c 65 6e 28 64 24 29 3a  64 69 72 25 28 77 6f 72  |len(d$):dir%(wor|
0000b1b0  64 73 25 29 3d 64 25 3a  6e 65 65 64 73 25 3d c6  |ds%)=d%:needs%=.|
0000b1c0  8e 6c 65 6e 25 28 29 3a  67 61 70 73 3d a4 67 61  |.len%():gaps=.ga|
0000b1d0  70 73 0d 2f 9e 23 f2 70  6f 73 69 74 69 6f 6e 73  |ps./.#.positions|
0000b1e0  28 77 6f 72 64 73 25 2c  64 69 72 25 28 77 6f 72  |(words%,dir%(wor|
0000b1f0  64 73 25 29 29 0d 2f a8  5f 68 69 67 68 25 2b 3d  |ds%))./._high%+=|
0000b200  31 3a 73 68 6f 77 25 28  77 6f 72 64 73 25 29 3d  |1:show%(words%)=|
0000b210  31 3a f2 73 6f 72 74 28  31 29 3a e3 49 25 3d 31  |1:.sort(1):.I%=1|
0000b220  b8 77 6f 72 64 73 25 3a  f2 49 63 6f 6e 50 75 74  |.words%:.IconPut|
0000b230  54 65 78 74 28 77 6f 72  64 73 5f 57 69 6e 64 6f  |Text(words_Windo|
0000b240  77 25 2c 49 25 2b 33 2c  77 6f 72 64 24 28 49 25  |w%,I%+3,word$(I%|
0000b250  29 29 3a ed 0d 2f b2 07  f2 77 77 0d 2f bc 19 6e  |)):../...ww./..n|
0000b260  65 65 64 25 3d 31 3a 77  6f 72 64 73 73 61 76 65  |eed%=1:wordssave|
0000b270  64 25 3d 30 0d 2f c6 15  c8 99 22 48 6f 75 72 67  |d%=0./...."Hourg|
0000b280  6c 61 73 73 5f 4f 66 66  22 0d 2f d0 05 e1 0d 2f  |lass_Off"./..../|
0000b290  da 05 3a 0d 2f e4 0e dd  f2 6e 65 78 74 73 74 65  |..:./....nextste|
0000b2a0  70 0d 2f ee 12 f2 65 6e  64 73 3a 4c 25 3d a9 64  |p./...ends:L%=.d|
0000b2b0  24 2d 31 0d 2f f8 3f e7  41 25 2d 4c 25 3e 3d 6d  |$-1./.?.A%-L%>=m|
0000b2c0  77 25 80 41 25 2d 28 64  69 6d 78 2a 4c 25 29 3e  |w%.A%-(dimx*L%)>|
0000b2d0  3d 31 3a 64 69 72 25 28  49 25 29 3d 38 3a f2 67  |=1:dir%(I%)=8:.g|
0000b2e0  65 74 73 74 72 69 6e 67  28 2d 31 2c 2d 64 69 6d  |etstring(-1,-dim|
0000b2f0  78 29 0d 30 02 46 e7 41  25 2d 4c 25 3e 3d 6d 77  |x).0.F.A%-L%>=mw|
0000b300  25 80 41 25 2b 28 64 69  6d 78 2a 4c 25 29 3c 3d  |%.A%+(dimx*L%)<=|
0000b310  64 69 6d 78 2a 64 69 6d  79 3a 64 69 72 25 28 49  |dimx*dimy:dir%(I|
0000b320  25 29 3d 36 3a f2 67 65  74 73 74 72 69 6e 67 28  |%)=6:.getstring(|
0000b330  2d 31 2c 64 69 6d 78 29  0d 30 0c 47 e7 41 25 2b  |-1,dimx).0.G.A%+|
0000b340  4c 25 3c 3d 6d 65 25 20  80 20 41 25 2b 28 64 69  |L%<=me% . A%+(di|
0000b350  6d 78 2a 4c 25 29 3c 3d  64 69 6d 78 2a 64 69 6d  |mx*L%)<=dimx*dim|
0000b360  79 3a 64 69 72 25 28 49  25 29 3d 34 3a f2 67 65  |y:dir%(I%)=4:.ge|
0000b370  74 73 74 72 69 6e 67 28  31 2c 64 69 6d 78 29 0d  |tstring(1,dimx).|
0000b380  30 16 40 e7 41 25 2b 4c  25 3c 3d 6d 65 25 20 80  |0.@.A%+L%<=me% .|
0000b390  20 41 25 2d 28 64 69 6d  78 2a 4c 25 29 3e 3d 31  | A%-(dimx*L%)>=1|
0000b3a0  3a 64 69 72 25 28 49 25  29 3d 32 3a f2 67 65 74  |:dir%(I%)=2:.get|
0000b3b0  73 74 72 69 6e 67 28 31  2c 2d 64 69 6d 78 29 0d  |string(1,-dimx).|
0000b3c0  30 20 2b e7 41 25 2d 4c  25 3e 3d 6d 77 25 3a 64  |0 +.A%-L%>=mw%:d|
0000b3d0  69 72 25 28 49 25 29 3d  37 3a f2 67 65 74 73 74  |ir%(I%)=7:.getst|
0000b3e0  72 69 6e 67 28 2d 31 2c  30 29 0d 30 2a 33 e7 41  |ring(-1,0).0*3.A|
0000b3f0  25 2d 28 64 69 6d 78 2a  4c 25 29 3e 3d 31 3a 64  |%-(dimx*L%)>=1:d|
0000b400  69 72 25 28 49 25 29 3d  31 3a f2 67 65 74 73 74  |ir%(I%)=1:.getst|
0000b410  72 69 6e 67 28 30 2c 2d  64 69 6d 78 29 0d 30 34  |ring(0,-dimx).04|
0000b420  3a e7 41 25 2b 28 64 69  6d 78 2a 4c 25 29 3c 3d  |:.A%+(dimx*L%)<=|
0000b430  64 69 6d 78 2a 64 69 6d  79 3a 64 69 72 25 28 49  |dimx*dimy:dir%(I|
0000b440  25 29 3d 35 3a f2 67 65  74 73 74 72 69 6e 67 28  |%)=5:.getstring(|
0000b450  30 2c 64 69 6d 78 29 0d  30 3e 2a e7 41 25 2b 4c  |0,dimx).0>*.A%+L|
0000b460  25 3c 3d 6d 65 25 3a 64  69 72 25 28 49 25 29 3d  |%<=me%:dir%(I%)=|
0000b470  33 3a f2 67 65 74 73 74  72 69 6e 67 28 31 2c 30  |3:.getstring(1,0|
0000b480  29 0d 30 48 05 e1 0d 30  52 05 3a 0d 30 5c 14 dd  |).0H...0R.:.0\..|
0000b490  f2 67 65 74 73 74 72 69  6e 67 28 78 2c 79 29 0d  |.getstring(x,y).|
0000b4a0  30 66 3e 64 75 6d 6d 79  24 3d c0 64 24 2c 31 29  |0f>dummy$=.d$,1)|
0000b4b0  3a 70 25 3d 41 25 3a e3  4a 25 3d 32 b8 a9 64 24  |:p%=A%:.J%=2..d$|
0000b4c0  3a 70 25 2b 3d 78 2b 79  3a 64 75 6d 6d 79 24 2b  |:p%+=x+y:dummy$+|
0000b4d0  3d bd 67 72 69 64 25 28  70 25 29 3a ed 0d 30 70  |=.grid%(p%):..0p|
0000b4e0  2f e7 20 64 75 6d 6d 79  24 3d 64 24 20 46 25 2b  |/. dummy$=d$ F%+|
0000b4f0  3d 31 3a 73 74 61 72 74  25 28 49 25 29 3d 41 25  |=1:start%(I%)=A%|
0000b500  3a 64 25 3d 64 69 72 25  28 49 25 29 0d 30 7a 05  |:d%=dir%(I%).0z.|
0000b510  e1 0d 30 84 05 3a 0d 30  8e 10 dd a4 65 78 69 73  |..0..:.0....exis|
0000b520  74 73 28 64 24 29 0d 30  98 14 c8 99 22 48 6f 75  |ts(d$).0...."Hou|
0000b530  72 67 6c 61 73 73 5f 4f  6e 22 0d 30 a2 39 65 25  |rglass_On".0.9e%|
0000b540  3d 30 3a e3 57 25 3d 31  b8 77 6f 72 64 73 25 3a  |=0:.W%=1.words%:|
0000b550  e7 20 64 24 3d a4 73 74  72 69 70 28 a4 63 61 70  |. d$=.strip(.cap|
0000b560  73 28 77 6f 72 64 24 28  57 25 29 29 29 20 65 25  |s(word$(W%))) e%|
0000b570  3d 57 25 0d 30 ac 05 ed  0d 30 b6 15 c8 99 22 48  |=W%.0....0...."H|
0000b580  6f 75 72 67 6c 61 73 73  5f 4f 66 66 22 0d 30 c0  |ourglass_Off".0.|
0000b590  07 3d 65 25 0d 30 ca 05  3a 0d 30 d4 14 dd a4 70  |.=e%.0..:.0....p|
0000b5a0  61 6c 69 6e 64 72 6f 6d  65 28 6f 24 29 0d 30 de  |alindrome(o$).0.|
0000b5b0  2f 64 75 6d 6d 79 24 3d  22 22 3a e3 6f 25 3d a9  |/dummy$="":.o%=.|
0000b5c0  6f 24 b8 31 20 88 2d 31  3a 64 75 6d 6d 79 24 2b  |o$.1 .-1:dummy$+|
0000b5d0  3d c1 6f 24 2c 6f 25 2c  31 29 3a ed 0d 30 e8 16  |=.o$,o%,1):..0..|
0000b5e0  e7 6f 24 3d 64 75 6d 6d  79 24 20 3d 31 20 8b 20  |.o$=dummy$ =1 . |
0000b5f0  3d 30 0d 30 f2 05 3a 0d  30 fc 0e dd f2 63 6f 70  |=0.0..:.0....cop|
0000b600  79 6f 76 65 72 0d 31 06  0e 74 65 6d 70 24 28 29  |yover.1..temp$()|
0000b610  3d 22 22 0d 31 10 24 e3  49 25 3d 31 b8 77 6f 72  |="".1.$.I%=1.wor|
0000b620  64 73 25 3a 74 65 6d 70  24 28 49 25 29 3d 77 6f  |ds%:temp$(I%)=wo|
0000b630  72 64 24 28 49 25 29 0d  31 1a 2d e7 73 74 61 72  |rd$(I%).1.-.star|
0000b640  74 25 28 49 25 29 3d 30  20 80 20 64 69 72 25 28  |t%(I%)=0 . dir%(|
0000b650  49 25 29 3d 30 20 77 6f  72 64 24 28 49 25 29 3d  |I%)=0 word$(I%)=|
0000b660  22 7e 7e 22 0d 31 24 16  ed 3a f2 73 6f 72 74 28  |"~~".1$..:.sort(|
0000b670  32 29 3a f2 72 65 70 28  31 29 0d 31 2e 05 e1 0d  |2):.rep(1).1....|
0000b680  31 38 05 3a 0d 31 42 0e  dd f2 63 6f 70 79 62 61  |18.:.1B...copyba|
0000b690  63 6b 0d 31 4c 0e 77 6f  72 64 24 28 29 3d 22 22  |ck.1L.word$()=""|
0000b6a0  0d 31 56 28 e3 49 25 3d  31 b8 77 6f 72 64 73 25  |.1V(.I%=1.words%|
0000b6b0  3a c8 94 74 65 6d 70 24  28 49 25 29 2c 77 6f 72  |:..temp$(I%),wor|
0000b6c0  64 24 28 49 25 29 3a ed  0d 31 60 05 e1 0d 31 6a  |d$(I%):..1`...1j|
0000b6d0  05 3a 0d 31 74 0e dd f2  61 75 74 6f 6c 6f 61 64  |.:.1t...autoload|
0000b6e0  0d 31 7e 17 c8 99 20 22  4f 53 5f 47 65 74 45 6e  |.1~... "OS_GetEn|
0000b6f0  76 22 20 b8 20 64 24 0d  31 88 12 64 24 3d c2 64  |v" . d$.1..d$=.d|
0000b700  24 2c a9 64 24 2d 32 30  29 0d 31 92 1b c8 95 20  |$,.d$-20).1.... |
0000b710  c0 64 24 2c 31 29 3c 3e  22 20 22 20 80 20 a9 64  |.d$,1)<>" " . .d|
0000b720  24 3c 3e 30 0d 31 9c 11  64 24 3d c2 64 24 2c a9  |$<>0.1..d$=.d$,.|
0000b730  64 24 2d 31 29 0d 31 a6  05 ce 0d 31 b0 11 e7 64  |d$-1).1....1...d|
0000b740  24 3d 22 20 22 20 64 24  3d 22 22 0d 31 ba 05 e1  |$=" " d$="".1...|
0000b750  0d 31 c4 05 3a 0d 31 ce  12 dd f2 63 72 6f 73 73  |.1..:.1....cross|
0000b760  6f 75 74 28 64 25 29 0d  31 d8 38 78 70 6f 73 25  |out(d%).1.8xpos%|
0000b770  3d 78 5f 6f 72 69 67 69  6e 25 2b 31 34 3a 79 70  |=x_origin%+14:yp|
0000b780  6f 73 25 3d 79 5f 6f 72  69 67 69 6e 25 2d 28 28  |os%=y_origin%-((|
0000b790  64 25 2d 32 29 2a 33 36  29 2d 32 35 32 2b 36 0d  |d%-2)*36)-252+6.|
0000b7a0  31 e2 2f ec 20 78 70 6f  73 25 2c 79 70 6f 73 25  |1./. xpos%,ypos%|
0000b7b0  3a df 20 78 70 6f 73 25  2b 28 6c 65 6e 25 28 64  |:. xpos%+(len%(d|
0000b7c0  25 29 2a 31 36 29 2b 32  2c 79 70 6f 73 25 0d 31  |%)*16)+2,ypos%.1|
0000b7d0  ec 05 e1 0d 31 f6 05 3a  0d 32 00 13 dd f2 73 69  |....1..:.2....si|
0000b7e0  63 28 77 25 2c 69 25 2c  63 25 29 0d 32 0a 3a 21  |c(w%,i%,c%).2.:!|
0000b7f0  77 69 6d 70 25 3d 77 25  3a 77 69 6d 70 25 21 34  |wimp%=w%:wimp%!4|
0000b800  3d 69 25 3a 77 69 6d 70  25 21 38 3d 63 25 3c 3c  |=i%:wimp%!8=c%<<|
0000b810  32 34 3a 77 69 6d 70 25  21 31 32 3d 26 30 46 30  |24:wimp%!12=&0F0|
0000b820  30 30 30 30 30 0d 32 14  21 c8 99 22 57 69 6d 70  |00000.2.!.."Wimp|
0000b830  5f 53 65 74 49 63 6f 6e  53 74 61 74 65 22 2c 30  |_SetIconState",0|
0000b840  2c 77 69 6d 70 25 0d 32  1e 05 e1 0d 32 28 05 3a  |,wimp%.2....2(.:|
0000b850  0d 32 32 13 dd f2 73 69  62 28 77 25 2c 69 25 2c  |.22...sib(w%,i%,|
0000b860  63 25 29 0d 32 3c 3a 21  77 69 6d 70 25 3d 77 25  |c%).2<:!wimp%=w%|
0000b870  3a 77 69 6d 70 25 21 34  3d 69 25 3a 77 69 6d 70  |:wimp%!4=i%:wimp|
0000b880  25 21 38 3d 63 25 3c 3c  32 38 3a 77 69 6d 70 25  |%!8=c%<<28:wimp%|
0000b890  21 31 32 3d 26 46 30 30  30 30 30 30 30 0d 32 46  |!12=&F0000000.2F|
0000b8a0  21 c8 99 22 57 69 6d 70  5f 53 65 74 49 63 6f 6e  |!.."Wimp_SetIcon|
0000b8b0  53 74 61 74 65 22 2c 30  2c 77 69 6d 70 25 0d 32  |State",0,wimp%.2|
0000b8c0  50 05 e1 0d 32 5a 05 3a  0d 32 64 20 dd a4 67 65  |P...2Z.:.2d ..ge|
0000b8d0  74 77 6f 72 64 28 73 74  61 72 74 70 6f 73 25 2c  |tword(startpos%,|
0000b8e0  65 6e 64 70 6f 73 25 29  0d 32 6e 46 41 25 3d 73  |endpos%).2nFA%=s|
0000b8f0  74 61 72 74 70 6f 73 25  3a c8 94 77 73 71 78 2c  |tartpos%:..wsqx,|
0000b900  64 69 6d 78 3a c8 94 77  73 71 79 2c 64 69 6d 79  |dimx:..wsqy,dimy|
0000b910  3a f2 65 6e 64 73 3a c8  94 77 73 71 78 2c 64 69  |:.ends:..wsqx,di|
0000b920  6d 78 3a c8 94 77 73 71  79 2c 64 69 6d 79 0d 32  |mx:..wsqy,dimy.2|
0000b930  78 2c 73 63 6f 6c 25 3d  73 74 61 72 74 70 6f 73  |x,scol%=startpos|
0000b940  25 83 77 73 71 78 3a e7  73 63 6f 6c 25 3d 30 20  |%.wsqx:.scol%=0 |
0000b950  73 63 6f 6c 25 3d 77 73  71 78 0d 32 82 2a 65 63  |scol%=wsqx.2.*ec|
0000b960  6f 6c 25 3d 65 6e 64 70  6f 73 25 83 77 73 71 78  |ol%=endpos%.wsqx|
0000b970  3a e7 65 63 6f 6c 25 3d  30 20 65 63 6f 6c 25 3d  |:.ecol%=0 ecol%=|
0000b980  77 73 71 78 0d 32 8c 37  73 72 6f 77 25 3d 28 28  |wsqx.2.7srow%=((|
0000b990  73 74 61 72 74 70 6f 73  25 2d 31 29 81 77 73 71  |startpos%-1).wsq|
0000b9a0  78 29 3a 65 72 6f 77 25  3d 28 28 65 6e 64 70 6f  |x):erow%=((endpo|
0000b9b0  73 25 2d 31 29 81 77 73  71 78 29 0d 32 96 34 e7  |s%-1).wsqx).2.4.|
0000b9c0  73 72 6f 77 25 3e 65 72  6f 77 25 20 80 20 73 63  |srow%>erow% . sc|
0000b9d0  6f 6c 25 3d 65 63 6f 6c  25 20 64 78 25 3d 30 3a  |ol%=ecol% dx%=0:|
0000b9e0  64 79 25 3d 2d 77 73 71  78 3a e5 8d 64 66 72 0d  |dy%=-wsqx:..dfr.|
0000b9f0  32 a0 34 e7 73 72 6f 77  25 3e 65 72 6f 77 25 20  |2.4.srow%>erow% |
0000ba00  80 20 73 63 6f 6c 25 3c  65 63 6f 6c 25 20 64 78  |. scol%<ecol% dx|
0000ba10  25 3d 31 3a 64 79 25 3d  2d 77 73 71 78 3a e5 8d  |%=1:dy%=-wsqx:..|
0000ba20  64 66 72 0d 32 aa 30 e7  73 72 6f 77 25 3d 65 72  |dfr.2.0.srow%=er|
0000ba30  6f 77 25 20 80 20 73 63  6f 6c 25 3c 65 63 6f 6c  |ow% . scol%<ecol|
0000ba40  25 20 64 78 25 3d 31 3a  64 79 25 3d 30 3a e5 8d  |% dx%=1:dy%=0:..|
0000ba50  64 66 72 0d 32 b4 33 e7  73 72 6f 77 25 3c 65 72  |dfr.2.3.srow%<er|
0000ba60  6f 77 25 20 80 20 73 63  6f 6c 25 3c 65 63 6f 6c  |ow% . scol%<ecol|
0000ba70  25 20 64 78 25 3d 31 3a  64 79 25 3d 77 73 71 78  |% dx%=1:dy%=wsqx|
0000ba80  3a e5 8d 64 66 72 0d 32  be 33 e7 73 72 6f 77 25  |:..dfr.2.3.srow%|
0000ba90  3c 65 72 6f 77 25 20 80  20 73 63 6f 6c 25 3d 65  |<erow% . scol%=e|
0000baa0  63 6f 6c 25 20 64 78 25  3d 30 3a 64 79 25 3d 77  |col% dx%=0:dy%=w|
0000bab0  73 71 78 3a e5 8d 64 66  72 0d 32 c8 34 e7 73 72  |sqx:..dfr.2.4.sr|
0000bac0  6f 77 25 3c 65 72 6f 77  25 20 80 20 73 63 6f 6c  |ow%<erow% . scol|
0000bad0  25 3e 65 63 6f 6c 25 20  64 78 25 3d 2d 31 3a 64  |%>ecol% dx%=-1:d|
0000bae0  79 25 3d 77 73 71 78 3a  e5 8d 64 66 72 0d 32 d2  |y%=wsqx:..dfr.2.|
0000baf0  31 e7 73 72 6f 77 25 3d  65 72 6f 77 25 20 80 20  |1.srow%=erow% . |
0000bb00  73 63 6f 6c 25 3e 65 63  6f 6c 25 20 64 78 25 3d  |scol%>ecol% dx%=|
0000bb10  2d 31 3a 64 79 25 3d 30  3a e5 8d 64 66 72 0d 32  |-1:dy%=0:..dfr.2|
0000bb20  dc 2f e7 73 72 6f 77 25  3e 65 72 6f 77 25 20 80  |./.srow%>erow% .|
0000bb30  20 73 63 6f 6c 25 3e 65  63 6f 6c 25 20 64 78 25  | scol%>ecol% dx%|
0000bb40  3d 2d 31 3a 64 79 25 3d  2d 77 73 71 78 0d 32 e6  |=-1:dy%=-wsqx.2.|
0000bb50  1f 64 75 6d 6d 79 24 3d  22 22 3a 70 25 3d 73 74  |.dummy$="":p%=st|
0000bb60  61 72 74 70 6f 73 25 3a  6f 25 3d 30 0d 32 f0 05  |artpos%:o%=0.2..|
0000bb70  f5 0d 32 fa 16 64 75 6d  6d 79 24 2b 3d bd 67 72  |..2..dummy$+=.gr|
0000bb80  69 64 25 28 70 25 29 0d  33 04 0f 70 25 2b 3d 64  |id%(p%).3..p%+=d|
0000bb90  78 25 2b 64 79 25 0d 33  0e 2d e7 70 25 3d 65 6e  |x%+dy%.3.-.p%=en|
0000bba0  64 70 6f 73 25 20 6f 25  3d 31 3a 64 75 6d 6d 79  |dpos% o%=1:dummy|
0000bbb0  24 2b 3d bd 67 72 69 64  25 28 70 25 29 3a 70 25  |$+=.grid%(p%):p%|
0000bbc0  3d 2d 31 0d 33 18 1b fd  20 70 25 3c 30 20 84 20  |=-1.3... p%<0 . |
0000bbd0  70 25 3e 28 77 73 71 78  2a 77 73 71 79 29 0d 33  |p%>(wsqx*wsqy).3|
0000bbe0  22 2f e7 6f 25 3d 31 20  80 a9 64 75 6d 6d 79 24  |"/.o%=1 ..dummy$|
0000bbf0  3c 31 39 20 80 20 a9 64  75 6d 6d 79 24 3e 32 20  |<19 . .dummy$>2 |
0000bc00  3d 64 75 6d 6d 79 24 20  8b 20 3d 22 22 0d 33 2c  |=dummy$ . ="".3,|
0000bc10  05 3a 0d 33 36 0f dd a4  73 74 72 69 70 28 6f 24  |.:.36...strip(o$|
0000bc20  29 0d 33 40 4b 63 24 3d  a4 63 61 70 73 28 6f 24  |).3@Kc$=.caps(o$|
0000bc30  29 3a 6f 25 3d a9 63 24  3a 6f 24 3d 22 22 3a e3  |):o%=.c$:o$="":.|
0000bc40  4a 25 3d 31 b8 6f 25 3a  65 24 3d c1 63 24 2c 4a  |J%=1.o%:e$=.c$,J|
0000bc50  25 2c 31 29 3a e7 65 24  3c 3d 22 5a 22 80 65 24  |%,1):.e$<="Z".e$|
0000bc60  3e 3d 22 41 22 20 6f 24  2b 3d 65 24 0d 33 4a 05  |>="A" o$+=e$.3J.|
0000bc70  ed 0d 33 54 07 3d 6f 24  0d 33 5e 05 3a 0d 33 68  |..3T.=o$.3^.:.3h|
0000bc80  18 dd f2 70 6f 73 69 74  69 6f 6e 73 28 64 25 2c  |...positions(d%,|
0000bc90  64 69 72 25 29 0d 33 72  3f e7 73 74 61 72 74 25  |dir%).3r?.start%|
0000bca0  28 64 25 29 83 77 73 71  78 3d 30 20 78 70 6f 73  |(d%).wsqx=0 xpos|
0000bcb0  25 3d 77 73 71 78 2d 31  20 8b 20 78 70 6f 73 25  |%=wsqx-1 . xpos%|
0000bcc0  3d 28 73 74 61 72 74 25  28 64 25 29 83 77 73 71  |=(start%(d%).wsq|
0000bcd0  78 29 2d 31 0d 33 7c 1b  79 70 6f 73 25 3d 28 73  |x)-1.3|.ypos%=(s|
0000bce0  74 61 72 74 25 28 64 25  29 81 77 73 71 78 29 0d  |tart%(d%).wsqx).|
0000bcf0  33 86 30 e7 73 74 61 72  74 25 28 64 25 29 2f 77  |3.0.start%(d%)/w|
0000bd00  73 71 78 3d a8 28 73 74  61 72 74 25 28 64 25 29  |sqx=.(start%(d%)|
0000bd10  2f 77 73 71 78 29 20 79  70 6f 73 25 2d 3d 31 0d  |/wsqx) ypos%-=1.|
0000bd20  33 90 2b 78 70 6f 73 25  3d 28 78 70 6f 73 25 2a  |3.+xpos%=(xpos%*|
0000bd30  33 32 29 2b 32 35 3a 79  70 6f 73 25 3d 28 79 70  |32)+25:ypos%=(yp|
0000bd40  6f 73 25 2a 34 34 29 2b  36 38 0d 33 9a 0d c8 8e  |os%*44)+68.3....|
0000bd50  20 64 69 72 25 20 ca 0d  33 a4 14 c9 20 31 3a 64  | dir% ..3... 1:d|
0000bd60  78 25 3d 30 3a 64 79 25  3d 34 34 0d 33 ae 15 c9  |x%=0:dy%=44.3...|
0000bd70  20 32 3a 64 78 25 3d 33  32 3a 64 79 25 3d 34 34  | 2:dx%=32:dy%=44|
0000bd80  0d 33 b8 14 c9 20 33 3a  64 78 25 3d 33 32 3a 64  |.3... 3:dx%=32:d|
0000bd90  79 25 3d 30 0d 33 c2 16  c9 20 34 3a 64 78 25 3d  |y%=0.3... 4:dx%=|
0000bda0  33 32 3a 64 79 25 3d 2d  34 34 0d 33 cc 15 c9 20  |32:dy%=-44.3... |
0000bdb0  35 3a 64 78 25 3d 30 3a  64 79 25 3d 2d 34 34 0d  |5:dx%=0:dy%=-44.|
0000bdc0  33 d6 17 c9 20 36 3a 64  78 25 3d 2d 33 32 3a 64  |3... 6:dx%=-32:d|
0000bdd0  79 25 3d 2d 34 34 0d 33  e0 15 c9 20 37 3a 64 78  |y%=-44.3... 7:dx|
0000bde0  25 3d 2d 33 32 3a 64 79  25 3d 30 0d 33 ea 16 c9  |%=-32:dy%=0.3...|
0000bdf0  20 38 3a 64 78 25 3d 2d  33 32 3a 64 79 25 3d 34  | 8:dx%=-32:dy%=4|
0000be00  34 0d 33 f4 05 cb 0d 33  fe 0c 64 79 25 3d 2d 64  |4.3....3..dy%=-d|
0000be10  79 25 0d 34 08 61 73 78  25 28 64 25 29 3d 78 70  |y%.4.asx%(d%)=xp|
0000be20  6f 73 25 3a 73 79 25 28  64 25 29 3d 79 70 6f 73  |os%:sy%(d%)=ypos|
0000be30  25 3a 65 78 25 28 64 25  29 3d 78 70 6f 73 25 2b  |%:ex%(d%)=xpos%+|
0000be40  28 28 6c 65 6e 25 28 64  25 29 2d 31 29 2a 64 78  |((len%(d%)-1)*dx|
0000be50  25 29 3a 65 79 25 28 64  25 29 3d 79 70 6f 73 25  |%):ey%(d%)=ypos%|
0000be60  2b 28 28 6c 65 6e 25 28  64 25 29 2d 31 29 2a 64  |+((len%(d%)-1)*d|
0000be70  79 25 29 0d 34 12 05 e1  0d 34 1c 05 3a 0d 34 26  |y%).4....4..:.4&|
0000be80  0a dd a4 63 61 73 65 0d  34 30 08 64 25 3d 30 0d  |...case.40.d%=0.|
0000be90  34 3a 50 e3 49 25 3d 31  b8 77 6f 72 64 73 25 3a  |4:P.I%=1.words%:|
0000bea0  e3 4a 25 3d 31 b8 a9 77  6f 72 64 24 28 49 25 29  |.J%=1..word$(I%)|
0000beb0  3a 64 24 3d c1 77 6f 72  64 24 28 49 25 29 2c 4a  |:d$=.word$(I%),J|
0000bec0  25 2c 31 29 3a e7 20 64  24 3e 3d 22 41 22 20 20  |%,1):. d$>="A"  |
0000bed0  80 20 64 24 3c 3d 22 5a  22 20 64 25 2b 3d 31 0d  |. d$<="Z" d%+=1.|
0000bee0  34 44 07 ed 3a ed 0d 34  4e 1c e7 64 25 3e 28 77  |4D..:..4N..d%>(w|
0000bef0  6f 72 64 73 25 2a 32 2e  35 29 20 3d 31 20 8b 20  |ords%*2.5) =1 . |
0000bf00  3d 30 0d 34 58 05 3a 0d  34 62 0c dd a4 6f 72 69  |=0.4X.:.4b...ori|
0000bf10  67 69 6e 0d 34 6c 1b 3d  31 36 2b 77 69 6d 70 25  |gin.4l.=16+wimp%|
0000bf20  21 34 2d 77 69 6d 70 25  21 32 30 2d 31 38 0d 34  |!4-wimp%!20-18.4|
0000bf30  76 05 3a 0d 34 80 23 dc  20 31 31 2c 31 33 2c 31  |v.:.4.#. 11,13,1|
0000bf40  35 2c 31 37 2c 31 39 2c  32 31 2c 32 34 2c 32 36  |5,17,19,21,24,26|
0000bf50  2c 32 38 2c 32 39 0d 34  8a 05 3a 0d 34 94 1c dd  |,28,29.4..:.4...|
0000bf60  f2 41 6c 65 72 74 28 74  69 74 6c 65 24 2c 6d 65  |.Alert(title$,me|
0000bf70  73 73 61 67 65 24 29 0d  34 9e 20 f2 41 6c 65 72  |ssage$).4. .Aler|
0000bf80  74 42 6f 78 28 74 69 74  6c 65 24 2c 6d 65 73 73  |tBox(title$,mess|
0000bf90  61 67 65 24 2c 30 29 0d  34 a8 05 e1 0d 34 b2 05  |age$,0).4....4..|
0000bfa0  3a 0d 34 bc 27 dd f2 41  6c 65 72 74 42 6f 78 28  |:.4.'..AlertBox(|
0000bfb0  74 69 74 6c 65 24 2c 6d  65 73 73 61 67 65 24 2c  |title$,message$,|
0000bfc0  62 75 74 74 6f 6e 25 29  0d 34 c6 2f ea 72 65 73  |button%).4./.res|
0000bfd0  70 6f 6e 73 65 25 3a 24  28 77 69 6d 70 25 2b 34  |ponse%:$(wimp%+4|
0000bfe0  29 3d 6d 65 73 73 61 67  65 24 3a c8 8e 20 62 75  |)=message$:.. bu|
0000bff0  74 74 6f 6e 25 20 ca 0d  34 d0 14 c9 20 31 3a 72  |tton% ..4... 1:r|
0000c000  65 73 70 6f 6e 73 65 25  3d 31 35 0d 34 da 13 c9  |esponse%=15.4...|
0000c010  20 32 3a 72 65 73 70 6f  6e 73 65 25 3d 31 0d 34  | 2:response%=1.4|
0000c020  e4 1b c9 20 33 3a 72 65  73 70 6f 6e 73 65 25 3d  |... 3:response%=|
0000c030  28 31 3c 3c 35 29 2b 31  36 0d 34 ee 1b c9 20 34  |(1<<5)+16.4... 4|
0000c040  3a 72 65 73 70 6f 6e 73  65 25 3d 28 31 3c 3c 36  |:response%=(1<<6|
0000c050  29 2b 31 36 0d 34 f8 12  7f 3a 72 65 73 70 6f 6e  |)+16.4...:respon|
0000c060  73 65 25 3d 31 36 0d 35  02 05 cb 0d 35 0c 3d c8  |se%=16.5....5.=.|
0000c070  99 20 22 57 69 6d 70 5f  52 65 70 6f 72 74 45 72  |. "Wimp_ReportEr|
0000c080  72 6f 72 22 2c 77 69 6d  70 25 2c 72 65 73 70 6f  |ror",wimp%,respo|
0000c090  6e 73 65 25 2c 74 69 74  6c 65 24 20 b8 20 2c 72  |nse%,title$ . ,r|
0000c0a0  65 73 70 6f 6e 73 65 25  0d 35 16 05 e1 0d 35 20  |esponse%.5....5 |
0000c0b0  05 3a 0d 35 2a 23 dd a4  57 69 6e 64 6f 77 43 61  |.:.5*#..WindowCa|
0000c0c0  6e 63 65 6c 28 74 69 74  6c 65 24 2c 6d 65 73 73  |ncel(title$,mess|
0000c0d0  61 67 65 24 29 0d 35 34  24 24 28 77 69 6d 70 25  |age$).54$$(wimp%|
0000c0e0  2b 34 29 3d 6d 65 73 73  61 67 65 24 3a 72 65 73  |+4)=message$:res|
0000c0f0  70 6f 6e 73 65 25 3d 32  33 0d 35 3e 3d c8 99 20  |ponse%=23.5>=.. |
0000c100  22 57 69 6d 70 5f 52 65  70 6f 72 74 45 72 72 6f  |"Wimp_ReportErro|
0000c110  72 22 2c 77 69 6d 70 25  2c 72 65 73 70 6f 6e 73  |r",wimp%,respons|
0000c120  65 25 2c 74 69 74 6c 65  24 20 b8 20 2c 72 65 73  |e%,title$ . ,res|
0000c130  70 6f 6e 73 65 25 0d 35  48 10 3d 72 65 73 70 6f  |ponse%.5H.=respo|
0000c140  6e 73 65 25 2d 32 0d 35  52 05 3a 0d 35 5c 1a dd  |nse%-2.5R.:.5\..|
0000c150  a4 57 69 6e 64 6f 77 54  69 74 6c 65 28 77 69 6e  |.WindowTitle(win|
0000c160  64 6f 77 25 29 0d 35 66  13 77 69 6d 70 25 21 30  |dow%).5f.wimp%!0|
0000c170  3d 77 69 6e 64 6f 77 25  0d 35 70 20 c8 99 20 22  |=window%.5p .. "|
0000c180  57 69 6d 70 5f 47 65 74  57 69 6e 64 49 6e 66 6f  |Wimp_GetWindInfo|
0000c190  22 2c 2c 77 69 6d 70 25  0d 35 7a 36 e7 20 28 28  |",,wimp%.5z6. ((|
0000c1a0  77 69 6d 70 25 21 36 30  29 80 26 31 30 30 29 3d  |wimp%!60).&100)=|
0000c1b0  30 20 85 20 31 2c 22 54  69 74 6c 65 20 69 73 6e  |0 . 1,"Title isn|
0000c1c0  27 74 20 69 6e 64 69 72  65 63 74 65 64 22 0d 35  |'t indirected".5|
0000c1d0  84 10 3d 24 28 77 69 6d  70 25 21 37 36 29 0d 35  |..=$(wimp%!76).5|
0000c1e0  8e 05 3a 0d 35 98 19 dd  a4 57 69 6e 64 6f 77 4c  |..:.5....WindowL|
0000c1f0  6f 61 64 28 77 69 6e 64  6f 77 24 29 0d 35 a2 36  |oad(window$).5.6|
0000c200  3d a4 57 69 6e 64 6f 77  4c 6f 61 64 46 72 6f 6d  |=.WindowLoadFrom|
0000c210  28 77 69 6e 64 6f 77 24  2c 22 3c 57 6f 72 64 53  |(window$,"<WordS|
0000c220  71 24 44 69 72 3e 2e 54  65 6d 70 6c 61 74 65 73  |q$Dir>.Templates|
0000c230  22 29 0d 35 ac 05 3a 0d  35 b6 27 dd a4 57 69 6e  |").5..:.5.'..Win|
0000c240  64 6f 77 4c 6f 61 64 46  72 6f 6d 28 77 69 6e 64  |dowLoadFrom(wind|
0000c250  6f 77 24 2c 74 65 6d 70  6c 61 74 65 24 29 0d 35  |ow$,template$).5|
0000c260  c0 1a ea 20 63 25 2c 69  25 2c 6e 25 2c 6a 25 2c  |... c%,i%,n%,j%,|
0000c270  73 70 24 2c 73 70 32 24  0d 35 ca 25 c8 99 20 22  |sp$,sp2$.5.%.. "|
0000c280  57 69 6d 70 5f 4f 70 65  6e 54 65 6d 70 6c 61 74  |Wimp_OpenTemplat|
0000c290  65 22 2c 2c 74 65 6d 70  6c 61 74 65 24 0d 35 d4  |e",,template$.5.|
0000c2a0  4d c8 99 20 22 57 69 6d  70 5f 4c 6f 61 64 54 65  |M.. "Wimp_LoadTe|
0000c2b0  6d 70 6c 61 74 65 22 2c  2c 77 69 6d 70 25 2c 69  |mplate",,wimp%,i|
0000c2c0  63 6f 6e 73 25 2c 69 63  6f 6e 5f 6d 65 6d 6f 72  |cons%,icon_memor|
0000c2d0  79 25 2c 2d 31 2c 77 69  6e 64 6f 77 24 2c 30 20  |y%,-1,window$,0 |
0000c2e0  b8 20 2c 2c 69 63 6f 6e  73 25 0d 35 de 11 c8 8e  |. ,,icons%.5....|
0000c2f0  20 73 70 72 69 74 65 73  25 20 ca 0d 35 e8 19 c9  | sprites% ..5...|
0000c300  20 31 3a 77 69 6d 70 25  21 36 34 3d 73 70 72 69  | 1:wimp%!64=spri|
0000c310  74 65 73 25 0d 35 f2 17  7f 3a 77 69 6d 70 25 21  |tes%.5...:wimp%!|
0000c320  36 34 3d 73 70 72 69 74  65 73 25 0d 35 fc 05 cb  |64=sprites%.5...|
0000c330  0d 36 06 26 c8 99 20 22  57 69 6d 70 5f 43 72 65  |.6.&.. "Wimp_Cre|
0000c340  61 74 65 57 69 6e 64 6f  77 22 2c 2c 77 69 6d 70  |ateWindow",,wimp|
0000c350  25 20 b8 20 63 25 0d 36  10 1b c8 99 20 22 57 69  |% . c%.6.... "Wi|
0000c360  6d 70 5f 43 6c 6f 73 65  54 65 6d 70 6c 61 74 65  |mp_CloseTemplate|
0000c370  22 0d 36 1a 37 c8 99 20  22 57 69 6d 70 5f 57 68  |".6.7.. "Wimp_Wh|
0000c380  69 63 68 49 63 6f 6e 22  2c 63 25 2c 77 69 6d 70  |ichIcon",c%,wimp|
0000c390  25 2b 34 30 2c 31 2b 32  2b 28 31 3c 3c 38 29 2c  |%+40,1+2+(1<<8),|
0000c3a0  32 2b 28 31 3c 3c 38 29  0d 36 24 11 c8 8e 20 77  |2+(1<<8).6$... w|
0000c3b0  69 6d 70 25 21 34 30 20  ca 0d 36 2e 08 c9 20 2d  |imp%!40 ..6... -|
0000c3c0  31 0d 36 38 0b 7f 3a 69  25 3d 34 30 0d 36 42 05  |1.68..:i%=40.6B.|
0000c3d0  f5 0d 36 4c 1f 77 69 6d  70 25 21 34 3d 77 69 6d  |..6L.wimp%!4=wim|
0000c3e0  70 25 21 69 25 3a 77 69  6d 70 25 21 30 3d 63 25  |p%!i%:wimp%!0=c%|
0000c3f0  0d 36 56 21 c8 99 20 22  57 69 6d 70 5f 47 65 74  |.6V!.. "Wimp_Get|
0000c400  49 63 6f 6e 53 74 61 74  65 22 2c 2c 77 69 6d 70  |IconState",,wimp|
0000c410  25 0d 36 60 25 73 70 24  3d a4 47 65 74 53 74 72  |%.6`%sp$=.GetStr|
0000c420  69 6e 67 41 74 41 64 64  72 65 73 73 28 77 69 6d  |ingAtAddress(wim|
0000c430  70 25 21 32 38 29 0d 36  6a 1f c8 99 20 22 57 69  |p%!28).6j... "Wi|
0000c440  6d 70 5f 44 65 6c 65 74  65 49 63 6f 6e 22 2c 2c  |mp_DeleteIcon",,|
0000c450  77 69 6d 70 25 0d 36 74  11 c8 8e 20 73 70 72 69  |wimp%.6t... spri|
0000c460  74 65 73 25 20 ca 0d 36  7e 12 c9 20 31 3a 77 69  |tes% ..6~.. 1:wi|
0000c470  6d 70 25 21 33 32 3d 31  0d 36 88 05 7f 0d 36 92  |mp%!32=1.6....6.|
0000c480  2a c8 99 20 22 4f 53 5f  53 70 72 69 74 65 4f 70  |*.. "OS_SpriteOp|
0000c490  22 2c 26 31 30 38 2c 73  70 72 69 74 65 73 25 20  |",&108,sprites% |
0000c4a0  b8 20 2c 2c 2c 6e 25 0d  36 9c 08 6a 25 3d 30 0d  |. ,,,n%.6..j%=0.|
0000c4b0  36 a6 0b f5 3a 6a 25 2b  3d 31 0d 36 b0 37 c8 99  |6...:j%+=1.6.7..|
0000c4c0  20 22 4f 53 5f 53 70 72  69 74 65 4f 70 22 2c 26  | "OS_SpriteOp",&|
0000c4d0  31 30 44 2c 73 70 72 69  74 65 73 25 2c 70 6f 69  |10D,sprites%,poi|
0000c4e0  6e 74 65 72 5f 62 6c 6f  63 6b 25 2c 32 30 2c 6a  |nter_block%,20,j|
0000c4f0  25 0d 36 ba 2c 73 70 32  24 3d a4 47 65 74 53 74  |%.6.,sp2$=.GetSt|
0000c500  72 69 6e 67 41 74 41 64  64 72 65 73 73 28 70 6f  |ringAtAddress(po|
0000c510  69 6e 74 65 72 5f 62 6c  6f 63 6b 25 29 0d 36 c4  |inter_block%).6.|
0000c520  16 fd 20 6a 25 3d 6e 25  20 84 20 73 70 24 3d 73  |.. j%=n% . sp$=s|
0000c530  70 32 24 0d 36 ce 2f e7  20 73 70 24 3d 73 70 32  |p2$.6./. sp$=sp2|
0000c540  24 20 8c 20 77 69 6d 70  25 21 33 32 3d 73 70 72  |$ . wimp%!32=spr|
0000c550  69 74 65 73 25 20 8b 20  77 69 6d 70 25 21 33 32  |ites% . wimp%!32|
0000c560  3d 31 0d 36 d8 05 cb 0d  36 e2 0e 77 69 6d 70 25  |=1.6....6..wimp%|
0000c570  21 34 3d 63 25 0d 36 ec  2b c8 99 20 22 57 69 6d  |!4=c%.6.+.. "Wim|
0000c580  70 5f 43 72 65 61 74 65  49 63 6f 6e 22 2c 2c 77  |p_CreateIcon",,w|
0000c590  69 6d 70 25 2b 34 20 b8  20 68 61 6e 64 6c 65 25  |imp%+4 . handle%|
0000c5a0  0d 36 f6 09 69 25 2b 3d  34 0d 37 00 13 fd 20 28  |.6..i%+=4.7... (|
0000c5b0  77 69 6d 70 25 21 69 25  29 3d 2d 31 0d 37 0a 05  |wimp%!i%)=-1.7..|
0000c5c0  cb 0d 37 14 07 3d 63 25  0d 37 1e 05 3a 0d 37 28  |..7..=c%.7..:.7(|
0000c5d0  19 dd f2 42 72 69 6e 67  54 6f 54 6f 70 28 77 69  |...BringToTop(wi|
0000c5e0  6e 64 6f 77 25 29 0d 37  32 12 21 77 69 6d 70 25  |ndow%).72.!wimp%|
0000c5f0  3d 77 69 6e 64 6f 77 25  0d 37 3c 23 c8 99 20 22  |=window%.7<#.. "|
0000c600  57 69 6d 70 5f 47 65 74  57 69 6e 64 6f 77 53 74  |Wimp_GetWindowSt|
0000c610  61 74 65 22 2c 2c 77 69  6d 70 25 0d 37 46 0f 77  |ate",,wimp%.7F.w|
0000c620  69 6d 70 25 21 32 38 3d  2d 31 0d 37 50 1f c8 99  |imp%!28=-1.7P...|
0000c630  20 22 57 69 6d 70 5f 4f  70 65 6e 57 69 6e 64 6f  | "Wimp_OpenWindo|
0000c640  77 22 2c 2c 77 69 6d 70  25 0d 37 5a 28 e7 77 69  |w",,wimp%.7Z(.wi|
0000c650  6e 64 6f 77 25 3d 64 69  73 70 6c 61 79 5f 57 69  |ndow%=display_Wi|
0000c660  6e 64 6f 77 25 20 64 69  73 70 77 69 6e 64 25 3d  |ndow% dispwind%=|
0000c670  31 0d 37 64 05 e1 0d 37  6e 05 3a 0d 37 78 1a dd  |1.7d...7n.:.7x..|
0000c680  f2 57 69 6e 64 6f 77 43  6c 6f 73 65 28 77 69 6e  |.WindowClose(win|
0000c690  64 6f 77 25 29 0d 37 82  12 21 77 69 6d 70 25 3d  |dow%).7..!wimp%=|
0000c6a0  77 69 6e 64 6f 77 25 0d  37 8c 20 c8 99 20 22 57  |window%.7. .. "W|
0000c6b0  69 6d 70 5f 43 6c 6f 73  65 57 69 6e 64 6f 77 22  |imp_CloseWindow"|
0000c6c0  2c 2c 77 69 6d 70 25 0d  37 96 28 e7 77 69 6e 64  |,,wimp%.7.(.wind|
0000c6d0  6f 77 25 3d 64 69 73 70  6c 61 79 5f 57 69 6e 64  |ow%=display_Wind|
0000c6e0  6f 77 25 20 64 69 73 70  77 69 6e 64 25 3d 30 0d  |ow% dispwind%=0.|
0000c6f0  37 a0 05 e1 0d 37 aa 05  3a 0d 37 b4 1e dd f2 57  |7....7..:.7....W|
0000c700  69 6e 64 6f 77 46 6f 72  63 65 44 72 61 77 28 77  |indowForceDraw(w|
0000c710  69 6e 64 6f 77 25 29 0d  37 be 10 c8 8e 20 77 69  |indow%).7.... wi|
0000c720  6e 64 6f 77 25 20 ca 0d  37 c8 33 c9 20 2d 31 3a  |ndow% ..7.3. -1:|
0000c730  c8 99 20 22 57 69 6d 70  5f 46 6f 72 63 65 52 65  |.. "Wimp_ForceRe|
0000c740  64 72 61 77 22 2c 2d 31  2c 30 2c 30 2c 32 2a 31  |draw",-1,0,0,2*1|
0000c750  32 38 30 2c 32 2a 31 30  32 34 0d 37 d2 36 7f 3a  |280,2*1024.7.6.:|
0000c760  c8 99 20 22 57 69 6d 70  5f 46 6f 72 63 65 52 65  |.. "Wimp_ForceRe|
0000c770  64 72 61 77 22 2c 77 69  6e 64 6f 77 25 2c 30 2c  |draw",window%,0,|
0000c780  2d 32 2a 31 30 32 34 2c  32 2a 31 32 38 30 2c 30  |-2*1024,2*1280,0|
0000c790  0d 37 dc 05 cb 0d 37 e6  05 e1 0d 37 f0 05 3a 0d  |.7....7....7..:.|
0000c7a0  37 fa 19 dd f2 57 69 6e  64 6f 77 4f 70 65 6e 28  |7....WindowOpen(|
0000c7b0  77 69 6e 64 6f 77 25 29  0d 38 04 12 21 77 69 6d  |window%).8..!wim|
0000c7c0  70 25 3d 77 69 6e 64 6f  77 25 0d 38 0e 23 c8 99  |p%=window%.8.#..|
0000c7d0  20 22 57 69 6d 70 5f 47  65 74 57 69 6e 64 6f 77  | "Wimp_GetWindow|
0000c7e0  53 74 61 74 65 22 2c 2c  77 69 6d 70 25 0d 38 18  |State",,wimp%.8.|
0000c7f0  1f c8 99 20 22 57 69 6d  70 5f 4f 70 65 6e 57 69  |... "Wimp_OpenWi|
0000c800  6e 64 6f 77 22 2c 2c 77  69 6d 70 25 0d 38 22 05  |ndow",,wimp%.8".|
0000c810  e1 0d 38 2c 05 3a 0d 38  36 14 f2 57 69 6e 64 6f  |..8,.:.86..Windo|
0000c820  77 49 6e 74 65 72 66 61  63 65 0d 38 40 20 c8 99  |wInterface.8@ ..|
0000c830  22 57 69 6d 70 5f 42 6f  72 64 65 72 57 69 6e 64  |"Wimp_BorderWind|
0000c840  6f 77 22 2c 2c 77 69 6d  70 25 0d 38 4a 05 e1 0d  |ow",,wimp%.8J...|
0000c850  38 54 05 3a 0d 38 5e 16  dd a4 49 63 6f 6e 42 61  |8T.:.8^...IconBa|
0000c860  72 28 53 70 72 69 74 65  24 29 0d 38 68 0b ea 20  |r(Sprite$).8h.. |
0000c870  69 63 6f 6e 25 0d 38 72  0e 77 69 6d 70 25 21 30  |icon%.8r.wimp%!0|
0000c880  3d 2d 31 0d 38 7c 17 77  69 6d 70 25 21 34 3d 30  |=-1.8|.wimp%!4=0|
0000c890  3a 77 69 6d 70 25 21 38  3d 30 0d 38 86 1b 77 69  |:wimp%!8=0.8..wi|
0000c8a0  6d 70 25 21 31 32 3d 36  38 3a 77 69 6d 70 25 21  |mp%!12=68:wimp%!|
0000c8b0  31 36 3d 36 38 0d 38 90  12 77 69 6d 70 25 21 32  |16=68.8..wimp%!2|
0000c8c0  30 3d 26 33 30 30 32 0d  38 9a 17 24 28 77 69 6d  |0=&3002.8..$(wim|
0000c8d0  70 25 2b 32 34 29 3d 53  70 72 69 74 65 24 0d 38  |p%+24)=Sprite$.8|
0000c8e0  a4 27 c8 99 20 22 57 69  6d 70 5f 43 72 65 61 74  |.'.. "Wimp_Creat|
0000c8f0  65 49 63 6f 6e 22 2c 2c  77 69 6d 70 25 20 b8 20  |eIcon",,wimp% . |
0000c900  69 63 6f 6e 25 0d 38 ae  0a 3d 69 63 6f 6e 25 0d  |icon%.8..=icon%.|
0000c910  38 b8 05 3a 0d 38 c2 25  dd f2 49 63 6f 6e 43 61  |8..:.8.%..IconCa|
0000c920  72 65 74 28 77 69 6e 64  6f 77 25 2c 69 63 6f 6e  |ret(window%,icon|
0000c930  25 2c 63 68 61 72 73 25  29 0d 38 cc 38 c8 99 20  |%,chars%).8.8.. |
0000c940  22 57 69 6d 70 5f 53 65  74 43 61 72 65 74 50 6f  |"Wimp_SetCaretPo|
0000c950  73 69 74 69 6f 6e 22 2c  77 69 6e 64 6f 77 25 2c  |sition",window%,|
0000c960  69 63 6f 6e 25 2c 2c 2c  2d 31 2c 63 68 61 72 73  |icon%,,,-1,chars|
0000c970  25 0d 38 d6 05 e1 0d 38  e0 05 3a 0d 38 ea 1d dd  |%.8....8..:.8...|
0000c980  a4 49 63 6f 6e 54 65 78  74 28 77 69 6e 64 6f 77  |.IconText(window|
0000c990  25 2c 69 63 6f 6e 25 29  0d 38 f4 21 77 69 6d 70  |%,icon%).8.!wimp|
0000c9a0  25 21 30 3d 77 69 6e 64  6f 77 25 3a 77 69 6d 70  |%!0=window%:wimp|
0000c9b0  25 21 34 3d 69 63 6f 6e  25 0d 38 fe 21 c8 99 20  |%!4=icon%.8.!.. |
0000c9c0  22 57 69 6d 70 5f 47 65  74 49 63 6f 6e 53 74 61  |"Wimp_GetIconSta|
0000c9d0  74 65 22 2c 2c 77 69 6d  70 25 0d 39 08 59 e7 20  |te",,wimp%.9.Y. |
0000c9e0  28 28 77 69 6d 70 25 21  32 34 29 20 80 20 26 31  |((wimp%!24) . &1|
0000c9f0  30 30 29 3d 30 20 85 20  31 2c 22 49 63 6f 6e 20  |00)=0 . 1,"Icon |
0000ca00  22 2b c3 69 63 6f 6e 25  2b 22 20 69 6e 20 77 69  |"+.icon%+" in wi|
0000ca10  6e 64 6f 77 20 22 2b c3  77 69 6e 64 6f 77 25 2b  |ndow "+.window%+|
0000ca20  22 20 69 73 6e 27 74 20  69 6e 64 69 72 65 63 74  |" isn't indirect|
0000ca30  65 64 22 0d 39 12 10 3d  24 28 77 69 6d 70 25 21  |ed".9..=$(wimp%!|
0000ca40  32 38 29 0d 39 1c 05 3a  0d 39 26 23 dd a4 49 63  |28).9..:.9&#..Ic|
0000ca50  6f 6e 56 61 6c 69 64 61  74 69 6f 6e 28 77 69 6e  |onValidation(win|
0000ca60  64 6f 77 25 2c 69 63 6f  6e 25 29 0d 39 30 21 77  |dow%,icon%).90!w|
0000ca70  69 6d 70 25 21 30 3d 77  69 6e 64 6f 77 25 3a 77  |imp%!0=window%:w|
0000ca80  69 6d 70 25 21 34 3d 69  63 6f 6e 25 0d 39 3a 21  |imp%!4=icon%.9:!|
0000ca90  c8 99 20 22 57 69 6d 70  5f 47 65 74 49 63 6f 6e  |.. "Wimp_GetIcon|
0000caa0  53 74 61 74 65 22 2c 2c  77 69 6d 70 25 0d 39 44  |State",,wimp%.9D|
0000cab0  59 e7 20 28 28 77 69 6d  70 25 21 32 34 29 20 80  |Y. ((wimp%!24) .|
0000cac0  20 26 31 30 30 29 3d 30  20 85 20 31 2c 22 49 63  | &100)=0 . 1,"Ic|
0000cad0  6f 6e 20 22 2b c3 69 63  6f 6e 25 2b 22 20 69 6e  |on "+.icon%+" in|
0000cae0  20 77 69 6e 64 6f 77 20  22 2b c3 77 69 6e 64 6f  | window "+.windo|
0000caf0  77 25 2b 22 20 69 73 6e  27 74 20 69 6e 64 69 72  |w%+" isn't indir|
0000cb00  65 63 74 65 64 22 0d 39  4e 10 3d 24 28 77 69 6d  |ected".9N.=$(wim|
0000cb10  70 25 21 33 32 29 0d 39  58 05 3a 0d 39 62 20 dd  |p%!32).9X.:.9b .|
0000cb20  f2 49 63 6f 6e 44 69 73  61 62 6c 65 28 77 69 6e  |.IconDisable(win|
0000cb30  64 6f 77 25 2c 69 63 6f  6e 25 29 0d 39 6c 21 77  |dow%,icon%).9l!w|
0000cb40  69 6d 70 25 21 30 3d 77  69 6e 64 6f 77 25 3a 77  |imp%!0=window%:w|
0000cb50  69 6d 70 25 21 34 3d 69  63 6f 6e 25 0d 39 76 20  |imp%!4=icon%.9v |
0000cb60  77 69 6d 70 25 21 38 3d  31 3c 3c 32 32 3a 77 69  |wimp%!8=1<<22:wi|
0000cb70  6d 70 25 21 31 32 3d 31  3c 3c 32 32 0d 39 80 21  |mp%!12=1<<22.9.!|
0000cb80  c8 99 20 22 57 69 6d 70  5f 53 65 74 49 63 6f 6e  |.. "Wimp_SetIcon|
0000cb90  53 74 61 74 65 22 2c 2c  77 69 6d 70 25 0d 39 8a  |State",,wimp%.9.|
0000cba0  05 e1 0d 39 94 05 3a 0d  39 9e 1f dd f2 49 63 6f  |...9..:.9....Ico|
0000cbb0  6e 45 6e 61 62 6c 65 28  77 69 6e 64 6f 77 25 2c  |nEnable(window%,|
0000cbc0  69 63 6f 6e 25 29 0d 39  a8 21 77 69 6d 70 25 21  |icon%).9.!wimp%!|
0000cbd0  30 3d 77 69 6e 64 6f 77  25 3a 77 69 6d 70 25 21  |0=window%:wimp%!|
0000cbe0  34 3d 69 63 6f 6e 25 0d  39 b2 1c 77 69 6d 70 25  |4=icon%.9..wimp%|
0000cbf0  21 38 3d 30 3a 77 69 6d  70 25 21 31 32 3d 31 3c  |!8=0:wimp%!12=1<|
0000cc00  3c 32 32 0d 39 bc 21 c8  99 20 22 57 69 6d 70 5f  |<22.9.!.. "Wimp_|
0000cc10  53 65 74 49 63 6f 6e 53  74 61 74 65 22 2c 2c 77  |SetIconState",,w|
0000cc20  69 6d 70 25 0d 39 c6 05  e1 0d 39 d0 05 3a 0d 39  |imp%.9....9..:.9|
0000cc30  da 2a dd a4 49 63 6f 6e  50 75 74 53 70 72 69 74  |.*..IconPutSprit|
0000cc40  65 28 77 69 6e 64 6f 77  25 2c 69 63 6f 6e 25 2c  |e(window%,icon%,|
0000cc50  73 70 72 69 74 65 24 29  0d 39 e4 21 77 69 6d 70  |sprite$).9.!wimp|
0000cc60  25 21 30 3d 77 69 6e 64  6f 77 25 3a 77 69 6d 70  |%!0=window%:wimp|
0000cc70  25 21 34 3d 69 63 6f 6e  25 0d 39 ee 21 c8 99 20  |%!4=icon%.9.!.. |
0000cc80  22 57 69 6d 70 5f 47 65  74 49 63 6f 6e 53 74 61  |"Wimp_GetIconSta|
0000cc90  74 65 22 2c 2c 77 69 6d  70 25 0d 39 f8 1f c8 99  |te",,wimp%.9....|
0000cca0  20 22 57 69 6d 70 5f 44  65 6c 65 74 65 49 63 6f  | "Wimp_DeleteIco|
0000ccb0  6e 22 2c 2c 77 69 6d 70  25 0d 3a 02 36 77 69 6d  |n",,wimp%.:.6wim|
0000ccc0  70 25 21 34 3d 77 69 6d  70 25 21 38 3a 77 69 6d  |p%!4=wimp%!8:wim|
0000ccd0  70 25 21 38 3d 77 69 6d  70 25 21 31 32 3a 77 69  |p%!8=wimp%!12:wi|
0000cce0  6d 70 25 21 31 32 3d 77  69 6d 70 25 21 31 36 0d  |mp%!12=wimp%!16.|
0000ccf0  3a 0c 3b 77 69 6d 70 25  21 31 36 3d 77 69 6d 70  |:.;wimp%!16=wimp|
0000cd00  25 21 32 30 3a 77 69 6d  70 25 21 32 30 3d 77 69  |%!20:wimp%!20=wi|
0000cd10  6d 70 25 21 32 34 3a 24  28 77 69 6d 70 25 2b 32  |mp%!24:$(wimp%+2|
0000cd20  34 29 3d 73 70 72 69 74  65 24 0d 3a 16 27 c8 99  |4)=sprite$.:.'..|
0000cd30  20 22 57 69 6d 70 5f 43  72 65 61 74 65 49 63 6f  | "Wimp_CreateIco|
0000cd40  6e 22 2c 2c 77 69 6d 70  25 20 b8 20 69 63 6f 6e  |n",,wimp% . icon|
0000cd50  25 0d 3a 20 0a 3d 69 63  6f 6e 25 0d 3a 2a 05 3a  |%.: .=icon%.:*.:|
0000cd60  0d 3a 34 26 dd f2 49 63  6f 6e 50 75 74 54 65 78  |.:4&..IconPutTex|
0000cd70  74 28 77 69 6e 64 6f 77  25 2c 69 63 6f 6e 25 2c  |t(window%,icon%,|
0000cd80  74 65 78 74 24 29 0d 3a  3e 23 77 69 6d 70 25 21  |text$).:>#wimp%!|
0000cd90  30 3d 77 69 6e 64 6f 77  25 20 3a 20 77 69 6d 70  |0=window% : wimp|
0000cda0  25 21 34 3d 69 63 6f 6e  25 0d 3a 48 21 c8 99 20  |%!4=icon%.:H!.. |
0000cdb0  22 57 69 6d 70 5f 47 65  74 49 63 6f 6e 53 74 61  |"Wimp_GetIconSta|
0000cdc0  74 65 22 2c 2c 77 69 6d  70 25 0d 3a 52 59 e7 20  |te",,wimp%.:RY. |
0000cdd0  28 28 77 69 6d 70 25 21  32 34 29 20 80 20 26 31  |((wimp%!24) . &1|
0000cde0  30 30 29 3d 30 20 85 20  31 2c 22 49 63 6f 6e 20  |00)=0 . 1,"Icon |
0000cdf0  22 2b c3 69 63 6f 6e 25  2b 22 20 69 6e 20 77 69  |"+.icon%+" in wi|
0000ce00  6e 64 6f 77 20 22 2b c3  77 69 6e 64 6f 77 25 2b  |ndow "+.window%+|
0000ce10  22 20 69 73 6e 27 74 20  69 6e 64 69 72 65 63 74  |" isn't indirect|
0000ce20  65 64 22 0d 3a 5c 15 24  28 77 69 6d 70 25 21 32  |ed".:\.$(wimp%!2|
0000ce30  38 29 3d 74 65 78 74 24  0d 3a 66 21 77 69 6d 70  |8)=text$.:f!wimp|
0000ce40  25 21 30 3d 77 69 6e 64  6f 77 25 3a 77 69 6d 70  |%!0=window%:wimp|
0000ce50  25 21 34 3d 69 63 6f 6e  25 0d 3a 70 18 77 69 6d  |%!4=icon%.:p.wim|
0000ce60  70 25 21 38 3d 30 3a 77  69 6d 70 25 21 31 32 3d  |p%!8=0:wimp%!12=|
0000ce70  30 0d 3a 7a 21 c8 99 20  22 57 69 6d 70 5f 53 65  |0.:z!.. "Wimp_Se|
0000ce80  74 49 63 6f 6e 53 74 61  74 65 22 2c 2c 77 69 6d  |tIconState",,wim|
0000ce90  70 25 0d 3a 84 05 e1 0d  3a 8e 05 3a 0d 3a 98 18  |p%.:....:..:.:..|
0000cea0  dd f2 49 63 6f 6e 49 6e  74 65 72 66 61 63 65 53  |..IconInterfaceS|
0000ceb0  74 61 72 74 0d 3a a2 1e  c8 99 22 57 69 6d 70 5f  |tart.:...."Wimp_|
0000cec0  42 6f 72 64 65 72 49 63  6f 6e 22 2c 2c 77 69 6d  |BorderIcon",,wim|
0000ced0  70 25 0d 3a ac 05 e1 0d  3a b6 05 3a 0d 3a c0 19  |p%.:....:..:.:..|
0000cee0  dd f2 49 63 6f 6e 49 6e  74 65 72 66 61 63 65 46  |..IconInterfaceF|
0000cef0  69 6e 69 73 68 0d 3a ca  0d 77 69 6d 70 25 21 38  |inish.:..wimp%!8|
0000cf00  3d 30 0d 3a d4 1e c8 99  22 57 69 6d 70 5f 42 6f  |=0.:...."Wimp_Bo|
0000cf10  72 64 65 72 49 63 6f 6e  22 2c 2c 77 69 6d 70 25  |rderIcon",,wimp%|
0000cf20  0d 3a de 05 e1 0d 3a e8  05 3a 0d 3a f2 19 dd f2  |.:....:..:.:....|
0000cf30  4d 65 6e 75 41 64 6a 75  73 74 4f 6e 28 6d 65 6e  |MenuAdjustOn(men|
0000cf40  75 25 29 0d 3a fc 2c c8  99 20 22 57 69 6d 70 5f  |u%).:.,.. "Wimp_|
0000cf50  47 65 74 50 6f 69 6e 74  65 72 49 6e 66 6f 22 2c  |GetPointerInfo",|
0000cf60  2c 70 6f 69 6e 74 65 72  5f 62 6c 6f 63 6b 25 0d  |,pointer_block%.|
0000cf70  3b 06 5e e7 20 28 28 70  6f 69 6e 74 65 72 5f 62  |;.^. ((pointer_b|
0000cf80  6c 6f 63 6b 25 21 38 29  80 31 29 3d 31 20 8c 20  |lock%!8).1)=1 . |
0000cf90  c8 99 20 22 57 69 6d 70  5f 43 72 65 61 74 65 4d  |.. "Wimp_CreateM|
0000cfa0  65 6e 75 22 2c 2c 6d 65  6e 75 25 2c 70 6f 69 6e  |enu",,menu%,poin|
0000cfb0  74 65 72 5f 62 6c 6f 63  6b 25 21 30 2c 70 6f 69  |ter_block%!0,poi|
0000cfc0  6e 74 65 72 5f 62 6c 6f  63 6b 25 21 34 0d 3b 10  |nter_block%!4.;.|
0000cfd0  05 e1 0d 3b 1a 05 3a 0d  3b 24 18 dd a4 4d 65 6e  |...;..:.;$...Men|
0000cfe0  75 43 68 6f 69 63 65 28  6c 65 76 65 6c 25 29 0d  |uChoice(level%).|
0000cff0  3b 2e 19 3d 28 77 69 6d  70 25 21 28 34 2a 6c 65  |;..=(wimp%!(4*le|
0000d000  76 65 6c 25 29 29 2b 31  0d 3b 38 05 3a 0d 3b 42  |vel%))+1.;8.:.;B|
0000d010  17 dd a4 4d 65 6e 75 43  72 65 61 74 65 28 6d 65  |...MenuCreate(me|
0000d020  6e 75 24 29 0d 3b 4c 2f  e7 20 6d 65 6e 75 24 3d  |nu$).;L/. menu$=|
0000d030  22 43 6f 6c 6f 75 72 73  22 20 8c 3d a4 4d 65 6e  |"Colours" .=.Men|
0000d040  75 43 72 65 61 74 65 43  6f 6c 6f 75 72 73 28 22  |uCreateColours("|
0000d050  20 22 29 0d 3b 56 27 ea  20 6d 65 6e 75 25 2c 69  | ").;V'. menu%,i|
0000d060  6e 64 65 78 25 2c 77 69  64 74 68 25 2c 6c 65 6e  |ndex%,width%,len|
0000d070  67 74 68 25 2c 6b 25 2c  73 25 0d 3b 60 29 de 20  |gth%,k%,s%.;`). |
0000d080  6d 65 6e 75 25 20 32 38  2b a4 4d 65 6e 75 4e 6f  |menu% 28+.MenuNo|
0000d090  4f 66 45 6e 74 72 69 65  73 28 6d 65 6e 75 24 29  |OfEntries(menu$)|
0000d0a0  2a 32 34 0d 3b 6a 2f 6d  65 6e 75 25 3f 31 32 3d  |*24.;j/menu%?12=|
0000d0b0  37 3a 6d 65 6e 75 25 3f  31 33 3d 32 3a 6d 65 6e  |7:menu%?13=2:men|
0000d0c0  75 25 3f 31 34 3d 37 3a  6d 65 6e 75 25 3f 31 35  |u%?14=7:menu%?15|
0000d0d0  3d 30 0d 3b 74 27 6d 65  6e 75 25 21 31 36 3d 31  |=0.;t'menu%!16=1|
0000d0e0  34 30 3a 6d 65 6e 75 25  21 32 30 3d 34 34 3a 6d  |40:menu%!20=44:m|
0000d0f0  65 6e 75 25 21 32 34 3d  30 0d 3b 7e 13 69 6e 64  |enu%!24=0.;~.ind|
0000d100  65 78 25 3d 6d 65 6e 75  25 2b 32 38 0d 3b 88 20  |ex%=menu%+28.;. |
0000d110  24 6d 65 6e 75 25 3d c0  6d 65 6e 75 24 2c a7 6d  |$menu%=.menu$,.m|
0000d120  65 6e 75 24 2c 22 5c 22  29 2d 31 29 0d 3b 92 23  |enu$,"\")-1).;.#|
0000d130  77 69 64 74 68 25 3d a9  28 c0 6d 65 6e 75 24 2c  |width%=.(.menu$,|
0000d140  a7 6d 65 6e 75 24 2c 22  5c 22 29 2d 31 29 29 0d  |.menu$,"\")-1)).|
0000d150  3b 9c 22 6d 65 6e 75 24  2b 3d 22 5c 22 3a 4d 65  |;."menu$+="\":Me|
0000d160  6e 75 5f 4e 6f 4f 66 45  6e 74 72 69 65 73 25 3d  |nu_NoOfEntries%=|
0000d170  30 0d 3b a6 10 c8 95 20  6d 65 6e 75 24 3c 3e 22  |0.;.... menu$<>"|
0000d180  22 0d 3b b0 1f 6d 65 6e  75 24 3d c1 6d 65 6e 75  |".;..menu$=.menu|
0000d190  24 2c a7 6d 65 6e 75 24  2c 22 5c 22 29 2b 31 29  |$,.menu$,"\")+1)|
0000d1a0  0d 3b ba 0e c8 8e 20 6d  65 6e 75 24 20 ca 0d 3b  |.;.... menu$ ..;|
0000d1b0  c4 08 c9 20 22 22 0d 3b  ce 05 7f 0d 3b d8 2b 21  |... "".;....;.+!|
0000d1c0  69 6e 64 65 78 25 3d 30  3a 69 6e 64 65 78 25 21  |index%=0:index%!|
0000d1d0  34 3d 2d 31 3a 69 6e 64  65 78 25 21 38 3d 26 37  |4=-1:index%!8=&7|
0000d1e0  30 30 30 30 32 31 0d 3b  e2 19 6c 65 6e 67 74 68  |000021.;..length|
0000d1f0  25 3d a7 6d 65 6e 75 24  2c 22 5c 22 29 2d 31 0d  |%=.menu$,"\")-1.|
0000d200  3b ec 1c 6b 25 3d a7 c0  6d 65 6e 75 24 2c 6c 65  |;..k%=..menu$,le|
0000d210  6e 67 74 68 25 29 2c 22  3e 22 29 0d 3b f6 0b c8  |ngth%),">").;...|
0000d220  8e 20 6b 25 20 ca 0d 3c  00 07 c9 20 30 0d 3c 0a  |. k% ..<... 0.<.|
0000d230  05 7f 0d 3c 14 21 73 25  3d a0 28 c1 6d 65 6e 75  |...<.!s%=.(.menu|
0000d240  24 2c 6b 25 2b 31 2c 6c  65 6e 67 74 68 25 2d 6b  |$,k%+1,length%-k|
0000d250  25 29 29 0d 3c 1e 0f 69  6e 64 65 78 25 21 34 3d  |%)).<..index%!4=|
0000d260  73 25 0d 3c 28 10 6c 65  6e 67 74 68 25 3d 6b 25  |s%.<(.length%=k%|
0000d270  2d 31 0d 3c 32 05 cb 0d  3c 3c 20 24 28 69 6e 64  |-1.<2...<< $(ind|
0000d280  65 78 25 2b 31 32 29 3d  c0 6d 65 6e 75 24 2c 6c  |ex%+12)=.menu$,l|
0000d290  65 6e 67 74 68 25 29 0d  3c 46 25 e7 20 6c 65 6e  |ength%).<F%. len|
0000d2a0  67 74 68 25 3e 77 69 64  74 68 25 20 8c 20 77 69  |gth%>width% . wi|
0000d2b0  64 74 68 25 3d 6c 65 6e  67 74 68 25 0d 3c 50 0e  |dth%=length%.<P.|
0000d2c0  69 6e 64 65 78 25 2b 3d  32 34 0d 3c 5a 05 cb 0d  |index%+=24.<Z...|
0000d2d0  3c 64 05 ce 0d 3c 6e 1a  6d 65 6e 75 25 21 31 36  |<d...<n.menu%!16|
0000d2e0  3d 31 36 2a 28 77 69 64  74 68 25 2b 31 29 0d 3c  |=16*(width%+1).<|
0000d2f0  78 26 69 6e 64 65 78 25  21 2d 32 34 3d 69 6e 64  |x&index%!-24=ind|
0000d300  65 78 25 21 2d 32 34 20  84 20 26 38 30 3a 3d 6d  |ex%!-24 . &80:=m|
0000d310  65 6e 75 25 0d 3c 82 05  3a 0d 3c 8c 1c dd a4 4d  |enu%.<..:.<....M|
0000d320  65 6e 75 4e 6f 4f 66 45  6e 74 72 69 65 73 28 6d  |enuNoOfEntries(m|
0000d330  65 6e 75 24 29 0d 3c 96  15 ea 20 6e 25 2c 6a 25  |enu$).<... n%,j%|
0000d340  3a 6e 25 3d 30 3a 6a 25  3d 30 0d 3c a0 05 f5 0d  |:n%=0:j%=0.<....|
0000d350  3c aa 17 6a 25 3d a7 6d  65 6e 75 24 2c 22 5c 22  |<..j%=.menu$,"\"|
0000d360  2c 6a 25 2b 31 29 0d 3c  b4 13 e7 20 6a 25 3c 3e  |,j%+1).<... j%<>|
0000d370  30 20 8c 20 6e 25 2b 3d  31 0d 3c be 0a fd 20 6a  |0 . n%+=1.<... j|
0000d380  25 3d 30 0d 3c c8 07 3d  6e 25 0d 3c d2 05 3a 0d  |%=0.<..=n%.<..:.|
0000d390  3c dc 0f dd f2 4d 65 6e  75 43 6c 6f 73 65 0d 3c  |<....MenuClose.<|
0000d3a0  e6 1b c8 99 20 22 57 69  6d 70 5f 43 72 65 61 74  |.... "Wimp_Creat|
0000d3b0  65 4d 65 6e 75 22 2c 2d  31 0d 3c f0 05 e1 0d 3c  |eMenu",-1.<....<|
0000d3c0  fa 05 3a 0d 3d 04 1e dd  f2 4d 65 6e 75 44 69 73  |..:.=....MenuDis|
0000d3d0  61 62 6c 65 28 6d 65 6e  75 25 2c 69 74 65 6d 25  |able(menu%,item%|
0000d3e0  29 0d 3d 0e 3b 6d 65 6e  75 25 21 28 33 36 2b 28  |).=.;menu%!(36+(|
0000d3f0  69 74 65 6d 25 2d 31 29  2a 32 34 29 3d 6d 65 6e  |item%-1)*24)=men|
0000d400  75 25 21 28 33 36 2b 28  69 74 65 6d 25 2d 31 29  |u%!(36+(item%-1)|
0000d410  2a 32 34 29 84 28 31 3c  3c 32 32 29 0d 3d 18 05  |*24).(1<<22).=..|
0000d420  e1 0d 3d 22 05 3a 0d 3d  2c 1d dd f2 4d 65 6e 75  |..=".:.=,...Menu|
0000d430  45 6e 61 62 6c 65 28 6d  65 6e 75 25 2c 69 74 65  |Enable(menu%,ite|
0000d440  6d 25 29 0d 3d 36 1d f2  4d 65 6e 75 44 69 73 61  |m%).=6..MenuDisa|
0000d450  62 6c 65 28 6d 65 6e 75  25 2c 69 74 65 6d 25 29  |ble(menu%,item%)|
0000d460  0d 3d 40 3b 6d 65 6e 75  25 21 28 33 36 2b 28 69  |.=@;menu%!(36+(i|
0000d470  74 65 6d 25 2d 31 29 2a  32 34 29 3d 6d 65 6e 75  |tem%-1)*24)=menu|
0000d480  25 21 28 33 36 2b 28 69  74 65 6d 25 2d 31 29 2a  |%!(36+(item%-1)*|
0000d490  32 34 29 82 28 31 3c 3c  32 32 29 0d 3d 4a 05 e1  |24).(1<<22).=J..|
0000d4a0  0d 3d 54 05 3a 0d 3d 5e  1b dd f2 4d 65 6e 75 54  |.=T.:.=^...MenuT|
0000d4b0  69 63 6b 28 6d 65 6e 75  25 2c 69 74 65 6d 25 29  |ick(menu%,item%)|
0000d4c0  0d 3d 68 37 6d 65 6e 75  25 21 28 32 38 2b 28 69  |.=h7menu%!(28+(i|
0000d4d0  74 65 6d 25 2d 31 29 2a  32 34 29 3d 28 6d 65 6e  |tem%-1)*24)=(men|
0000d4e0  75 25 21 28 32 38 2b 28  69 74 65 6d 25 2d 31 29  |u%!(28+(item%-1)|
0000d4f0  2a 32 34 29 29 82 31 0d  3d 72 05 e1 0d 3d 7c 05  |*24)).1.=r...=|.|
0000d500  3a 0d 3d 86 11 dd f2 53  70 72 69 74 65 73 4c 6f  |:.=....SpritesLo|
0000d510  61 64 0d 3d 90 2c f2 53  70 72 69 74 65 73 50 61  |ad.=.,.SpritesPa|
0000d520  74 68 4c 6f 61 64 28 22  3c 57 6f 72 64 53 71 24  |thLoad("<WordSq$|
0000d530  44 69 72 3e 2e 53 70 72  69 74 65 73 22 29 0d 3d  |Dir>.Sprites").=|
0000d540  9a 1c 64 69 72 65 63 74  5f 73 70 72 69 74 65 73  |..direct_sprites|
0000d550  25 3d 73 70 72 69 74 65  73 25 0d 3d a4 05 e1 0d  |%=sprites%.=....|
0000d560  3d ae 05 3a 0d 3d b8 20  dd f2 53 70 72 69 74 65  |=..:.=. ..Sprite|
0000d570  73 50 61 74 68 4c 6f 61  64 28 70 61 74 68 6e 61  |sPathLoad(pathna|
0000d580  6d 65 24 29 0d 3d c2 0a  ea 53 25 2c 54 25 0d 3d  |me$).=...S%,T%.=|
0000d590  cc 2e 53 25 3d 8e 22 3c  57 6f 72 64 53 71 24 44  |..S%=."<WordSq$D|
0000d5a0  69 72 3e 2e 53 70 72 69  74 65 73 22 3a 54 25 3d  |ir>.Sprites":T%=|
0000d5b0  a2 23 53 25 2b 31 36 3a  d9 23 53 25 0d 3d d6 19  |.#S%+16:.#S%.=..|
0000d5c0  de 73 70 72 69 74 65 73  25 54 25 2c 73 70 6e 61  |.sprites%T%,spna|
0000d5d0  6d 65 25 31 32 0d 3d e0  1d 21 73 70 72 69 74 65  |me%12.=..!sprite|
0000d5e0  73 25 3d 54 25 3a 73 70  72 69 74 65 73 25 21 38  |s%=T%:sprites%!8|
0000d5f0  3d 30 0d 3d ea 21 c8 99  22 4f 53 5f 53 70 72 69  |=0.=.!.."OS_Spri|
0000d600  74 65 4f 70 22 2c 26 31  30 39 2c 73 70 72 69 74  |teOp",&109,sprit|
0000d610  65 73 25 0d 3d f4 2b c8  99 22 4f 53 5f 53 70 72  |es%.=.+.."OS_Spr|
0000d620  69 74 65 4f 70 22 2c 26  31 30 41 2c 73 70 72 69  |iteOp",&10A,spri|
0000d630  74 65 73 25 2c 70 61 74  68 6e 61 6d 65 24 0d 3d  |tes%,pathname$.=|
0000d640  fe 05 e1 0d 3e 08 05 3a  0d 3e 12 15 dd a4 47 65  |....>..:.>....Ge|
0000d650  74 46 69 6c 65 50 61 74  68 4e 61 6d 65 0d 3e 1c  |tFilePathName.>.|
0000d660  22 3d a4 47 65 74 53 74  72 69 6e 67 41 74 41 64  |"=.GetStringAtAd|
0000d670  64 72 65 73 73 28 77 69  6d 70 25 2b 34 34 29 0d  |dress(wimp%+44).|
0000d680  3e 26 05 3a 0d 3e 30 20  dd a4 47 65 74 53 74 72  |>&.:.>0 ..GetStr|
0000d690  69 6e 67 41 74 41 64 64  72 65 73 73 28 61 72 72  |ingAtAddress(arr|
0000d6a0  61 79 25 29 0d 3e 3a 0d  ea 73 24 3a 73 24 3d 22  |ay%).>:..s$:s$="|
0000d6b0  22 0d 3e 44 3c c8 95 28  3f 61 72 72 61 79 25 3c  |".>D<..(?array%<|
0000d6c0  3e 31 33 29 80 28 3f 61  72 72 61 79 25 3c 3e 30  |>13).(?array%<>0|
0000d6d0  29 3a 73 24 2b 3d bd 28  3f 61 72 72 61 79 25 29  |):s$+=.(?array%)|
0000d6e0  3a 61 72 72 61 79 25 2b  3d 31 3a ce 3a 0d 3e 4e  |:array%+=1:.:.>N|
0000d6f0  07 3d 73 24 0d 3e 58 05  3a 0d 3e 62 1d dd a4 47  |.=s$.>X.:.>b...G|
0000d700  65 74 46 69 6c 65 46 72  6f 6d 50 61 74 68 6e 61  |etFileFromPathna|
0000d710  6d 65 28 66 24 29 0d 3e  6c 11 c8 8e 20 a7 66 24  |me(f$).>l... .f$|
0000d720  2c 22 2e 22 29 20 ca 0d  3e 76 0b c9 20 30 3a 3d  |,".") ..>v.. 0:=|
0000d730  66 24 0d 3e 80 30 7f 3a  3d a4 47 65 74 46 69 6c  |f$.>.0.:=.GetFil|
0000d740  65 46 72 6f 6d 50 61 74  68 6e 61 6d 65 28 c2 66  |eFromPathname(.f|
0000d750  24 2c a9 28 66 24 29 2d  a7 66 24 2c 22 2e 22 29  |$,.(f$)-.f$,".")|
0000d760  29 29 0d 3e 8a 05 cb 0d  3e 94 05 3a 0d 3e 9e 29  |)).>....>..:.>.)|
0000d770  dd f2 53 74 61 72 74 28  54 61 73 6b 4e 61 6d 65  |..Start(TaskName|
0000d780  24 2c 77 69 6d 70 5f 6d  65 6d 6f 72 79 25 2c 69  |$,wimp_memory%,i|
0000d790  63 6f 6e 25 29 0d 3e a8  25 de 20 77 69 6d 70 25  |con%).>.%. wimp%|
0000d7a0  20 77 69 6d 70 5f 6d 65  6d 6f 72 79 25 2c 69 63  | wimp_memory%,ic|
0000d7b0  6f 6e 73 25 20 69 63 6f  6e 25 0d 3e b2 29 e7 20  |ons% icon%.>.). |
0000d7c0  77 69 6d 70 5f 6d 65 6d  6f 72 79 25 3c 32 35 36  |wimp_memory%<256|
0000d7d0  20 8c 20 77 69 6d 70 5f  6d 65 6d 6f 72 79 25 3d  | . wimp_memory%=|
0000d7e0  32 35 36 0d 3e bc 1d 69  63 6f 6e 5f 6d 65 6d 6f  |256.>..icon_memo|
0000d7f0  72 79 25 3d 69 63 6f 6e  73 25 2b 69 63 6f 6e 25  |ry%=icons%+icon%|
0000d800  0d 3e c6 13 74 61 73 6b  24 3d 54 61 73 6b 4e 61  |.>..task$=TaskNa|
0000d810  6d 65 24 0d 3e d0 29 69  6e 64 69 72 65 63 74 5f  |me$.>.)indirect_|
0000d820  73 70 72 69 74 65 73 25  3d 31 3a 64 69 72 65 63  |sprites%=1:direc|
0000d830  74 5f 73 70 72 69 74 65  73 25 3d 31 0d 3e da 16  |t_sprites%=1.>..|
0000d840  f2 53 65 74 45 76 65 6e  74 56 61 72 69 61 62 6c  |.SetEventVariabl|
0000d850  65 73 0d 3e e4 40 c8 99  22 57 69 6d 70 5f 49 6e  |es.>.@.."Wimp_In|
0000d860  69 74 69 61 6c 69 73 65  22 2c 32 30 30 2c 26 34  |itialise",200,&4|
0000d870  42 35 33 34 31 35 34 2c  54 61 73 6b 4e 61 6d 65  |B534154,TaskName|
0000d880  24 20 b8 20 76 65 72 73  69 6f 6e 25 2c 74 61 73  |$ . version%,tas|
0000d890  6b 25 0d 3e ee 05 e1 0d  3e f8 05 3a 0d 3f 02 17  |k%.>....>..:.?..|
0000d8a0  dd f2 53 65 74 45 76 65  6e 74 56 61 72 69 61 62  |..SetEventVariab|
0000d8b0  6c 65 73 0d 3f 0c 17 de  20 70 6f 69 6e 74 65 72  |les.?... pointer|
0000d8c0  5f 62 6c 6f 63 6b 25 20  32 30 0d 3f 16 29 6e 75  |_block% 20.?.)nu|
0000d8d0  6c 6c 25 3d 31 3a 64 72  61 77 25 3d 32 3a 70 6f  |ll%=1:draw%=2:po|
0000d8e0  69 6e 74 65 72 5f 6c 65  61 76 69 6e 67 25 3d 31  |inter_leaving%=1|
0000d8f0  3c 3c 34 0d 3f 20 31 70  6f 69 6e 74 65 72 5f 65  |<<4.? 1pointer_e|
0000d900  6e 74 65 72 69 6e 67 25  3d 31 3c 3c 35 3a 6d 6f  |ntering%=1<<5:mo|
0000d910  75 73 65 25 3d 31 3c 3c  36 3a 64 72 61 67 25 3d  |use%=1<<6:drag%=|
0000d920  31 3c 3c 37 0d 3f 2a 26  6b 65 79 25 3d 31 3c 3c  |1<<7.?*&key%=1<<|
0000d930  38 3a 6d 65 6e 75 25 3d  31 3c 3c 39 3a 73 63 72  |8:menu%=1<<9:scr|
0000d940  6f 6c 6c 25 3d 31 3c 3c  31 30 0d 3f 34 40 6c 6f  |oll%=1<<10.?4@lo|
0000d950  73 65 5f 63 61 72 65 74  25 3d 31 3c 3c 31 31 3a  |se_caret%=1<<11:|
0000d960  67 61 69 6e 5f 63 61 72  65 74 25 3d 31 3c 3c 31  |gain_caret%=1<<1|
0000d970  32 3a 6d 65 73 73 61 67  65 25 3d 28 31 3c 3c 31  |2:message%=(1<<1|
0000d980  37 29 2b 28 31 3c 3c 31  38 29 0d 3f 3e 30 72 65  |7)+(1<<18).?>0re|
0000d990  63 6f 72 64 65 72 25 3d  31 3c 3c 31 38 3a 61 63  |corder%=1<<18:ac|
0000d9a0  6b 6e 6f 77 6c 65 64 67  65 25 3d 31 3c 3c 31 39  |knowledge%=1<<19|
0000d9b0  3a 77 69 6e 64 6f 77 25  3d 30 0d 3f 48 21 73 70  |:window%=0.?H!sp|
0000d9c0  72 69 74 65 73 25 3d 31  3a 76 65 72 73 69 6f 6e  |rites%=1:version|
0000d9d0  25 3d 30 3a 74 61 73 6b  25 3d 30 0d 3f 52 2a 42  |%=0:task%=0.?R*B|
0000d9e0  61 72 5f 57 69 6e 64 6f  77 25 3d 2d 32 3a 42 61  |ar_Window%=-2:Ba|
0000d9f0  72 5f 49 63 6f 6e 25 3d  30 3a 42 61 72 5f 4d 65  |r_Icon%=0:Bar_Me|
0000da00  6e 75 25 3d 30 0d 3f 5c  2a 78 5f 6f 72 69 67 69  |nu%=0.?\*x_origi|
0000da10  6e 25 3d 30 3a 79 5f 6f  72 69 67 69 6e 25 3d 30  |n%=0:y_origin%=0|
0000da20  3a 53 61 76 65 57 69 6e  64 6f 77 25 3d 2d 33 0d  |:SaveWindow%=-3.|
0000da30  3f 66 33 6d 65 73 73 61  67 65 5f 71 75 69 74 25  |?f3message_quit%|
0000da40  3d 30 3a 6d 65 73 73 61  67 65 5f 73 61 76 65 25  |=0:message_save%|
0000da50  3d 32 3a 6d 65 73 73 61  67 65 5f 6c 6f 61 64 25  |=2:message_load%|
0000da60  3d 33 0d 3f 70 21 6d 6f  75 73 65 5f 62 75 74 74  |=3.?p!mouse_butt|
0000da70  6f 6e 25 3d 32 3a 73 61  76 65 5f 65 76 65 6e 74  |on%=2:save_event|
0000da80  25 3d 30 0d 3f 7a 1e 74  6f 70 5f 6c 69 6e 65 25  |%=0.?z.top_line%|
0000da90  3d 30 3a 62 6f 74 74 6f  6d 5f 6c 69 6e 65 25 3d  |=0:bottom_line%=|
0000daa0  30 0d 3f 84 05 e1 0d 3f  8e 05 3a 0d 3f 98 0b dd  |0.?....?..:.?...|
0000dab0  f2 45 72 72 6f 72 0d 3f  a2 0a ea 58 24 2c 78 25  |.Error.?...X$,x%|
0000dac0  0d 3f ac 06 ef 33 0d 3f  b6 09 ee 20 85 20 87 0d  |.?...3.?... . ..|
0000dad0  3f c0 17 c8 99 22 48 6f  75 72 67 6c 61 73 73 5f  |?...."Hourglass_|
0000dae0  53 6d 61 73 68 22 0d 3f  ca 0e f2 4d 65 6e 75 43  |Smash".?...MenuC|
0000daf0  6c 6f 73 65 0d 3f d4 08  78 25 3d 9e 0d 3f de 10  |lose.?..x%=..?..|
0000db00  de 45 72 72 6f 72 4d 73  67 25 33 36 0d 3f e8 45  |.ErrorMsg%36.?.E|
0000db10  45 72 72 6f 72 4d 73 67  25 21 30 3d 33 36 3a 45  |ErrorMsg%!0=36:E|
0000db20  72 72 6f 72 4d 73 67 25  21 31 32 3d 30 3a 45 72  |rrorMsg%!12=0:Er|
0000db30  72 6f 72 4d 73 67 25 21  31 36 3d 26 38 31 30 38  |rorMsg%!16=&8108|
0000db40  30 3a 45 72 72 6f 72 4d  73 67 25 21 32 30 3d 78  |0:ErrorMsg%!20=x|
0000db50  25 0d 3f f2 1f 24 28 45  72 72 6f 72 4d 73 67 25  |%.?..$(ErrorMsg%|
0000db60  2b 32 34 29 3d 22 21 52  75 6e 49 6d 61 67 65 22  |+24)="!RunImage"|
0000db70  0d 3f fc 25 c8 99 22 57  69 6d 70 5f 53 65 6e 64  |.?.%.."Wimp_Send|
0000db80  4d 65 73 73 61 67 65 22  2c 31 37 2c 45 72 72 6f  |Message",17,Erro|
0000db90  72 4d 73 67 25 0d 40 06  17 f2 41 6c 65 72 74 28  |rMsg%.@...Alert(|
0000dba0  74 61 73 6b 24 2c f6 24  2b c3 9e 29 0d 40 10 05  |task$,.$+..).@..|
0000dbb0  cb 0d 40 1a 05 e1 0d 40  24 05 3a 0d 40 2e 0f dd  |..@....@$.:.@...|
0000dbc0  f2 43 6c 6f 73 65 44 6f  77 6e 0d 40 38 1a ef 33  |.CloseDown.@8..3|
0000dbd0  3a c8 99 22 48 6f 75 72  67 6c 61 73 73 5f 53 6d  |:.."Hourglass_Sm|
0000dbe0  61 73 68 22 0d 40 42 23  c8 99 22 57 69 6d 70 5f  |ash".@B#.."Wimp_|
0000dbf0  43 6c 6f 73 65 44 6f 77  6e 22 2c 74 61 73 6b 25  |CloseDown",task%|
0000dc00  2c 22 54 41 53 4b 22 0d  40 4c 05 e1 0d 40 56 05  |,"TASK".@L...@V.|
0000dc10  3a 0d 40 60 0a dd f2 51  75 69 74 0d 40 6a 0f 66  |:.@`...Quit.@j.f|
0000dc20  69 6e 69 73 68 65 64 25  3d b9 0d 40 74 05 e1 0d  |inished%=..@t...|
0000dc30  40 7e 05 3a 0d 40 88 0a  dd f2 70 6f 6c 6c 0d 40  |@~.:.@....poll.@|
0000dc40  92 12 ea 20 6d 61 73 6b  25 2c 65 76 65 6e 74 25  |... mask%,event%|
0000dc50  0d 40 9c 0f 66 69 6e 69  73 68 65 64 25 3d a3 0d  |.@..finished%=..|
0000dc60  40 a6 17 6d 61 73 6b 25  3d 25 31 31 31 30 30 30  |@..mask%=%111000|
0000dc70  30 31 31 30 30 31 0d 40  b0 05 f5 0d 40 ba 26 c8  |011001.@....@.&.|
0000dc80  99 22 57 69 6d 70 5f 50  6f 6c 6c 22 2c 6d 61 73  |."Wimp_Poll",mas|
0000dc90  6b 25 2c 77 69 6d 70 25  20 b8 20 65 76 65 6e 74  |k%,wimp% . event|
0000dca0  25 0d 40 c4 0f c8 8e 20  65 76 65 6e 74 25 20 ca  |%.@.... event% .|
0000dcb0  0d 40 ce 06 c9 30 0d 40  d8 16 c9 31 3a f2 50 6f  |.@...0.@...1:.Po|
0000dcc0  6c 6c 44 72 61 77 57 69  6e 64 6f 77 0d 40 e2 22  |llDrawWindow.@."|
0000dcd0  c9 32 3a c8 99 20 22 57  69 6d 70 5f 4f 70 65 6e  |.2:.. "Wimp_Open|
0000dce0  57 69 6e 64 6f 77 22 2c  2c 77 69 6d 70 25 0d 40  |Window",,wimp%.@|
0000dcf0  ec 17 c9 33 3a f2 50 6f  6c 6c 43 6c 6f 73 65 57  |...3:.PollCloseW|
0000dd00  69 6e 64 6f 77 0d 40 f6  06 c9 34 0d 41 00 06 c9  |indow.@...4.A...|
0000dd10  35 0d 41 0a 16 c9 36 3a  f2 50 6f 6c 6c 4d 6f 75  |5.A...6:.PollMou|
0000dd20  73 65 43 6c 69 63 6b 0d  41 14 17 c9 37 3a f2 50  |seClick.A...7:.P|
0000dd30  6f 6c 6c 53 61 76 65 4d  65 73 73 61 67 65 0d 41  |ollSaveMessage.A|
0000dd40  1e 14 c9 38 3a f2 50 6f  6c 6c 4b 65 79 50 72 65  |...8:.PollKeyPre|
0000dd50  73 73 0d 41 28 1f c9 39  3a f2 45 76 65 6e 74 5f  |ss.A(..9:.Event_|
0000dd60  4d 65 6e 75 43 68 6f 69  63 65 28 6d 65 6e 75 25  |MenuChoice(menu%|
0000dd70  29 0d 41 32 07 c9 31 30  0d 41 3c 07 c9 31 31 0d  |).A2..10.A<..11.|
0000dd80  41 46 07 c9 31 32 0d 41  50 18 c9 31 37 2c 31 38  |AF..12.AP..17,18|
0000dd90  3a f2 50 6f 6c 6c 4d 65  73 73 61 67 65 73 0d 41  |:.PollMessages.A|
0000dda0  5a 07 c9 31 39 0d 41 64  05 cb 0d 41 6e 0f fd 20  |Z..19.Ad...An.. |
0000ddb0  66 69 6e 69 73 68 65 64  25 0d 41 78 05 e1 0d 41  |finished%.Ax...A|
0000ddc0  82 05 3a 0d 41 8c 14 dd  f2 50 6f 6c 6c 44 72 61  |..:.A....PollDra|
0000ddd0  77 57 69 6e 64 6f 77 0d  41 96 0b ea 20 6d 6f 72  |wWindow.A... mor|
0000dde0  65 25 0d 41 a0 26 c8 99  22 57 69 6d 70 5f 52 65  |e%.A.&.."Wimp_Re|
0000ddf0  64 72 61 77 57 69 6e 64  6f 77 22 2c 2c 77 69 6d  |drawWindow",,wim|
0000de00  70 25 b8 6d 6f 72 65 25  0d 41 aa 13 77 69 6e 64  |p%.more%.A..wind|
0000de10  6f 77 25 3d 77 69 6d 70  25 21 30 0d 41 b4 41 78  |ow%=wimp%!0.A.Ax|
0000de20  5f 6f 72 69 67 69 6e 25  3d 31 36 2b 77 69 6d 70  |_origin%=16+wimp|
0000de30  25 21 34 2d 77 69 6d 70  25 21 32 30 3a 79 5f 6f  |%!4-wimp%!20:y_o|
0000de40  72 69 67 69 6e 25 3d 2d  31 36 2b 77 69 6d 70 25  |rigin%=-16+wimp%|
0000de50  21 31 36 2d 77 69 6d 70  25 21 32 34 0d 41 be 0b  |!16-wimp%!24.A..|
0000de60  c8 95 6d 6f 72 65 25 0d  41 c8 20 c8 99 22 57 69  |..more%.A. .."Wi|
0000de70  6d 70 5f 42 6f 72 64 65  72 57 69 6e 64 6f 77 22  |mp_BorderWindow"|
0000de80  2c 2c 77 69 6d 70 25 0d  41 d2 2c f2 45 76 65 6e  |,,wimp%.A.,.Even|
0000de90  74 5f 44 72 61 77 28 77  69 6e 64 6f 77 25 2c 78  |t_Draw(window%,x|
0000dea0  5f 6f 72 69 67 69 6e 25  2c 79 5f 6f 72 69 67 69  |_origin%,y_origi|
0000deb0  6e 25 29 0d 41 dc 26 c8  99 22 57 69 6d 70 5f 47  |n%).A.&.."Wimp_G|
0000dec0  65 74 52 65 63 74 61 6e  67 6c 65 22 2c 2c 77 69  |etRectangle",,wi|
0000ded0  6d 70 25 b8 6d 6f 72 65  25 0d 41 e6 05 ce 0d 41  |mp%.more%.A....A|
0000dee0  f0 05 e1 0d 41 fa 05 3a  0d 42 04 15 dd f2 50 6f  |....A..:.B....Po|
0000def0  6c 6c 43 6c 6f 73 65 57  69 6e 64 6f 77 0d 42 0e  |llCloseWindow.B.|
0000df00  23 c8 99 20 22 57 69 6d  70 5f 47 65 74 50 6f 69  |#.. "Wimp_GetPoi|
0000df10  6e 74 65 72 49 6e 66 6f  22 2c 2c 77 69 6d 70 25  |nterInfo",,wimp%|
0000df20  0d 42 18 25 77 69 6e 64  6f 77 25 3d 77 69 6d 70  |.B.%window%=wimp|
0000df30  25 21 31 32 3a 62 75 74  74 6f 6e 73 25 3d 77 69  |%!12:buttons%=wi|
0000df40  6d 70 25 21 38 0d 42 22  28 f2 45 76 65 6e 74 5f  |mp%!8.B"(.Event_|
0000df50  57 69 6e 64 6f 77 43 6c  6f 73 65 28 77 69 6e 64  |WindowClose(wind|
0000df60  6f 77 25 2c 62 75 74 74  6f 6e 73 25 29 0d 42 2c  |ow%,buttons%).B,|
0000df70  2f 21 77 69 6d 70 25 3d  77 69 6e 64 6f 77 25 3a  |/!wimp%=window%:|
0000df80  c8 99 20 22 57 69 6d 70  5f 43 6c 6f 73 65 57 69  |.. "Wimp_CloseWi|
0000df90  6e 64 6f 77 22 2c 2c 77  69 6d 70 25 0d 42 36 05  |ndow",,wimp%.B6.|
0000dfa0  e1 0d 42 40 05 3a 0d 42  4a 14 dd f2 50 6f 6c 6c  |..B@.:.BJ...Poll|
0000dfb0  4d 6f 75 73 65 43 6c 69  63 6b 0d 42 54 49 62 75  |MouseClick.BTIbu|
0000dfc0  74 74 6f 6e 25 3d 77 69  6d 70 25 21 38 3a 77 69  |tton%=wimp%!8:wi|
0000dfd0  6e 64 6f 77 25 3d 77 69  6d 70 25 21 31 32 3a 69  |ndow%=wimp%!12:i|
0000dfe0  63 6f 6e 25 3d 77 69 6d  70 25 21 31 36 3a 78 25  |con%=wimp%!16:x%|
0000dff0  3d 77 69 6d 70 25 21 30  3a 79 25 3d 77 69 6d 70  |=wimp%!0:y%=wimp|
0000e000  25 21 34 0d 42 5e 21 78  5f 6f 72 69 67 69 6e 25  |%!4.B^!x_origin%|
0000e010  3d 77 69 6d 70 25 21 34  2d 77 69 6d 70 25 21 32  |=wimp%!4-wimp%!2|
0000e020  30 2b 31 36 0d 42 68 10  c8 8e 20 62 75 74 74 6f  |0+16.Bh... butto|
0000e030  6e 25 20 ca 0d 42 72 15  c9 32 3a f2 50 6f 6c 6c  |n% ..Br..2:.Poll|
0000e040  4d 65 6e 75 50 6f 70 55  70 0d 42 7c 1f 7f 3a c8  |MenuPopUp.B|..:.|
0000e050  8e 20 a4 45 76 65 6e 74  5f 53 61 76 65 28 77 69  |. .Event_Save(wi|
0000e060  6e 64 6f 77 25 29 20 ca  0d 42 86 16 c9 20 b9 3a  |ndow%) ..B... .:|
0000e070  f2 50 6f 6c 6c 4d 6f 75  73 65 53 61 76 65 0d 42  |.PollMouseSave.B|
0000e080  90 1c c9 20 a3 3a f2 50  6f 6c 6c 45 76 65 6e 74  |... .:.PollEvent|
0000e090  4d 6f 75 73 65 43 6c 69  63 6b 0d 42 9a 05 cb 0d  |MouseClick.B....|
0000e0a0  42 a4 05 cb 0d 42 ae 05  e1 0d 42 b8 05 3a 0d 42  |B....B....B..:.B|
0000e0b0  c2 13 dd f2 50 6f 6c 6c  4d 65 6e 75 50 6f 70 55  |....PollMenuPopU|
0000e0c0  70 0d 42 cc 1e 6d 65 6e  75 25 3d a4 45 76 65 6e  |p.B..menu%=.Even|
0000e0d0  74 5f 4d 65 6e 75 28 77  69 6e 64 6f 77 25 29 0d  |t_Menu(window%).|
0000e0e0  42 d6 0f c8 8e 20 6d 65  6e 75 25 20 20 ca 0d 42  |B.... menu%  ..B|
0000e0f0  e0 07 c9 20 a3 0d 42 ea  05 7f 0d 42 f4 10 c8 8e  |... ..B....B....|
0000e100  20 77 69 6e 64 6f 77 25  20 ca 0d 42 fe 0d c9 20  | window% ..B... |
0000e110  2d 32 3a 6e 25 3d 30 0d  43 08 2b c8 95 20 28 28  |-2:n%=0.C.+.. ((|
0000e120  42 61 72 5f 4d 65 6e 75  25 21 28 32 38 2b 6e 25  |Bar_Menu%!(28+n%|
0000e130  2a 32 34 29 29 80 25 31  30 30 30 30 30 30 30 29  |*24)).%10000000)|
0000e140  3d 30 0d 43 12 09 6e 25  2b 3d 31 0d 43 1c 05 ce  |=0.C..n%+=1.C...|
0000e150  0d 43 26 35 c8 99 20 22  57 69 6d 70 5f 43 72 65  |.C&5.. "Wimp_Cre|
0000e160  61 74 65 4d 65 6e 75 22  2c 2c 42 61 72 5f 4d 65  |ateMenu",,Bar_Me|
0000e170  6e 75 25 2c 78 25 2d 36  34 2c 39 36 2b 6e 25 2a  |nu%,x%-64,96+n%*|
0000e180  34 34 2b 34 34 0d 43 30  2c 7f 3a c8 99 22 57 69  |44+44.C0,.:.."Wi|
0000e190  6d 70 5f 43 72 65 61 74  65 4d 65 6e 75 22 2c 2c  |mp_CreateMenu",,|
0000e1a0  6d 65 6e 75 25 2c 78 25  2d 36 34 2c 79 25 2b 32  |menu%,x%-64,y%+2|
0000e1b0  30 0d 43 3a 05 cb 0d 43  44 05 cb 0d 43 4e 27 77  |0.C:...CD...CN'w|
0000e1c0  73 71 74 69 74 6c 65 24  3d a4 49 63 6f 6e 54 65  |sqtitle$=.IconTe|
0000e1d0  78 74 28 6d 61 69 6e 5f  57 69 6e 64 6f 77 25 2c  |xt(main_Window%,|
0000e1e0  39 29 0d 43 58 05 e1 0d  43 62 05 3a 0d 43 6c 13  |9).CX...Cb.:.Cl.|
0000e1f0  dd f2 50 6f 6c 6c 4d 6f  75 73 65 53 61 76 65 0d  |..PollMouseSave.|
0000e200  43 76 0e c8 8e 20 69 63  6f 6e 25 20 ca 0d 43 80  |Cv... icon% ..C.|
0000e210  2f c9 20 30 3a e7 20 62  75 74 74 6f 6e 25 20 80  |/. 0:. button% .|
0000e220  20 26 35 30 20 8c 20 f2  50 6f 6c 6c 44 72 61 67  | &50 . .PollDrag|
0000e230  42 6f 78 28 77 69 6e 64  6f 77 25 29 0d 43 8a 2f  |Box(window%).C./|
0000e240  c9 20 32 3a e7 20 62 75  74 74 6f 6e 25 20 80 20  |. 2:. button% . |
0000e250  35 20 8c 20 20 f2 50 6f  6c 6c 53 61 76 65 46 69  |5 .  .PollSaveFi|
0000e260  6c 65 28 77 69 6e 64 6f  77 25 29 0d 43 94 05 cb  |le(window%).C...|
0000e270  0d 43 9e 05 e1 0d 43 a8  05 3a 0d 43 b2 19 dd f2  |.C....C..:.C....|
0000e280  50 6f 6c 6c 45 76 65 6e  74 4d 6f 75 73 65 43 6c  |PollEventMouseCl|
0000e290  69 63 6b 0d 43 bc 1e c8  99 22 57 69 6d 70 5f 42  |ick.C...."Wimp_B|
0000e2a0  6f 72 64 65 72 49 63 6f  6e 22 2c 2c 77 69 6d 70  |orderIcon",,wimp|
0000e2b0  25 0d 43 c6 32 f2 45 76  65 6e 74 5f 4d 6f 75 73  |%.C.2.Event_Mous|
0000e2c0  65 43 6c 69 63 6b 28 77  69 6e 64 6f 77 25 2c 69  |eClick(window%,i|
0000e2d0  63 6f 6e 25 2c 62 75 74  74 6f 6e 25 2c 78 25 2c  |con%,button%,x%,|
0000e2e0  79 25 29 0d 43 d0 23 77  69 6d 70 25 21 30 3d 78  |y%).C.#wimp%!0=x|
0000e2f0  25 3a 77 69 6d 70 25 21  34 3d 79 25 3a 77 69 6d  |%:wimp%!4=y%:wim|
0000e300  70 25 21 38 3d 30 0d 43  da 23 77 69 6d 70 25 21  |p%!8=0.C.#wimp%!|
0000e310  31 32 3d 77 69 6e 64 6f  77 25 3a 77 69 6d 70 25  |12=window%:wimp%|
0000e320  21 31 36 3d 69 63 6f 6e  25 0d 43 e4 1e c8 99 22  |!16=icon%.C...."|
0000e330  57 69 6d 70 5f 42 6f 72  64 65 72 49 63 6f 6e 22  |Wimp_BorderIcon"|
0000e340  2c 2c 77 69 6d 70 25 0d  43 ee 05 e1 0d 43 f8 05  |,,wimp%.C....C..|
0000e350  3a 0d 44 02 1b dd f2 50  6f 6c 6c 53 61 76 65 46  |:.D....PollSaveF|
0000e360  69 6c 65 28 77 69 6e 64  6f 77 25 29 0d 44 0c 0a  |ile(window%).D..|
0000e370  ea 66 69 6c 65 24 0d 44  16 3b 77 69 6d 70 25 21  |.file$.D.;wimp%!|
0000e380  30 3d 77 69 6e 64 6f 77  25 3a 77 69 6d 70 25 21  |0=window%:wimp%!|
0000e390  34 3d 31 3a c8 99 20 22  57 69 6d 70 5f 47 65 74  |4=1:.. "Wimp_Get|
0000e3a0  49 63 6f 6e 53 74 61 74  65 22 2c 2c 77 69 6d 70  |IconState",,wimp|
0000e3b0  25 0d 44 20 15 66 69 6c  65 24 3d 24 28 77 69 6d  |%.D .file$=$(wim|
0000e3c0  70 25 21 32 38 29 0d 44  2a 14 c8 8e 20 a7 66 69  |p%!28).D*... .fi|
0000e3d0  6c 65 24 2c 22 2e 22 29  20 ca 0d 44 34 07 c9 20  |le$,".") ..D4.. |
0000e3e0  30 0d 44 3e 3d 24 28 77  69 6d 70 25 2b 34 29 3d  |0.D>=$(wimp%+4)=|
0000e3f0  22 54 6f 20 73 61 76 65  2c 20 64 72 61 67 20 74  |"To save, drag t|
0000e400  68 65 20 69 63 6f 6e 20  74 6f 20 61 20 64 69 72  |he icon to a dir|
0000e410  65 63 74 6f 72 79 20 77  69 6e 64 6f 77 22 0d 44  |ectory window".D|
0000e420  48 28 c8 99 20 22 57 69  6d 70 5f 52 65 70 6f 72  |H(.. "Wimp_Repor|
0000e430  74 45 72 72 6f 72 22 2c  77 69 6d 70 25 2c 31 36  |tError",wimp%,16|
0000e440  2c 74 61 73 6b 24 0d 44  52 05 7f 0d 44 5c 22 f2  |,task$.DR...D\".|
0000e450  45 76 65 6e 74 5f 53 61  76 65 46 69 6c 65 28 66  |Event_SaveFile(f|
0000e460  69 6c 65 24 2c 77 69 6e  64 6f 77 25 29 0d 44 66  |ile$,window%).Df|
0000e470  05 cb 0d 44 70 1a c8 99  22 57 69 6d 70 5f 43 72  |...Dp..."Wimp_Cr|
0000e480  65 61 74 65 4d 65 6e 75  22 2c 2d 31 0d 44 7a 05  |eateMenu",-1.Dz.|
0000e490  e1 0d 44 84 05 3a 0d 44  8e 1a dd f2 50 6f 6c 6c  |..D..:.D....Poll|
0000e4a0  44 72 61 67 42 6f 78 28  77 69 6e 64 6f 77 25 29  |DragBox(window%)|
0000e4b0  0d 44 98 0a ea 78 25 2c  79 25 0d 44 a2 11 73 61  |.D...x%,y%.D..sa|
0000e4c0  76 65 25 3d 77 69 6e 64  6f 77 25 0d 44 ac 12 21  |ve%=window%.D..!|
0000e4d0  77 69 6d 70 25 3d 77 69  6e 64 6f 77 25 0d 44 b6  |wimp%=window%.D.|
0000e4e0  22 c8 99 22 57 69 6d 70  5f 47 65 74 57 69 6e 64  |".."Wimp_GetWind|
0000e4f0  6f 77 53 74 61 74 65 22  2c 2c 77 69 6d 70 25 0d  |owState",,wimp%.|
0000e500  44 c0 2c 78 25 3d 77 69  6d 70 25 21 34 2d 77 69  |D.,x%=wimp%!4-wi|
0000e510  6d 70 25 21 32 30 3a 79  25 3d 77 69 6d 70 25 21  |mp%!20:y%=wimp%!|
0000e520  31 36 2d 77 69 6d 70 25  21 32 34 0d 44 ca 0d 77  |16-wimp%!24.D..w|
0000e530  69 6d 70 25 21 34 3d 30  0d 44 d4 20 c8 99 22 57  |imp%!4=0.D. .."W|
0000e540  69 6d 70 5f 47 65 74 49  63 6f 6e 53 74 61 74 65  |imp_GetIconState|
0000e550  22 2c 2c 77 69 6d 70 25  0d 44 de 12 21 77 69 6d  |",,wimp%.D..!wim|
0000e560  70 25 3d 77 69 6e 64 6f  77 25 0d 44 e8 0d 77 69  |p%=window%.D..wi|
0000e570  6d 70 25 21 34 3d 35 0d  44 f2 2b 77 69 6d 70 25  |mp%!4=5.D.+wimp%|
0000e580  21 38 3d 78 25 2b 77 69  6d 70 25 21 38 3a 77 69  |!8=x%+wimp%!8:wi|
0000e590  6d 70 25 21 31 32 3d 79  25 2b 77 69 6d 70 25 21  |mp%!12=y%+wimp%!|
0000e5a0  31 32 0d 44 fc 2d 77 69  6d 70 25 21 31 36 3d 78  |12.D.-wimp%!16=x|
0000e5b0  25 2b 77 69 6d 70 25 21  31 36 3a 77 69 6d 70 25  |%+wimp%!16:wimp%|
0000e5c0  21 32 30 3d 79 25 2b 77  69 6d 70 25 21 32 30 0d  |!20=y%+wimp%!20.|
0000e5d0  45 06 19 77 69 6d 70 25  21 32 34 3d 30 3a 77 69  |E..wimp%!24=0:wi|
0000e5e0  6d 70 25 21 32 38 3d 30  0d 45 10 29 77 69 6d 70  |mp%!28=0.E.)wimp|
0000e5f0  25 21 33 32 3d 26 37 46  46 46 46 46 46 46 3a 77  |%!32=&7FFFFFFF:w|
0000e600  69 6d 70 25 21 33 36 3d  26 37 46 46 46 46 46 46  |imp%!36=&7FFFFFF|
0000e610  46 0d 45 1a 1b c8 99 22  57 69 6d 70 5f 44 72 61  |F.E...."Wimp_Dra|
0000e620  67 42 6f 78 22 2c 2c 77  69 6d 70 25 0d 45 24 05  |gBox",,wimp%.E$.|
0000e630  e1 0d 45 2e 05 3a 0d 45  38 12 dd f2 50 6f 6c 6c  |..E..:.E8...Poll|
0000e640  4b 65 79 50 72 65 73 73  0d 45 42 2f 77 69 6e 64  |KeyPress.EB/wind|
0000e650  6f 77 25 3d 77 69 6d 70  25 21 30 3a 69 63 6f 6e  |ow%=wimp%!0:icon|
0000e660  25 3d 77 69 6d 70 25 21  34 3a 6b 65 79 25 3d 77  |%=wimp%!4:key%=w|
0000e670  69 6d 70 25 21 32 34 0d  45 4c 1d c8 8e 20 a4 45  |imp%!24.EL... .E|
0000e680  76 65 6e 74 5f 53 61 76  65 28 77 69 6e 64 6f 77  |vent_Save(window|
0000e690  25 29 20 ca 0d 45 56 23  c9 20 b9 3a f2 57 69 6d  |%) ..EV#. .:.Wim|
0000e6a0  70 50 6f 6c 6c 5f 53 61  76 65 46 69 6c 65 28 77  |pPoll_SaveFile(w|
0000e6b0  69 6e 64 6f 77 25 29 0d  45 60 2b c9 20 a3 3a f2  |indow%).E`+. .:.|
0000e6c0  45 76 65 6e 74 5f 4b 65  79 50 72 65 73 73 28 77  |Event_KeyPress(w|
0000e6d0  69 6e 64 6f 77 25 2c 69  63 6f 6e 25 2c 6b 65 79  |indow%,icon%,key|
0000e6e0  25 29 0d 45 6a 05 cb 0d  45 74 05 e1 0d 45 7e 05  |%).Ej...Et...E~.|
0000e6f0  3a 0d 45 88 15 dd f2 50  6f 6c 6c 53 61 76 65 4d  |:.E....PollSaveM|
0000e700  65 73 73 61 67 65 0d 45  92 1e ea 66 69 6c 65 24  |essage.E...file$|
0000e710  2c 77 69 6e 64 6f 77 25  2c 69 63 6f 6e 25 2c 78  |,window%,icon%,x|
0000e720  25 2c 79 25 0d 45 9c 22  c8 99 22 57 69 6d 70 5f  |%,y%.E.".."Wimp_|
0000e730  47 65 74 50 6f 69 6e 74  65 72 49 6e 66 6f 22 2c  |GetPointerInfo",|
0000e740  2c 77 69 6d 70 25 0d 45  a6 39 77 69 6e 64 6f 77  |,wimp%.E.9window|
0000e750  25 3d 77 69 6d 70 25 21  31 32 3a 69 63 6f 6e 25  |%=wimp%!12:icon%|
0000e760  3d 77 69 6d 70 25 21 31  36 3a 78 25 3d 77 69 6d  |=wimp%!16:x%=wim|
0000e770  70 25 21 30 3a 79 25 3d  77 69 6d 70 25 21 34 0d  |p%!0:y%=wimp%!4.|
0000e780  45 b0 39 77 69 6d 70 25  21 30 3d 73 61 76 65 25  |E.9wimp%!0=save%|
0000e790  3a 77 69 6d 70 25 21 34  3d 31 3a c8 99 20 22 57  |:wimp%!4=1:.. "W|
0000e7a0  69 6d 70 5f 47 65 74 49  63 6f 6e 53 74 61 74 65  |imp_GetIconState|
0000e7b0  22 2c 2c 77 69 6d 70 25  0d 45 ba 15 66 69 6c 65  |",,wimp%.E..file|
0000e7c0  24 3d 24 28 77 69 6d 70  25 21 32 38 29 0d 45 c4  |$=$(wimp%!28).E.|
0000e7d0  25 66 69 6c 65 24 3d a4  47 65 74 46 69 6c 65 46  |%file$=.GetFileF|
0000e7e0  72 6f 6d 50 61 74 68 6e  61 6d 65 28 66 69 6c 65  |romPathname(file|
0000e7f0  24 29 0d 45 ce 14 77 69  6d 70 25 21 32 30 3d 77  |$).E..wimp%!20=w|
0000e800  69 6e 64 6f 77 25 0d 45  d8 12 77 69 6d 70 25 21  |indow%.E..wimp%!|
0000e810  32 34 3d 69 63 6f 6e 25  0d 45 e2 1b 77 69 6d 70  |24=icon%.E..wimp|
0000e820  25 21 32 38 3d 78 25 3a  77 69 6d 70 25 21 33 32  |%!28=x%:wimp%!32|
0000e830  3d 79 25 0d 45 ec 14 77  69 6d 70 25 21 33 36 3d  |=y%.E..wimp%!36=|
0000e840  6c 65 6e 67 74 68 25 0d  45 f6 0e 77 69 6d 70 25  |length%.E..wimp%|
0000e850  21 30 3d 36 34 0d 46 00  0e 77 69 6d 70 25 21 31  |!0=64.F..wimp%!1|
0000e860  32 3d 30 0d 46 0a 0e 77  69 6d 70 25 21 31 36 3d  |2=0.F..wimp%!16=|
0000e870  31 0d 46 14 11 77 69 6d  70 25 21 34 30 3d 26 46  |1.F..wimp%!40=&F|
0000e880  46 46 0d 46 1e 15 24 28  77 69 6d 70 25 2b 34 34  |FF.F..$(wimp%+44|
0000e890  29 3d 66 69 6c 65 24 0d  46 28 33 c8 99 22 57 69  |)=file$.F(3.."Wi|
0000e8a0  6d 70 5f 53 65 6e 64 4d  65 73 73 61 67 65 22 2c  |mp_SendMessage",|
0000e8b0  31 37 2c 77 69 6d 70 25  2c 77 69 6d 70 25 21 32  |17,wimp%,wimp%!2|
0000e8c0  30 2c 77 69 6d 70 25 21  32 34 0d 46 32 05 e1 0d  |0,wimp%!24.F2...|
0000e8d0  46 3c 05 3a 0d 46 46 12  dd f2 50 6f 6c 6c 4d 65  |F<.:.FF...PollMe|
0000e8e0  73 73 61 67 65 73 0d 46  50 0b ea 20 66 69 6c 65  |ssages.FP.. file|
0000e8f0  24 0d 46 5a 27 66 69 6c  65 24 3d a4 47 65 74 53  |$.FZ'file$=.GetS|
0000e900  74 72 69 6e 67 41 74 41  64 64 72 65 73 73 28 77  |tringAtAddress(w|
0000e910  69 6d 70 25 2b 34 34 29  0d 46 64 1f 62 6c 6f 63  |imp%+44).Fd.bloc|
0000e920  6b 25 3d 77 69 6d 70 25  21 31 36 3a c8 8e 20 62  |k%=wimp%!16:.. b|
0000e930  6c 6f 63 6b 25 20 ca 0d  46 6e 13 c9 20 30 3a 66  |lock% ..Fn.. 0:f|
0000e940  69 6e 69 73 68 65 64 25  3d b9 0d 46 78 07 c9 20  |inished%=..Fx.. |
0000e950  31 0d 46 82 3e 21 77 69  6d 70 25 3d 28 34 38 2b  |1.F.>!wimp%=(48+|
0000e960  31 36 29 20 80 ac 33 3a  77 69 6d 70 25 21 31 32  |16) ..3:wimp%!12|
0000e970  3d 77 69 6d 70 25 21 38  3a 77 69 6d 70 25 21 31  |=wimp%!8:wimp%!1|
0000e980  36 3d 32 3a 77 69 6d 70  25 21 33 36 3d 2d 31 0d  |6=2:wimp%!36=-1.|
0000e990  46 8c 2d 74 65 6d 70 24  3d 66 69 6c 65 24 3a 24  |F.-temp$=file$:$|
0000e9a0  28 77 69 6d 70 25 2b 34  34 29 3d 22 3c 57 69 6d  |(wimp%+44)="<Wim|
0000e9b0  70 24 53 63 72 61 70 3e  22 2b bd 30 0d 46 96 29  |p$Scrap>"+.0.F.)|
0000e9c0  c8 99 22 57 69 6d 70 5f  53 65 6e 64 4d 65 73 73  |.."Wimp_SendMess|
0000e9d0  61 67 65 22 2c 31 37 2c  77 69 6d 70 25 2c 77 69  |age",17,wimp%,wi|
0000e9e0  6d 70 25 21 34 0d 46 a0  09 e5 8d 50 58 47 0d 46  |mp%!4.F....PXG.F|
0000e9f0  aa 07 c9 20 32 0d 46 b4  20 f2 45 76 65 6e 74 5f  |... 2.F. .Event_|
0000ea00  53 61 76 65 46 69 6c 65  28 66 69 6c 65 24 2c 73  |SaveFile(file$,s|
0000ea10  61 76 65 25 29 0d 46 be  1f 77 69 6d 70 25 21 31  |ave%).F..wimp%!1|
0000ea20  32 3d 77 69 6d 70 25 21  38 3a 77 69 6d 70 25 21  |2=wimp%!8:wimp%!|
0000ea30  31 36 3d 33 0d 46 c8 33  c8 99 22 57 69 6d 70 5f  |16=3.F.3.."Wimp_|
0000ea40  53 65 6e 64 4d 65 73 73  61 67 65 22 2c 31 37 2c  |SendMessage",17,|
0000ea50  77 69 6d 70 25 2c 77 69  6d 70 25 21 32 30 2c 77  |wimp%,wimp%!20,w|
0000ea60  69 6d 70 25 21 32 34 0d  46 d2 37 e7 a7 66 69 6c  |imp%!24.F.7..fil|
0000ea70  65 24 2c 22 57 69 6d 70  24 53 63 72 61 70 22 29  |e$,"Wimp$Scrap")|
0000ea80  3d 30 20 f2 49 63 6f 6e  50 75 74 54 65 78 74 28  |=0 .IconPutText(|
0000ea90  73 61 76 65 25 2c 31 2c  66 69 6c 65 24 29 0d 46  |save%,1,file$).F|
0000eaa0  dc 07 c9 20 33 0d 46 e6  19 e7 74 65 6d 70 24 3d  |... 3.F...temp$=|
0000eab0  22 22 20 74 65 6d 70 24  3d 66 69 6c 65 24 0d 46  |"" temp$=file$.F|
0000eac0  f0 2f 74 79 70 65 25 3d  77 69 6d 70 25 21 34 30  |./type%=wimp%!40|
0000ead0  3a f2 45 76 65 6e 74 5f  4c 6f 61 64 46 69 6c 65  |:.Event_LoadFile|
0000eae0  28 66 69 6c 65 24 2c 74  79 70 65 25 29 0d 46 fa  |(file$,type%).F.|
0000eaf0  1a ff 22 52 45 4d 4f 56  45 20 3c 57 69 6d 70 24  |.."REMOVE <Wimp$|
0000eb00  53 63 72 61 70 3e 22 0d  47 04 0c 74 65 6d 70 24  |Scrap>".G..temp$|
0000eb10  3d 22 22 0d 47 0e 10 c9  20 26 35 30 32 3a f2 68  |="".G... &502:.h|
0000eb20  65 6c 70 0d 47 18 05 cb  0d 47 22 05 e1 0d 47 2c  |elp.G....G"...G,|
0000eb30  05 3a 0d 47 36 0a dd f2  68 65 6c 70 0d 47 40 23  |.:.G6...help.G@#|
0000eb40  77 69 6e 64 6f 77 25 3d  77 69 6d 70 25 21 33 32  |window%=wimp%!32|
0000eb50  3a 69 63 6f 6e 25 3d 77  69 6d 70 25 21 33 36 0d  |:icon%=wimp%!36.|
0000eb60  47 4a d5 e7 77 69 6e 64  6f 77 25 3d 2d 32 20 f2  |GJ..window%=-2 .|
0000eb70  73 65 6e 64 28 22 54 68  69 73 20 69 73 20 74 68  |send("This is th|
0000eb80  65 20 57 6f 72 64 53 71  20 69 63 6f 6e 2e 7c 4d  |e WordSq icon.|M|
0000eb90  43 6c 69 63 6b 20 53 45  4c 45 43 54 20 74 6f 20  |Click SELECT to |
0000eba0  63 72 65 61 74 65 20 6f  72 20 65 64 69 74 20 61  |create or edit a|
0000ebb0  20 77 6f 72 64 73 71 75  61 72 65 2e 7c 4d 43 6c  | wordsquare.|MCl|
0000ebc0  69 63 6b 20 4d 45 4e 55  20 74 6f 20 65 64 69 74  |ick MENU to edit|
0000ebd0  20 61 20 77 6f 72 64 73  71 75 61 72 65 2c 20 73  | a wordsquare, s|
0000ebe0  6f 6c 76 65 20 61 20 77  6f 72 64 73 71 75 61 72  |olve a wordsquar|
0000ebf0  65 2c 20 73 65 74 20 79  6f 75 72 20 70 72 65 66  |e, set your pref|
0000ec00  65 72 65 6e 63 65 73 20  6f 72 20 63 6c 65 61 72  |erences or clear|
0000ec10  20 61 6c 6c 20 77 6f 72  64 73 20 61 6e 64 20 67  | all words and g|
0000ec20  72 69 64 20 66 72 6f 6d  20 6d 65 6d 6f 72 79 2e  |rid from memory.|
0000ec30  22 29 3a e1 0d 47 54 7a  e7 77 69 6e 64 6f 77 25  |"):..GTz.window%|
0000ec40  3d 64 69 73 70 6c 61 79  5f 57 69 6e 64 6f 77 25  |=display_Window%|
0000ec50  20 f2 73 65 6e 64 28 22  54 68 69 73 20 69 73 20  | .send("This is |
0000ec60  74 68 65 20 64 69 73 70  6c 61 79 20 77 69 6e 64  |the display wind|
0000ec70  6f 77 2e 7c 4d 54 68 65  20 70 6f 73 69 74 69 6f  |ow.|MThe positio|
0000ec80  6e 73 20 6f 66 20 61 6e  79 20 68 69 67 68 6c 69  |ns of any highli|
0000ec90  67 68 74 65 64 20 77 6f  72 64 73 20 77 69 6c 6c  |ghted words will|
0000eca0  20 62 65 20 73 68 6f 77  6e 2e 22 29 3a e1 0d 47  | be shown."):..G|
0000ecb0  5e 8b e7 77 69 6e 64 6f  77 25 3d 77 6f 72 64 73  |^..window%=words|
0000ecc0  5f 57 69 6e 64 6f 77 25  20 80 20 69 63 6f 6e 25  |_Window% . icon%|
0000ecd0  3c 3e 32 20 80 20 69 63  6f 6e 25 3c 3e 33 20 f2  |<>2 . icon%<>3 .|
0000ece0  73 65 6e 64 28 22 54 68  69 73 20 69 73 20 74 68  |send("This is th|
0000ecf0  65 20 77 6f 72 64 73 20  77 69 6e 64 6f 77 2e 7c  |e words window.||
0000ed00  4d 49 74 20 73 68 6f 77  73 20 61 20 63 6f 6d 70  |MIt shows a comp|
0000ed10  6c 65 74 65 20 6c 69 73  74 20 6f 66 20 61 6c 6c  |lete list of all|
0000ed20  20 74 68 65 20 77 6f 72  64 73 20 69 6e 20 6d 65  | the words in me|
0000ed30  6d 6f 72 79 2e 22 29 3a  e1 0d 47 68 24 c8 99 20  |mory."):..Gh$.. |
0000ed40  22 57 69 6d 70 5f 53 65  6e 64 49 6e 66 6f 72 6d  |"Wimp_SendInform|
0000ed50  61 74 69 6f 6e 22 2c 2c  77 69 6d 70 25 0d 47 72  |ation",,wimp%.Gr|
0000ed60  05 e1 0d 47 7c 05 3a 0d  47 86 0e dd f2 73 65 6e  |...G|.:.G....sen|
0000ed70  64 28 64 24 29 0d 47 90  34 77 69 6d 70 25 21 31  |d(d$).G.4wimp%!1|
0000ed80  32 3d 77 69 6d 70 25 21  38 3a 77 69 6d 70 25 21  |2=wimp%!8:wimp%!|
0000ed90  31 36 3d 26 35 30 33 3a  24 28 77 69 6d 70 25 2b  |16=&503:$(wimp%+|
0000eda0  32 30 29 3d 64 24 2b bd  30 0d 47 9a 16 21 77 69  |20)=d$+.0.G..!wi|
0000edb0  6d 70 25 3d 28 32 35 2b  a9 64 24 29 80 ac 33 0d  |mp%=(25+.d$)..3.|
0000edc0  47 a4 29 c8 99 22 57 69  6d 70 5f 53 65 6e 64 4d  |G.).."Wimp_SendM|
0000edd0  65 73 73 61 67 65 22 2c  31 37 2c 77 69 6d 70 25  |essage",17,wimp%|
0000ede0  2c 77 69 6d 70 25 21 34  0d 47 ae 05 e1 0d 47 b8  |,wimp%!4.G....G.|
0000edf0  05 3a 0d 47 c2 20 dd 20  a4 4d 65 6e 75 43 72 65  |.:.G. . .MenuCre|
0000ee00  61 74 65 43 6f 6c 6f 75  72 73 28 74 69 74 6c 65  |ateColours(title|
0000ee10  24 29 0d 47 cc 13 ea 20  78 24 2c 6d 65 6e 25 2c  |$).G... x$,men%,|
0000ee20  6a 25 2c 69 25 0d 47 d6  36 78 24 3d 74 69 74 6c  |j%,i%.G.6x$=titl|
0000ee30  65 24 2b 22 5c 30 5c 31  5c 32 5c 33 5c 34 5c 35  |e$+"\0\1\2\3\4\5|
0000ee40  5c 36 5c 37 5c 38 5c 39  5c 31 30 5c 31 31 5c 31  |\6\7\8\9\10\11\1|
0000ee50  32 5c 31 33 5c 31 34 5c  31 35 22 0d 47 e0 18 6d  |2\13\14\15".G..m|
0000ee60  65 6e 25 3d a4 4d 65 6e  75 43 72 65 61 74 65 28  |en%=.MenuCreate(|
0000ee70  78 24 29 0d 47 ea 0f e3  20 69 25 3d 30 20 b8 20  |x$).G... i%=0 . |
0000ee80  31 35 0d 47 f4 0a c8 8e  20 b9 20 ca 0d 47 fe 28  |15.G.... . ..G.(|
0000ee90  c9 20 69 25 3c 34 2c 69  25 3d 39 2c 69 25 3d 31  |. i%<4,i%=9,i%=1|
0000eea0  32 2c 69 25 3d 31 34 2c  69 25 3d 31 35 20 3a 20  |2,i%=14,i%=15 : |
0000eeb0  6a 25 3d 37 0d 48 08 0c  7f 20 3a 20 6a 25 3d 30  |j%=7.H... : j%=0|
0000eec0  0d 48 12 05 cb 0d 48 1c  1c 6d 65 6e 25 3f 28 33  |.H....H..men%?(3|
0000eed0  39 2b 69 25 2a 32 34 29  3d 69 25 2a 31 36 2b 6a  |9+i%*24)=i%*16+j|
0000eee0  25 0d 48 26 1a f2 4d 65  6e 75 43 65 6e 74 72 65  |%.H&..MenuCentre|
0000eef0  28 6d 65 6e 25 2c 69 25  2b 31 29 0d 48 30 05 ed  |(men%,i%+1).H0..|
0000ef00  0d 48 3a 09 3d 6d 65 6e  25 0d 48 44 05 3a 0d 48  |.H:.=men%.HD.:.H|
0000ef10  4e 1e dd 20 f2 4d 65 6e  75 43 65 6e 74 72 65 28  |N.. .MenuCentre(|
0000ef20  6d 65 6e 75 25 2c 69 74  65 6d 25 29 0d 48 58 3a  |menu%,item%).HX:|
0000ef30  6d 65 6e 75 25 21 28 33  36 2b 28 69 74 65 6d 25  |menu%!(36+(item%|
0000ef40  2d 31 29 2a 32 34 29 3d  6d 65 6e 75 25 21 28 33  |-1)*24)=menu%!(3|
0000ef50  36 2b 28 69 74 65 6d 25  2d 31 29 2a 32 34 29 84  |6+(item%-1)*24).|
0000ef60  28 31 3c 3c 33 29 0d 48  62 05 e1 0d 48 6c 05 3a  |(1<<3).Hb...Hl.:|
0000ef70  0d 48 76 1c dd f2 72 65  73 69 7a 65 28 77 25 2c  |.Hv...resize(w%,|
0000ef80  61 25 2c 62 25 2c 63 25  2c 64 25 29 0d 48 80 2f  |a%,b%,c%,d%).H./|
0000ef90  21 77 69 6d 70 25 3d 61  25 3a 77 69 6d 70 25 21  |!wimp%=a%:wimp%!|
0000efa0  34 3d 62 25 3a 77 69 6d  70 25 21 38 3d 63 25 3a  |4=b%:wimp%!8=c%:|
0000efb0  77 69 6d 70 25 21 31 32  3d 64 25 0d 48 8a 1f c8  |wimp%!12=d%.H...|
0000efc0  99 22 57 69 6d 70 5f 53  65 74 45 78 74 65 6e 74  |."Wimp_SetExtent|
0000efd0  22 2c 77 25 2c 77 69 6d  70 25 0d 48 94 47 77 69  |",w%,wimp%.H.Gwi|
0000efe0  6d 70 25 21 30 3d 64 69  73 70 6c 61 79 5f 57 69  |mp%!0=display_Wi|
0000eff0  6e 64 6f 77 25 3a 77 69  6d 70 25 21 34 3d 64 69  |ndow%:wimp%!4=di|
0000f000  73 70 62 6f 78 25 3a c8  99 22 57 69 6d 70 5f 44  |spbox%:.."Wimp_D|
0000f010  65 6c 65 74 65 49 63 6f  6e 22 2c 2c 77 69 6d 70  |eleteIcon",,wimp|
0000f020  25 0d 48 9e 34 77 69 6d  70 25 21 30 3d 64 69 73  |%.H.4wimp%!0=dis|
0000f030  70 6c 61 79 5f 57 69 6e  64 6f 77 25 3a 77 69 6d  |play_Window%:wim|
0000f040  70 25 21 34 3d 32 32 3a  77 69 6d 70 25 21 38 3d  |p%!4=22:wimp%!8=|
0000f050  62 25 2b 32 34 0d 48 a8  41 77 69 6d 70 25 21 31  |b%+24.H.Awimp%!1|
0000f060  32 3d 63 25 2d 32 34 3a  77 69 6d 70 25 21 31 36  |2=c%-24:wimp%!16|
0000f070  3d 2d 33 36 3a 77 69 6d  70 25 21 32 30 3d 26 31  |=-36:wimp%!20=&1|
0000f080  37 30 30 30 31 30 31 3a  77 69 6d 70 25 21 32 34  |7000101:wimp%!24|
0000f090  3d 74 65 78 74 25 0d 48  b2 1f 77 69 6d 70 25 21  |=text%.H..wimp%!|
0000f0a0  32 38 3d 76 61 6c 69 64  25 3a 77 69 6d 70 25 21  |28=valid%:wimp%!|
0000f0b0  33 32 3d 31 32 0d 48 bc  29 c8 99 22 57 69 6d 70  |32=12.H.).."Wimp|
0000f0c0  5f 43 72 65 61 74 65 49  63 6f 6e 22 2c 2c 77 69  |_CreateIcon",,wi|
0000f0d0  6d 70 25 20 b8 20 64 69  73 70 62 6f 78 25 0d 48  |mp% . dispbox%.H|
0000f0e0  c6 25 f2 57 69 6e 64 6f  77 46 6f 72 63 65 44 72  |.%.WindowForceDr|
0000f0f0  61 77 28 64 69 73 70 6c  61 79 5f 57 69 6e 64 6f  |aw(display_Windo|
0000f100  77 25 29 0d 48 d0 2b e7  64 69 73 70 77 69 6e 64  |w%).H.+.dispwind|
0000f110  25 20 f2 42 72 69 6e 67  54 6f 54 6f 70 28 64 69  |% .BringToTop(di|
0000f120  73 70 6c 61 79 5f 57 69  6e 64 6f 77 25 29 0d 48  |splay_Window%).H|
0000f130  da 05 e1 0d 48 e4 05 3a  0d 48 ee 08 dd f2 77 77  |....H..:.H....ww|
0000f140  0d 48 f8 1e 61 25 3d 2d  32 34 30 2d 28 77 6f 72  |.H..a%=-240-(wor|
0000f150  64 73 25 2a 33 36 29 3a  62 25 3d 33 35 32 0d 49  |ds%*36):b%=352.I|
0000f160  02 2d 21 77 69 6d 70 25  3d 30 3a 77 69 6d 70 25  |.-!wimp%=0:wimp%|
0000f170  21 34 3d 61 25 3a 77 69  6d 70 25 21 38 3d 62 25  |!4=a%:wimp%!8=b%|
0000f180  3a 77 69 6d 70 25 21 31  32 3d 30 0d 49 0c 2a c8  |:wimp%!12=0.I.*.|
0000f190  99 22 57 69 6d 70 5f 53  65 74 45 78 74 65 6e 74  |."Wimp_SetExtent|
0000f1a0  22 2c 77 6f 72 64 73 5f  57 69 6e 64 6f 77 25 2c  |",words_Window%,|
0000f1b0  77 69 6d 70 25 0d 49 16  46 77 69 6d 70 25 21 30  |wimp%.I.Fwimp%!0|
0000f1c0  3d 77 6f 72 64 73 5f 57  69 6e 64 6f 77 25 3a 77  |=words_Window%:w|
0000f1d0  69 6d 70 25 21 34 3d 77  6f 72 64 73 62 6f 78 25  |imp%!4=wordsbox%|
0000f1e0  3a c8 99 22 57 69 6d 70  5f 44 65 6c 65 74 65 49  |:.."Wimp_DeleteI|
0000f1f0  63 6f 6e 22 2c 2c 77 69  6d 70 25 0d 49 20 32 77  |con",,wimp%.I 2w|
0000f200  69 6d 70 25 21 30 3d 77  6f 72 64 73 5f 57 69 6e  |imp%!0=words_Win|
0000f210  64 6f 77 25 3a 77 69 6d  70 25 21 34 3d 32 32 3a  |dow%:wimp%!4=22:|
0000f220  77 69 6d 70 25 21 38 3d  61 25 2b 32 34 0d 49 2a  |wimp%!8=a%+24.I*|
0000f230  41 77 69 6d 70 25 21 31  32 3d 62 25 2d 32 34 3a  |Awimp%!12=b%-24:|
0000f240  77 69 6d 70 25 21 31 36  3d 2d 33 36 3a 77 69 6d  |wimp%!16=-36:wim|
0000f250  70 25 21 32 30 3d 26 31  37 30 30 30 31 30 31 3a  |p%!20=&17000101:|
0000f260  77 69 6d 70 25 21 32 34  3d 74 65 78 74 25 0d 49  |wimp%!24=text%.I|
0000f270  34 1f 77 69 6d 70 25 21  32 38 3d 76 61 6c 69 64  |4.wimp%!28=valid|
0000f280  25 3a 77 69 6d 70 25 21  33 32 3d 31 32 0d 49 3e  |%:wimp%!32=12.I>|
0000f290  2a c8 99 22 57 69 6d 70  5f 43 72 65 61 74 65 49  |*.."Wimp_CreateI|
0000f2a0  63 6f 6e 22 2c 2c 77 69  6d 70 25 20 b8 20 77 6f  |con",,wimp% . wo|
0000f2b0  72 64 73 62 6f 78 25 0d  49 48 23 f2 57 69 6e 64  |rdsbox%.IH#.Wind|
0000f2c0  6f 77 46 6f 72 63 65 44  72 61 77 28 77 6f 72 64  |owForceDraw(word|
0000f2d0  73 5f 57 69 6e 64 6f 77  25 29 0d 49 52 2a e7 77  |s_Window%).IR*.w|
0000f2e0  6f 72 64 73 77 69 6e 64  25 20 f2 42 72 69 6e 67  |ordswind% .Bring|
0000f2f0  54 6f 54 6f 70 28 77 6f  72 64 73 5f 57 69 6e 64  |ToTop(words_Wind|
0000f300  6f 77 25 29 0d 49 5c 05  e1 0d ff                 |ow%).I\....|
0000f30b