Home » Recent acquisitions » Acorn ADFS disks » adfs_AcornUser_199604.adf » Features » StarInfo/Waring/!Matches/!RunImage

StarInfo/Waring/!Matches/!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 » Recent acquisitions » Acorn ADFS disks » adfs_AcornUser_199604.adf » Features
Filename: StarInfo/Waring/!Matches/!RunImage
Read OK:
File size: 2C79 bytes
Load address: 0000
Exec address: 0000
File contents
   10REM > !RunImage
   20REM Main program for !Matches
   30
   40ON ERROR MODE0:REPORT:PRINT;" at line ";ERL:IFGET END
   50
   60PROCinit_vars
   70PROCinit_wimp
   80REM ON ERROR PROCwimp_error(Report$+" at line "+ERL,ERR)
   90PROCinit_game
  100REPEAT
  110PROCpoll_wimp
  120UNTIL quit%
  130PROCclose_wimp
  140END
  150:
  160DEF PROCwimp_error(E$,E%)
  170ON ERROR REPORT:PRINT" at line ";ERL:END
  180!wimp_temp%=E%
  190$(wimp_temp%+4)=E$+". Click OK to continue or CANCEL to quit."+CHR$0
  200SYS "Wimp_ReportError",wimp_temp%,%0000011,"Match game"+CHR$0 TO ,E%
  210IF E%<>1 THEN PROCclose_wimp:END
  220ENDPROC
  230:
  240DEF PROCwimp_message(E$)
  250ON ERROR LOCAL REPORT:PRINT" at line ";ERL:END
  260!wimp_temp%=0
  270$(wimp_temp%+4)=E$+CHR$0
  280SYS "Wimp_ReportError",wimp_temp%,%0010001,"Message from Match game"+CHR$0 TO ,E%
  290ENDPROC
  300:
  310DEF PROCinit_vars
  320no_of_lines%=6
  330matches_per_line%=8
  340max_bits%=3
  350DIM best_play%(max_bits%),matches%(no_of_lines%-1)
  360PROCinit_matches
  370game_over%=TRUE
  380computer_turn%=FALSE
  390two_player%=FALSE
  400player_2_turn%=FALSE
  410ENDPROC
  420:
  430DEF PROCinit_matches
  440FOR X%=0TOno_of_lines%-1
  450matches%(X%)=3+RND(matches_per_line%-3)
  460NEXT X%
  470ENDPROC
  480:
  490DEF PROCinit_wimp
  500DIM poll_blk% 256,wimp_temp% 2048,play_win% 2048
  510DIM menu_blk% 1024,ind_icons% 2048
  520DIM sprites% 512
  530!sprites%=512
  540SYS "OS_SpriteOp",256+10,sprites%,"<Matches$Dir>.Sprites"
  550template_ind%=ind_icons%+512
  560template_ind_end%=template_ind%+1024+512
  570quit%=FALSE
  580SYS "Wimp_Initialise",200,&4B534154,"Match game" TO ,task%
  590PROCcreate_iconbar_icon("","!Matches",-1)
  600SYS "Wimp_OpenTemplate",,"<Matches$Dir>.Templates"
  610info_window%=FNload_template("Info")
  620play_window%=FNload_template("Playarea")
  630SYS "Wimp_CloseTemplate"
  640icon_bar_menu%=FNcreate_menu_blk(menu_blk%,"Matches|>Info,info_window%|Quit")
  650comp_game_menu%=FNcreate_menu_blk(menu_blk%,"U v A|/User|Computer")
  660two_game_menu%=FNcreate_menu_blk(menu_blk%,"U v U|/Player one|Player two")
  670game_menu%=FNcreate_menu_blk(menu_blk%,"Matches|/>User v Arc,comp_game_menu%|.>User v User,two_game_menu%|New Game")
  680current_menu%=0
  690PROCinit_match_icons
  700ENDPROC
  710:
  720DEF FNload_template(name$)
  730LOCAL window%
  740SYS "Wimp_LoadTemplate",,play_win%,template_ind%,template_ind_end%,-1,name$+STRING$(12,CHR$0),0 TO ,,template_ind%
  750play_win%!64=sprites%
  760SYS "Wimp_CreateWindow",,play_win% TO window%
  770=window%
  780:
  790DEF PROCpoll_wimp
  800SYS "Wimp_Poll",,poll_blk% TO action%
  810CASE action% OF
  820WHEN 0 : PROCcomputer_turn
  830WHEN 1 : PROCredraw_window
  840WHEN 2 : SYS "Wimp_OpenWindow",,poll_blk%
  850WHEN 3 : SYS "Wimp_CloseWindow",,poll_blk%
  860WHEN 6 : PROCmouse_click(poll_blk%!12,poll_blk%!16,poll_blk%!0,poll_blk%!4,poll_blk%!8)
  870WHEN 9 : PROCmenu_select(poll_blk%!0,poll_blk%!4)
  880WHEN 17,18 : PROCmessage(poll_blk%)
  890ENDCASE
  900ENDPROC
  910:
  920DEF PROCredraw_window
  930SYS "Wimp_RedrawWindow",,poll_blk% TO more%
  940WHILE more%
  950SYS "Wimp_GetRectangle",,poll_blk% TO more%
  960ENDWHILE
  970ENDPROC
  980:
  990DEF PROCclose_wimp
 1000SYS "Wimp_CloseDown",task%,&4B534154
 1010ENDPROC
 1020:
 1030DEF PROCmessage(blk%)
 1040IF blk%!16=0 THEN quit%=TRUE
 1050ENDPROC
 1060:
 1070DEF PROCcreate_iconbar_icon(text$,sprite$,window%)
 1080wimp_temp%!0=window%
 1090wimp_temp%!4=0
 1100IF text$="" THEN wimp_temp%!8=0 ELSE wimp_temp%!8=-16
 1110wimp_temp%!12=68
 1120IF text$="" THEN wimp_temp%!16=68 ELSE wimp_temp%!16=84
 1130IF text$="" THEN
 1140IF sprite$="" THEN
 1150ENDPROC
 1160ELSE
 1170wimp_temp%!20=&1700303A
 1180$(wimp_temp%+24)=sprite$
 1190ENDIF
 1200ELSE
 1210IF sprite$="" THEN
 1220wimp_temp%!20=&17003039
 1230$(wimp_temp%+24)=text$
 1240ELSE
 1250DIM text_place% LEN(text$)+2
 1260DIM sprite_place% LEN(sprite$)+3
 1270$text_place%=text$+CHR$0
 1280$sprite_place%="S"+sprite$+CHR$0
 1290wimp_temp%!20=&1700313B
 1300wimp_temp%!24=text_place%
 1310wimp_temp%!28=sprite_place%
 1320wimp_temp%!32=LEN(text$)+1
 1330ENDIF
 1340ENDIF
 1350SYS "Wimp_CreateIcon",,wimp_temp%
 1360ENDPROC
 1370:
 1380DEF PROCmouse_click(window%,icon%,x%,y%,but%)
 1390but%=but% AND 7
 1400IF (but% AND 5) THEN
 1410CASE window% OF
 1420WHEN -2 : PROCopen_window(play_window%,100,500)
 1430WHEN play_window% : PROCmatch_click(icon%)
 1440ENDCASE
 1450ELSE
 1460CASE window% OF
 1470WHEN -2 :
 1480current_menu%=1
 1490SYS "Wimp_CreateMenu",,icon_bar_menu%,x%-64,186
 1500WHEN play_window% :
 1510current_menu%=2
 1520SYS "Wimp_CreateMenu",,game_menu%,x%,y%
 1530ENDCASE
 1540ENDIF
 1550ENDPROC
 1560:
 1570DEF FNcreate_menu_blk(menu%,menu$)
 1580menu_start%=menu%
 1590menu_title$=LEFT$(menu$,INSTR(menu$,"|")-1)
 1600menu$=MID$(menu$,INSTR(menu$,"|")+1)
 1610text_len%=LEN(menu_title$)
 1620$menu%=LEFT$(menu_title$+STRING$(12,CHR$0),12)
 1630menu%!12=&00070207
 1640menu%!16=0
 1650menu%!20=44
 1660menu%!24=0
 1670menu%+=28
 1680WHILE LEN(menu$)>0
 1690IF INSTR(menu$,"|")>0 THEN
 1700last_item%=FALSE
 1710menu_item$=LEFT$(menu$,INSTR(menu$,"|")-1)
 1720menu$=MID$(menu$,INSTR(menu$,"|")+1)
 1730ELSE
 1740last_item%=TRUE
 1750menu_item$=menu$
 1760menu$=""
 1770ENDIF
 1780tick_menu%=FALSE
 1790sub_menu%=FALSE
 1800write_menu%=FALSE
 1810dotted_menu%=FALSE
 1820WHILE LEFT$(menu_item$,1)="/" OR LEFT$(menu_item$,1)=">" OR LEFT$(menu_item$,1)=":" OR LEFT$(menu_item$,1)="."
 1830IF LEFT$(menu_item$,1)="/" THEN tick_menu%=TRUE
 1840IF LEFT$(menu_item$,1)=">" THEN sub_menu%=TRUE
 1850IF LEFT$(menu_item$,1)=":" THEN write_menu%=TRUE
 1860IF LEFT$(menu_item$,1)="." THEN dotted_menu%=TRUE
 1870menu_item$=MID$(menu_item$,2)
 1880ENDWHILE
 1890IF tick_menu% THEN
 1900!menu%=1
 1910ELSE
 1920!menu%=0
 1930ENDIF
 1940menu%!4=-1
 1950menu%!8=&07000031
 1960menu%!12=0
 1970menu%!16=0
 1980menu%!20=0
 1990IF sub_menu% THEN
 2000menu_addr%=EVAL(MID$(menu_item$,INSTR(menu_item$,",")+1))
 2010menu_item$=LEFT$(menu_item$,INSTR(menu_item$,",")-1)
 2020menu%!4=menu_addr%
 2030ENDIF
 2040IF write_menu% THEN
 2050!menu%=!menu% OR 4
 2060writeblk%=EVAL(LEFT$(menu_item$,INSTR(menu_item$,",")-1))
 2070menu_item$=MID$(menu_item$,INSTR(menu_item$,",")+1)
 2080validblk%=EVAL(LEFT$(menu_item$,INSTR(menu_item$,",")-1))
 2090writelen%=EVAL(MID$(menu_item$,INSTR(menu_item$,",")+1))
 2100menu%!12=writeblk%
 2110menu%!16=validblk%
 2120menu%!20=writelen%
 2130menu%!8=menu%!8 OR &100
 2140ENDIF
 2150IF dotted_menu% THEN !menu%=!menu% OR 2
 2160IF last_item% THEN !menu%=!menu% OR 128
 2170IF (menu%!8 AND &100)=0 THEN
 2180$(menu%+12)=LEFT$(menu_item$,11)
 2190IF text_len%<LEN(LEFT$(menu_item$,11)) THEN
 2200text_len%=LEN(LEFT$(menu_item$,11))
 2210ENDIF
 2220ENDIF
 2230menu%+=24
 2240ENDWHILE
 2250menu_start%!16=16*text_len%+16
 2260menu_blk%=menu%
 2270=menu_start%
 2280:
 2290DEF FNctrl_term(addr%)
 2300LOCAL A$
 2310A$=""
 2320WHILE ?addr%>31
 2330A$+=CHR$?addr%
 2340addr%+=1
 2350ENDWHILE
 2360=A$
 2370:
 2380DEF PROCopen_window(window%,x%,y%)
 2390!wimp_temp%=window%
 2400SYS "Wimp_GetWindowState",,wimp_temp%
 2410IF x%<>-1 THEN
 2420wimp_temp%!12-=wimp_temp%!4
 2430wimp_temp%!4=x%
 2440wimp_temp%!12+=x%
 2450ENDIF
 2460IF y%<>-1 THEN
 2470wimp_temp%!8-=wimp_temp%!16
 2480wimp_temp%!16=y%
 2490wimp_temp%!8+=y%
 2500ENDIF
 2510wimp_temp%!28=-1
 2520SYS "Wimp_OpenWindow",,wimp_temp%
 2530ENDPROC
 2540:
 2550DEF PROCset_icon_data(window%,icon%,text$,valid$,eor%,clr%)
 2560!wimp_temp%=window%
 2570wimp_temp%!4=icon%
 2580SYS "Wimp_GetIconState",,wimp_temp%
 2590IF text$<>"" THEN $(wimp_temp%!28)=text$
 2600IF valid$<>"" THEN $(wimp_temp%!32)=valid$
 2610wimp_temp%!8=eor%
 2620wimp_temp%!12=clr%
 2630SYS "Wimp_SetIconState",,wimp_temp%
 2640ENDPROC
 2650:
 2660DEF PROCmenu_select(item%,item2%)
 2670SYS "Wimp_GetPointerInfo",,wimp_temp%
 2680button%=wimp_temp%!8
 2690IF current_menu%=1 THEN
 2700IF item%=1 THEN quit%=TRUE
 2710ENDIF
 2720IF current_menu%=2 THEN
 2730IF item%=0 THEN
 2740game_menu%!28=game_menu%!28 OR 1
 2750game_menu%!52=game_menu%!52 AND (NOT 1)
 2760IF item2%=0 THEN
 2770comp_game_menu%!28=comp_game_menu%!28 OR 1
 2780comp_game_menu%!52=comp_game_menu%!52 AND (NOT 1)
 2790ENDIF
 2800IF item2%=1 THEN
 2810comp_game_menu%!52=comp_game_menu%!52 OR 1
 2820comp_game_menu%!28=comp_game_menu%!28 AND (NOT 1)
 2830ENDIF
 2840ENDIF
 2850IF item%=1 THEN
 2860game_menu%!52=game_menu%!52 OR 1
 2870game_menu%!28=game_menu%!28 AND (NOT 1)
 2880IF item2%=0 THEN
 2890two_game_menu%!28=two_game_menu%!28 OR 1
 2900two_game_menu%!52=two_game_menu%!52 AND (NOT 1)
 2910ENDIF
 2920IF item2%=1 THEN
 2930two_game_menu%!52=two_game_menu%!52 OR 1
 2940two_game_menu%!28=two_game_menu%!28 AND (NOT 1)
 2950ENDIF
 2960ENDIF
 2970IF item%=2 THEN
 2980PROCinit_matches
 2990PROCinit_match_icons
 3000PROCinit_game
 3010PROCopen_window(play_window%,-1,-1)
 3020ENDIF
 3030ENDIF
 3040IF (button% AND 1)=1 THEN
 3050IF current_menu%=1 THEN curmenu%=icon_bar_menu%
 3060IF current_menu%=2 THEN curmenu%=game_menu%
 3070SYS "Wimp_CreateMenu",,curmenu%,x%,y%
 3080ENDIF
 3090ENDPROC
 3100:
 3110DEF PROCinit_match_icons
 3120!wimp_temp%=play_window%
 3130SYS "Wimp_DeleteWindow",,wimp_temp%
 3140SYS "Wimp_CreateWindow",,play_win% TO play_window%
 3150!wimp_temp%=play_window%
 3160FOR X%=0TO no_of_lines%-1
 3170IF matches%(X%)<8 THEN
 3180FOR Y%=7TOmatches%(X%) STEP -1
 3190wimp_temp%!4=Y%+X%*matches_per_line%
 3200SYS "Wimp_DeleteIcon",,wimp_temp%
 3210NEXT Y%
 3220ENDIF
 3230NEXT X%
 3240ENDPROC
 3250:
 3260DEF PROCinit_game
 3270IF ((game_menu%!28) AND 1) THEN
 3280two_player%=FALSE
 3290IF ((comp_game_menu%!28) AND 1) THEN
 3300computer_turn%=FALSE
 3310ELSE
 3320computer_turn%=TRUE
 3330ENDIF
 3340ELSE
 3350two_player%=TRUE
 3360computer_turn%=FALSE
 3370IF ((two_game_menu%!28) AND 1) THEN
 3380player_2_turn%=FALSE
 3390ELSE
 3400player_2_turn%=TRUE
 3410ENDIF
 3420ENDIF
 3430game_over%=FALSE
 3440ENDPROC
 3450:
 3460DEF PROCmatch_click(icon%)
 3470LOCAL line%,match%,total%
 3480IF game_over%=FALSE THEN
 3490IF computer_turn%=FALSE THEN
 3500IF icon%>=0 AND icon%<no_of_lines%*matches_per_line% THEN
 3510!wimp_temp%=play_window%
 3520wimp_temp%!4=icon%
 3530SYS "Wimp_GetIconState",,wimp_temp%
 3540IF ((wimp_temp%!24) AND (1<<23))=0 THEN
 3550line%=icon% DIV matches_per_line%
 3560match%=icon% MOD matches_per_line%
 3570FOR X%=icon% TO matches%(line%)+line%*matches_per_line%-1
 3580wimp_temp%!4=X%
 3590SYS "Wimp_DeleteIcon",,wimp_temp%
 3600NEXT X%
 3610SYS "Wimp_ForceRedraw",play_window%,0,-1000,1000,0
 3620matches%(line%)=match%
 3630IF two_player% THEN
 3640IF SUM(matches%())=1 THEN PROClose(player_2_turn%)
 3650IF SUM(matches%())=0 THEN PROClose(NOT player_2_turn%)
 3660player_2_turn%=NOT player_2_turn%
 3670ELSE
 3680computer_turn%=TRUE
 3690IF SUM(matches%())=1 THEN PROClose(1)
 3700IF SUM(matches%())=0 THEN PROClose(0)
 3710ENDIF
 3720ENDIF
 3730ENDIF
 3740ENDIF
 3750ENDIF
 3760ENDPROC
 3770:
 3780DEF PROClose(computer_lost%)
 3790IF two_player% THEN
 3800IF computer_lost% THEN
 3810PROCwimp_message("Congratulations player 2!")
 3820ELSE
 3830PROCwimp_message("Congratulations player 1!")
 3840ENDIF
 3850ELSE
 3860IF computer_lost% THEN
 3870PROCwimp_message("Congratulations! You won")
 3880ELSE
 3890PROCwimp_message("Ha Ha! You lost")
 3900ENDIF
 3910ENDIF
 3920game_over%=TRUE
 3930ENDPROC
 3940:
 3950DEF PROCcomputer_turn
 3960 IF two_player%=FALSE THEN
 3970  IF computer_turn%=TRUE THEN
 3980   IF game_over%=FALSE THEN
 3990    lines%=0
 4000    FOR X%=0TOno_of_lines%-1
 4010     IF matches%(X%)>0 THEN lines%+=1
 4020    NEXT X%
 4030    best_play%()=0
 4040    IF lines%>1 THEN
 4050     eor%=0
 4070     FOR X%=0TOno_of_lines%-1
 4080      eor%=eor% EOR matches%(X%)
 4090      FOR Y%=0TOmax_bits%
 4100       IF (matches%(X%) AND (1<<Y%))<>0 THEN best_play%(Y%)+=1
 4110      NEXT Y%
 4120     NEXT X%
 4130     X%=0:Y%=0
 4140     bm%=best_play%(0)-(matches%(0) AND 1)
 4150     FOR Z%=1 TO max_bits%
 4160      IF best_play%(Z%)+((matches%(0) AND (1<<Z%))>0)>0 THEN bm%=-1
 4170     NEXT Z%
 4171     move%=-1
 4180     REPEAT
 4190      IF matches%(Y%)>0 THEN
 4200       IF (bm%>=0 AND ((bm% AND 1)EOR1)<matches%(Y%)) THEN
 4210        move%=((bm% AND 1)EOR1)+Y%*matches_per_line%
 4220       ELSE 
 4230        IF (eor% EOR matches%(Y%) EOR X%)=0 THEN
 4240         move%=X%+Y%*matches_per_line%
 4250        ENDIF
 4260       ENDIF
 4270       X%+=1
 4280       IF X%>=matches%(Y%) THEN
 4290        X%=0:Y%+=1
 4291        IF Y%<no_of_lines% THEN
 4300         bm%=best_play%(0)-(matches%(Y%) AND 1)
 4310         FOR Z%=1 TO max_bits%
 4320          IF best_play%(Z%)+((matches%(Y%) AND (1<<Z%))>0)>0 THEN bm%=-1
 4330         NEXT Z%
 4331        ENDIF
 4340       ENDIF
 4350      ELSE
 4360       Y%+=1
 4370       IF (Y%<no_of_lines%) THEN
 4380         bm%=best_play%(0)-(matches%(Y%) AND 1)
 4390         FOR Z%=1 TO max_bits%
 4400          IF best_play%(Z%)+((matches%(Y%) AND (1<<Z%))>0)>0 THEN bm%=-1
 4410         NEXT Z%
 4420       ENDIF
 4430      ENDIF
 4440     UNTIL Y%>=no_of_lines% OR move%>-1
 4450     IF move%<=-1 THEN
 4460      REPEAT
 4470       line%=RND(no_of_lines%-1)
 4480      UNTIL matches%(line%)>0
 4490      matches%=RND(matches%(line%)-1)
 4500      move%=matches%+line%*matches_per_line%
 4510     ENDIF
 4520    ELSE
 4530     FOR X%=0TOno_of_lines%-1
 4540      IF matches%(X%)>0 THEN line%=X%
 4550     NEXT X%
 4560     move%=line%*matches_per_line%
 4570    ENDIF
 4580    line%=move% DIV matches_per_line%
 4590    match%=move% MOD matches_per_line%
 4600    FOR X%=move% TO matches%(line%)+line%*matches_per_line%-1
 4610     wimp_temp%!4=X%
 4620     SYS "Wimp_DeleteIcon",,wimp_temp%
 4630    NEXT X%
 4640    SYS "Wimp_ForceRedraw",play_window%,0,-1000,1000,0
 4650    matches%(line%)=match%
 4660    computer_turn%=FALSE
 4670    IF SUM(matches%())=1 THEN PROClose(0)
 4680   ENDIF
 4690  ENDIF
 4700 ENDIF
 4710ENDPROC

� > !RunImage
� Main program for !Matches

(!� � �0:�:�;" at line ";�:� �
2
<�init_vars
F�init_wimp
P:� ON ERROR PROCwimp_error(Report$+" at line "+ERL,ERR)
Z�init_game
d�
n�poll_wimp
x� quit%
��close_wimp
��
�:
�� �wimp_error(E$,E%)
�� � �:�" at line ";�:�
�!wimp_temp%=E%
�E$(wimp_temp%+4)=E$+". Click OK to continue or CANCEL to quit."+�0
�Cș "Wimp_ReportError",wimp_temp%,%0000011,"Match game"+�0 � ,E%
�� E%<>1 � �close_wimp:�
��
�:
�� �wimp_message(E$)
�� � � �:�" at line ";�:�
!wimp_temp%=0
$(wimp_temp%+4)=E$+�0
Pș "Wimp_ReportError",wimp_temp%,%0010001,"Message from Match game"+�0 � ,E%
"�
,:
6� �init_vars
@no_of_lines%=6
Jmatches_per_line%=8
Tmax_bits%=3
^4� best_play%(max_bits%),matches%(no_of_lines%-1)
h�init_matches
rgame_over%=�
|computer_turn%=�
�two_player%=�
�player_2_turn%=�
��
�:
�� �init_matches
�� X%=0�no_of_lines%-1
�)matches%(X%)=3+�(matches_per_line%-3)
�� X%
��
�:
�� �init_wimp
�2� poll_blk% 256,wimp_temp% 2048,play_win% 2048
�$� menu_blk% 1024,ind_icons% 2048
� sprites% 512
!sprites%=512
<ș "OS_SpriteOp",256+10,sprites%,"<Matches$Dir>.Sprites"
& template_ind%=ind_icons%+512
0,template_ind_end%=template_ind%+1024+512
:quit%=�
D<ș "Wimp_Initialise",200,&4B534154,"Match game" � ,task%
N*�create_iconbar_icon("","!Matches",-1)
X5ș "Wimp_OpenTemplate",,"<Matches$Dir>.Templates"
b'info_window%=�load_template("Info")
l+play_window%=�load_template("Playarea")
vș "Wimp_CloseTemplate"
�Picon_bar_menu%=�create_menu_blk(menu_blk%,"Matches|>Info,info_window%|Quit")
�Fcomp_game_menu%=�create_menu_blk(menu_blk%,"U v A|/User|Computer")
�Mtwo_game_menu%=�create_menu_blk(menu_blk%,"U v U|/Player one|Player two")
�wgame_menu%=�create_menu_blk(menu_blk%,"Matches|/>User v Arc,comp_game_menu%|.>User v User,two_game_menu%|New Game")
�current_menu%=0
��init_match_icons
��
�:
�� �load_template(name$)
�
� window%
�jș "Wimp_LoadTemplate",,play_win%,template_ind%,template_ind_end%,-1,name$+�12,�0),0 � ,,template_ind%
�play_win%!64=sprites%
�/ș "Wimp_CreateWindow",,play_win% � window%
=window%
:
� �poll_wimp
 'ș "Wimp_Poll",,poll_blk% � action%
*Ȏ action% �
4� 0 : �computer_turn
>� 1 : �redraw_window
H)� 2 : ș "Wimp_OpenWindow",,poll_blk%
R*� 3 : ș "Wimp_CloseWindow",,poll_blk%
\U� 6 : �mouse_click(poll_blk%!12,poll_blk%!16,poll_blk%!0,poll_blk%!4,poll_blk%!8)
f/� 9 : �menu_select(poll_blk%!0,poll_blk%!4)
p!� 17,18 : �message(poll_blk%)
z�
��
�:
�� �redraw_window
�-ș "Wimp_RedrawWindow",,poll_blk% � more%
�ȕ more%
�-ș "Wimp_GetRectangle",,poll_blk% � more%
��
��
�:
�� �close_wimp
�'ș "Wimp_CloseDown",task%,&4B534154
��
�:
� �message(blk%)
� blk%!16=0 � quit%=�
�
$:
.1� �create_iconbar_icon(text$,sprite$,window%)
8wimp_temp%!0=window%
Bwimp_temp%!4=0
L2� text$="" � wimp_temp%!8=0 � wimp_temp%!8=-16
Vwimp_temp%!12=68
`4� text$="" � wimp_temp%!16=68 � wimp_temp%!16=84
j� text$="" �
t� sprite$="" �
~�
��
�wimp_temp%!20=&1700303A
�$(wimp_temp%+24)=sprite$
��
��
�� sprite$="" �
�wimp_temp%!20=&17003039
�$(wimp_temp%+24)=text$
��
�� text_place% �(text$)+2
� � sprite_place% �(sprite$)+3
�$text_place%=text$+�0
!$sprite_place%="S"+sprite$+�0

wimp_temp%!20=&1700313B
wimp_temp%!24=text_place%
wimp_temp%!28=sprite_place%
(wimp_temp%!32=�(text$)+1
2�
<�
F$ș "Wimp_CreateIcon",,wimp_temp%
P�
Z:
d,� �mouse_click(window%,icon%,x%,y%,but%)
nbut%=but% � 7
x� (but% � 5) �
�Ȏ window% �
�-� -2 : �open_window(play_window%,100,500)
�(� play_window% : �match_click(icon%)
��
��
�Ȏ window% �
�
� -2 :
�current_menu%=1
�2ș "Wimp_CreateMenu",,icon_bar_menu%,x%-64,186
�� play_window% :
�current_menu%=2
�*ș "Wimp_CreateMenu",,game_menu%,x%,y%
��
�
�
:
"#� �create_menu_blk(menu%,menu$)
,menu_start%=menu%
6%menu_title$=�menu$,�menu$,"|")-1)
@menu$=�menu$,�menu$,"|")+1)
Jtext_len%=�(menu_title$)
T#$menu%=�menu_title$+�12,�0),12)
^menu%!12=&00070207
hmenu%!16=0
rmenu%!20=44
|menu%!24=0
�
menu%+=28
�ȕ �(menu$)>0
�� �menu$,"|")>0 �
�last_item%=�
�$menu_item$=�menu$,�menu$,"|")-1)
�menu$=�menu$,�menu$,"|")+1)
��
�last_item%=�
�menu_item$=menu$
�menu$=""
��
�tick_menu%=�
�sub_menu%=�
write_menu%=�
dotted_menu%=�
Xȕ �menu_item$,1)="/" � �menu_item$,1)=">" � �menu_item$,1)=":" � �menu_item$,1)="."
&'� �menu_item$,1)="/" � tick_menu%=�
0&� �menu_item$,1)=">" � sub_menu%=�
:(� �menu_item$,1)=":" � write_menu%=�
D)� �menu_item$,1)="." � dotted_menu%=�
Nmenu_item$=�menu_item$,2)
X�
b� tick_menu% �
l!menu%=1
v�
�!menu%=0
��
�menu%!4=-1
�menu%!8=&07000031
�menu%!12=0
�menu%!16=0
�menu%!20=0
�� sub_menu% �
�1menu_addr%=�(�menu_item$,�menu_item$,",")+1))
�.menu_item$=�menu_item$,�menu_item$,",")-1)
�menu%!4=menu_addr%
��
�� write_menu% �
!menu%=!menu% � 4
0writeblk%=�(�menu_item$,�menu_item$,",")-1))
.menu_item$=�menu_item$,�menu_item$,",")+1)
 0validblk%=�(�menu_item$,�menu_item$,",")-1))
*0writelen%=�(�menu_item$,�menu_item$,",")+1))
4menu%!12=writeblk%
>menu%!16=validblk%
Hmenu%!20=writelen%
Rmenu%!8=menu%!8 � &100
\�
f&� dotted_menu% � !menu%=!menu% � 2
p&� last_item% � !menu%=!menu% � 128
z� (menu%!8 � &100)=0 �
�$(menu%+12)=�menu_item$,11)
�$� text_len%<�(�menu_item$,11)) �
� text_len%=�(�menu_item$,11))
��
��
�
menu%+=24
��
�"menu_start%!16=16*text_len%+16
�menu_blk%=menu%
�=menu_start%
�:
�� �ctrl_term(addr%)
�� A$
		A$=""
	ȕ ?addr%>31
	A$+=�?addr%
	$addr%+=1
	.�
	8=A$
	B:
	L!� �open_window(window%,x%,y%)
	V!wimp_temp%=window%
	`(ș "Wimp_GetWindowState",,wimp_temp%
	j� x%<>-1 �
	twimp_temp%!12-=wimp_temp%!4
	~wimp_temp%!4=x%
	�wimp_temp%!12+=x%
	��
	�� y%<>-1 �
	�wimp_temp%!8-=wimp_temp%!16
	�wimp_temp%!16=y%
	�wimp_temp%!8+=y%
	��
	�wimp_temp%!28=-1
	�$ș "Wimp_OpenWindow",,wimp_temp%
	��
	�:
	�:� �set_icon_data(window%,icon%,text$,valid$,eor%,clr%)
!wimp_temp%=window%

wimp_temp%!4=icon%
&ș "Wimp_GetIconState",,wimp_temp%
(� text$<>"" � $(wimp_temp%!28)=text$
(*� valid$<>"" � $(wimp_temp%!32)=valid$
2wimp_temp%!8=eor%
<wimp_temp%!12=clr%
F&ș "Wimp_SetIconState",,wimp_temp%
P�
Z:
d � �menu_select(item%,item2%)
n(ș "Wimp_GetPointerInfo",,wimp_temp%
xbutton%=wimp_temp%!8
�� current_menu%=1 �
�� item%=1 � quit%=�
��
�� current_menu%=2 �
�� item%=0 �
�#game_menu%!28=game_menu%!28 � 1
�'game_menu%!52=game_menu%!52 � (� 1)
�� item2%=0 �
�-comp_game_menu%!28=comp_game_menu%!28 � 1
�1comp_game_menu%!52=comp_game_menu%!52 � (� 1)
��
�� item2%=1 �
�-comp_game_menu%!52=comp_game_menu%!52 � 1
1comp_game_menu%!28=comp_game_menu%!28 � (� 1)
�
�
"� item%=1 �
,#game_menu%!52=game_menu%!52 � 1
6'game_menu%!28=game_menu%!28 � (� 1)
@� item2%=0 �
J+two_game_menu%!28=two_game_menu%!28 � 1
T/two_game_menu%!52=two_game_menu%!52 � (� 1)
^�
h� item2%=1 �
r+two_game_menu%!52=two_game_menu%!52 � 1
|/two_game_menu%!28=two_game_menu%!28 � (� 1)
��
��
�� item%=2 �
��init_matches
��init_match_icons
��init_game
�$�open_window(play_window%,-1,-1)
��
��
�� (button% � 1)=1 �
�/� current_menu%=1 � curmenu%=icon_bar_menu%
�+� current_menu%=2 � curmenu%=game_menu%
�(ș "Wimp_CreateMenu",,curmenu%,x%,y%
�
�
:
&� �init_match_icons
0!wimp_temp%=play_window%
:&ș "Wimp_DeleteWindow",,wimp_temp%
D4ș "Wimp_CreateWindow",,play_win% � play_window%
N!wimp_temp%=play_window%
X� X%=0� no_of_lines%-1
b� matches%(X%)<8 �
l� Y%=7�matches%(X%) � -1
v(wimp_temp%!4=Y%+X%*matches_per_line%
�$ș "Wimp_DeleteIcon",,wimp_temp%
�� Y%
��
�� X%
��
�:
�� �init_game
�� ((game_menu%!28) � 1) �
�two_player%=�
�"� ((comp_game_menu%!28) � 1) �
�computer_turn%=�
��
�computer_turn%=�

�

�

two_player%=�

 computer_turn%=�

*!� ((two_game_menu%!28) � 1) �

4player_2_turn%=�

>�

Hplayer_2_turn%=�

R�

\�

fgame_over%=�

p�

z:

�� �match_click(icon%)

�� line%,match%,total%

�� game_over%=� �

�� computer_turn%=� �

�7� icon%>=0 � icon%<no_of_lines%*matches_per_line% �

�!wimp_temp%=play_window%

�wimp_temp%!4=icon%

�&ș "Wimp_GetIconState",,wimp_temp%

�%� ((wimp_temp%!24) � (1<<23))=0 �

�#line%=icon% � matches_per_line%

�$match%=icon% � matches_per_line%

�:� X%=icon% � matches%(line%)+line%*matches_per_line%-1

�wimp_temp%!4=X%
$ș "Wimp_DeleteIcon",,wimp_temp%
� X%
5ș "Wimp_ForceRedraw",play_window%,0,-1000,1000,0
$matches%(line%)=match%
.� two_player% �
8.� Ǝ(matches%())=1 � �lose(player_2_turn%)
B0� Ǝ(matches%())=0 � �lose(� player_2_turn%)
L#player_2_turn%=� player_2_turn%
V�
`computer_turn%=�
j!� Ǝ(matches%())=1 � �lose(1)
t!� Ǝ(matches%())=0 � �lose(0)
~�
��
��
��
��
��
�:
�� �lose(computer_lost%)
�� two_player% �
�� computer_lost% �
�.�wimp_message("Congratulations player 2!")
��
�.�wimp_message("Congratulations player 1!")
�

�
� computer_lost% �
-�wimp_message("Congratulations! You won")
(�
2$�wimp_message("Ha Ha! You lost")
<�
F�
Pgame_over%=�
Z�
d:
n� �computer_turn
x � two_player%=� �
�  � computer_turn%=� �
�   � game_over%=� �
�    lines%=0
�    � X%=0�no_of_lines%-1
�%     � matches%(X%)>0 � lines%+=1
�    � X%
�    best_play%()=0
�    � lines%>1 �
�     eor%=0
�     � X%=0�no_of_lines%-1
�"      eor%=eor% � matches%(X%)
�      � Y%=0�max_bits%
<       � (matches%(X%) � (1<<Y%))<>0 � best_play%(Y%)+=1
      � Y%

     � X%
"     X%=0:Y%=0
,,     bm%=best_play%(0)-(matches%(0) � 1)
6     � Z%=1 � max_bits%
@A      � best_play%(Z%)+((matches%(0) � (1<<Z%))>0)>0 � bm%=-1
J
     � Z%
K     move%=-1
T
     �
^      � matches%(Y%)>0 �
h4       � (bm%>=0 � ((bm% � 1)�1)<matches%(Y%)) �
r4        move%=((bm% � 1)�1)+Y%*matches_per_line%
|
       � 
�,        � (eor% � matches%(Y%) � X%)=0 �
�*         move%=X%+Y%*matches_per_line%
�
        �
�       �
�       X%+=1
�       � X%>=matches%(Y%) �
�        X%=0:Y%+=1
�        � Y%<no_of_lines% �
�1         bm%=best_play%(0)-(matches%(Y%) � 1)
�         � Z%=1 � max_bits%
�F          � best_play%(Z%)+((matches%(Y%) � (1<<Z%))>0)>0 � bm%=-1
�         � Z%
�
        �
�       �
�      �
       Y%+=1
        � (Y%<no_of_lines%) �
1         bm%=best_play%(0)-(matches%(Y%) � 1)
&         � Z%=1 � max_bits%
0F          � best_play%(Z%)+((matches%(Y%) � (1<<Z%))>0)>0 � bm%=-1
:         � Z%
D       �
N      �
X&     � Y%>=no_of_lines% � move%>-1
b     � move%<=-1 �
l      �
v"       line%=�(no_of_lines%-1)
�      � matches%(line%)>0
�'      matches%=�(matches%(line%)-1)
�0      move%=matches%+line%*matches_per_line%
�
     �
�	    �
�     � X%=0�no_of_lines%-1
�%      � matches%(X%)>0 � line%=X%
�
     � X%
�&     move%=line%*matches_per_line%
�	    �
�'    line%=move% � matches_per_line%
�(    match%=move% � matches_per_line%
�>    � X%=move% � matches%(line%)+line%*matches_per_line%-1
     wimp_temp%!4=X%
)     ș "Wimp_DeleteIcon",,wimp_temp%
    � X%
 9    ș "Wimp_ForceRedraw",play_window%,0,-1000,1000,0
*    matches%(line%)=match%
4    computer_turn%=�
>%    � Ǝ(matches%())=1 � �lose(0)
H   �
R  �
\ �
f�
�
00000000  0d 00 0a 11 f4 20 3e 20  21 52 75 6e 49 6d 61 67  |..... > !RunImag|
00000010  65 0d 00 14 1f f4 20 4d  61 69 6e 20 70 72 6f 67  |e..... Main prog|
00000020  72 61 6d 20 66 6f 72 20  21 4d 61 74 63 68 65 73  |ram for !Matches|
00000030  0d 00 1e 04 0d 00 28 21  ee 20 85 20 eb 30 3a f6  |......(!. . .0:.|
00000040  3a f1 3b 22 20 61 74 20  6c 69 6e 65 20 22 3b 9e  |:.;" at line ";.|
00000050  3a e7 a5 20 e0 0d 00 32  04 0d 00 3c 0e f2 69 6e  |:.. ...2...<..in|
00000060  69 74 5f 76 61 72 73 0d  00 46 0e f2 69 6e 69 74  |it_vars..F..init|
00000070  5f 77 69 6d 70 0d 00 50  3a f4 20 4f 4e 20 45 52  |_wimp..P:. ON ER|
00000080  52 4f 52 20 50 52 4f 43  77 69 6d 70 5f 65 72 72  |ROR PROCwimp_err|
00000090  6f 72 28 52 65 70 6f 72  74 24 2b 22 20 61 74 20  |or(Report$+" at |
000000a0  6c 69 6e 65 20 22 2b 45  52 4c 2c 45 52 52 29 0d  |line "+ERL,ERR).|
000000b0  00 5a 0e f2 69 6e 69 74  5f 67 61 6d 65 0d 00 64  |.Z..init_game..d|
000000c0  05 f5 0d 00 6e 0e f2 70  6f 6c 6c 5f 77 69 6d 70  |....n..poll_wimp|
000000d0  0d 00 78 0b fd 20 71 75  69 74 25 0d 00 82 0f f2  |..x.. quit%.....|
000000e0  63 6c 6f 73 65 5f 77 69  6d 70 0d 00 8c 05 e0 0d  |close_wimp......|
000000f0  00 96 05 3a 0d 00 a0 18  dd 20 f2 77 69 6d 70 5f  |...:..... .wimp_|
00000100  65 72 72 6f 72 28 45 24  2c 45 25 29 0d 00 aa 1a  |error(E$,E%)....|
00000110  ee 20 85 20 f6 3a f1 22  20 61 74 20 6c 69 6e 65  |. . .:." at line|
00000120  20 22 3b 9e 3a e0 0d 00  b4 12 21 77 69 6d 70 5f  | ";.:.....!wimp_|
00000130  74 65 6d 70 25 3d 45 25  0d 00 be 45 24 28 77 69  |temp%=E%...E$(wi|
00000140  6d 70 5f 74 65 6d 70 25  2b 34 29 3d 45 24 2b 22  |mp_temp%+4)=E$+"|
00000150  2e 20 43 6c 69 63 6b 20  4f 4b 20 74 6f 20 63 6f  |. Click OK to co|
00000160  6e 74 69 6e 75 65 20 6f  72 20 43 41 4e 43 45 4c  |ntinue or CANCEL|
00000170  20 74 6f 20 71 75 69 74  2e 22 2b bd 30 0d 00 c8  | to quit."+.0...|
00000180  43 c8 99 20 22 57 69 6d  70 5f 52 65 70 6f 72 74  |C.. "Wimp_Report|
00000190  45 72 72 6f 72 22 2c 77  69 6d 70 5f 74 65 6d 70  |Error",wimp_temp|
000001a0  25 2c 25 30 30 30 30 30  31 31 2c 22 4d 61 74 63  |%,%0000011,"Matc|
000001b0  68 20 67 61 6d 65 22 2b  bd 30 20 b8 20 2c 45 25  |h game"+.0 . ,E%|
000001c0  0d 00 d2 1b e7 20 45 25  3c 3e 31 20 8c 20 f2 63  |..... E%<>1 . .c|
000001d0  6c 6f 73 65 5f 77 69 6d  70 3a e0 0d 00 dc 05 e1  |lose_wimp:......|
000001e0  0d 00 e6 05 3a 0d 00 f0  17 dd 20 f2 77 69 6d 70  |....:..... .wimp|
000001f0  5f 6d 65 73 73 61 67 65  28 45 24 29 0d 00 fa 1c  |_message(E$)....|
00000200  ee 20 85 20 ea 20 f6 3a  f1 22 20 61 74 20 6c 69  |. . . .:." at li|
00000210  6e 65 20 22 3b 9e 3a e0  0d 01 04 11 21 77 69 6d  |ne ";.:.....!wim|
00000220  70 5f 74 65 6d 70 25 3d  30 0d 01 0e 19 24 28 77  |p_temp%=0....$(w|
00000230  69 6d 70 5f 74 65 6d 70  25 2b 34 29 3d 45 24 2b  |imp_temp%+4)=E$+|
00000240  bd 30 0d 01 18 50 c8 99  20 22 57 69 6d 70 5f 52  |.0...P.. "Wimp_R|
00000250  65 70 6f 72 74 45 72 72  6f 72 22 2c 77 69 6d 70  |eportError",wimp|
00000260  5f 74 65 6d 70 25 2c 25  30 30 31 30 30 30 31 2c  |_temp%,%0010001,|
00000270  22 4d 65 73 73 61 67 65  20 66 72 6f 6d 20 4d 61  |"Message from Ma|
00000280  74 63 68 20 67 61 6d 65  22 2b bd 30 20 b8 20 2c  |tch game"+.0 . ,|
00000290  45 25 0d 01 22 05 e1 0d  01 2c 05 3a 0d 01 36 10  |E%.."....,.:..6.|
000002a0  dd 20 f2 69 6e 69 74 5f  76 61 72 73 0d 01 40 12  |. .init_vars..@.|
000002b0  6e 6f 5f 6f 66 5f 6c 69  6e 65 73 25 3d 36 0d 01  |no_of_lines%=6..|
000002c0  4a 17 6d 61 74 63 68 65  73 5f 70 65 72 5f 6c 69  |J.matches_per_li|
000002d0  6e 65 25 3d 38 0d 01 54  0f 6d 61 78 5f 62 69 74  |ne%=8..T.max_bit|
000002e0  73 25 3d 33 0d 01 5e 34  de 20 62 65 73 74 5f 70  |s%=3..^4. best_p|
000002f0  6c 61 79 25 28 6d 61 78  5f 62 69 74 73 25 29 2c  |lay%(max_bits%),|
00000300  6d 61 74 63 68 65 73 25  28 6e 6f 5f 6f 66 5f 6c  |matches%(no_of_l|
00000310  69 6e 65 73 25 2d 31 29  0d 01 68 11 f2 69 6e 69  |ines%-1)..h..ini|
00000320  74 5f 6d 61 74 63 68 65  73 0d 01 72 10 67 61 6d  |t_matches..r.gam|
00000330  65 5f 6f 76 65 72 25 3d  b9 0d 01 7c 14 63 6f 6d  |e_over%=...|.com|
00000340  70 75 74 65 72 5f 74 75  72 6e 25 3d a3 0d 01 86  |puter_turn%=....|
00000350  11 74 77 6f 5f 70 6c 61  79 65 72 25 3d a3 0d 01  |.two_player%=...|
00000360  90 14 70 6c 61 79 65 72  5f 32 5f 74 75 72 6e 25  |..player_2_turn%|
00000370  3d a3 0d 01 9a 05 e1 0d  01 a4 05 3a 0d 01 ae 13  |=..........:....|
00000380  dd 20 f2 69 6e 69 74 5f  6d 61 74 63 68 65 73 0d  |. .init_matches.|
00000390  01 b8 19 e3 20 58 25 3d  30 b8 6e 6f 5f 6f 66 5f  |.... X%=0.no_of_|
000003a0  6c 69 6e 65 73 25 2d 31  0d 01 c2 29 6d 61 74 63  |lines%-1...)matc|
000003b0  68 65 73 25 28 58 25 29  3d 33 2b b3 28 6d 61 74  |hes%(X%)=3+.(mat|
000003c0  63 68 65 73 5f 70 65 72  5f 6c 69 6e 65 25 2d 33  |ches_per_line%-3|
000003d0  29 0d 01 cc 08 ed 20 58  25 0d 01 d6 05 e1 0d 01  |)..... X%.......|
000003e0  e0 05 3a 0d 01 ea 10 dd  20 f2 69 6e 69 74 5f 77  |..:..... .init_w|
000003f0  69 6d 70 0d 01 f4 32 de  20 70 6f 6c 6c 5f 62 6c  |imp...2. poll_bl|
00000400  6b 25 20 32 35 36 2c 77  69 6d 70 5f 74 65 6d 70  |k% 256,wimp_temp|
00000410  25 20 32 30 34 38 2c 70  6c 61 79 5f 77 69 6e 25  |% 2048,play_win%|
00000420  20 32 30 34 38 0d 01 fe  24 de 20 6d 65 6e 75 5f  | 2048...$. menu_|
00000430  62 6c 6b 25 20 31 30 32  34 2c 69 6e 64 5f 69 63  |blk% 1024,ind_ic|
00000440  6f 6e 73 25 20 32 30 34  38 0d 02 08 12 de 20 73  |ons% 2048..... s|
00000450  70 72 69 74 65 73 25 20  35 31 32 0d 02 12 11 21  |prites% 512....!|
00000460  73 70 72 69 74 65 73 25  3d 35 31 32 0d 02 1c 3c  |sprites%=512...<|
00000470  c8 99 20 22 4f 53 5f 53  70 72 69 74 65 4f 70 22  |.. "OS_SpriteOp"|
00000480  2c 32 35 36 2b 31 30 2c  73 70 72 69 74 65 73 25  |,256+10,sprites%|
00000490  2c 22 3c 4d 61 74 63 68  65 73 24 44 69 72 3e 2e  |,"<Matches$Dir>.|
000004a0  53 70 72 69 74 65 73 22  0d 02 26 20 74 65 6d 70  |Sprites"..& temp|
000004b0  6c 61 74 65 5f 69 6e 64  25 3d 69 6e 64 5f 69 63  |late_ind%=ind_ic|
000004c0  6f 6e 73 25 2b 35 31 32  0d 02 30 2c 74 65 6d 70  |ons%+512..0,temp|
000004d0  6c 61 74 65 5f 69 6e 64  5f 65 6e 64 25 3d 74 65  |late_ind_end%=te|
000004e0  6d 70 6c 61 74 65 5f 69  6e 64 25 2b 31 30 32 34  |mplate_ind%+1024|
000004f0  2b 35 31 32 0d 02 3a 0b  71 75 69 74 25 3d a3 0d  |+512..:.quit%=..|
00000500  02 44 3c c8 99 20 22 57  69 6d 70 5f 49 6e 69 74  |.D<.. "Wimp_Init|
00000510  69 61 6c 69 73 65 22 2c  32 30 30 2c 26 34 42 35  |ialise",200,&4B5|
00000520  33 34 31 35 34 2c 22 4d  61 74 63 68 20 67 61 6d  |34154,"Match gam|
00000530  65 22 20 b8 20 2c 74 61  73 6b 25 0d 02 4e 2a f2  |e" . ,task%..N*.|
00000540  63 72 65 61 74 65 5f 69  63 6f 6e 62 61 72 5f 69  |create_iconbar_i|
00000550  63 6f 6e 28 22 22 2c 22  21 4d 61 74 63 68 65 73  |con("","!Matches|
00000560  22 2c 2d 31 29 0d 02 58  35 c8 99 20 22 57 69 6d  |",-1)..X5.. "Wim|
00000570  70 5f 4f 70 65 6e 54 65  6d 70 6c 61 74 65 22 2c  |p_OpenTemplate",|
00000580  2c 22 3c 4d 61 74 63 68  65 73 24 44 69 72 3e 2e  |,"<Matches$Dir>.|
00000590  54 65 6d 70 6c 61 74 65  73 22 0d 02 62 27 69 6e  |Templates"..b'in|
000005a0  66 6f 5f 77 69 6e 64 6f  77 25 3d a4 6c 6f 61 64  |fo_window%=.load|
000005b0  5f 74 65 6d 70 6c 61 74  65 28 22 49 6e 66 6f 22  |_template("Info"|
000005c0  29 0d 02 6c 2b 70 6c 61  79 5f 77 69 6e 64 6f 77  |)..l+play_window|
000005d0  25 3d a4 6c 6f 61 64 5f  74 65 6d 70 6c 61 74 65  |%=.load_template|
000005e0  28 22 50 6c 61 79 61 72  65 61 22 29 0d 02 76 1b  |("Playarea")..v.|
000005f0  c8 99 20 22 57 69 6d 70  5f 43 6c 6f 73 65 54 65  |.. "Wimp_CloseTe|
00000600  6d 70 6c 61 74 65 22 0d  02 80 50 69 63 6f 6e 5f  |mplate"...Picon_|
00000610  62 61 72 5f 6d 65 6e 75  25 3d a4 63 72 65 61 74  |bar_menu%=.creat|
00000620  65 5f 6d 65 6e 75 5f 62  6c 6b 28 6d 65 6e 75 5f  |e_menu_blk(menu_|
00000630  62 6c 6b 25 2c 22 4d 61  74 63 68 65 73 7c 3e 49  |blk%,"Matches|>I|
00000640  6e 66 6f 2c 69 6e 66 6f  5f 77 69 6e 64 6f 77 25  |nfo,info_window%|
00000650  7c 51 75 69 74 22 29 0d  02 8a 46 63 6f 6d 70 5f  ||Quit")...Fcomp_|
00000660  67 61 6d 65 5f 6d 65 6e  75 25 3d a4 63 72 65 61  |game_menu%=.crea|
00000670  74 65 5f 6d 65 6e 75 5f  62 6c 6b 28 6d 65 6e 75  |te_menu_blk(menu|
00000680  5f 62 6c 6b 25 2c 22 55  20 76 20 41 7c 2f 55 73  |_blk%,"U v A|/Us|
00000690  65 72 7c 43 6f 6d 70 75  74 65 72 22 29 0d 02 94  |er|Computer")...|
000006a0  4d 74 77 6f 5f 67 61 6d  65 5f 6d 65 6e 75 25 3d  |Mtwo_game_menu%=|
000006b0  a4 63 72 65 61 74 65 5f  6d 65 6e 75 5f 62 6c 6b  |.create_menu_blk|
000006c0  28 6d 65 6e 75 5f 62 6c  6b 25 2c 22 55 20 76 20  |(menu_blk%,"U v |
000006d0  55 7c 2f 50 6c 61 79 65  72 20 6f 6e 65 7c 50 6c  |U|/Player one|Pl|
000006e0  61 79 65 72 20 74 77 6f  22 29 0d 02 9e 77 67 61  |ayer two")...wga|
000006f0  6d 65 5f 6d 65 6e 75 25  3d a4 63 72 65 61 74 65  |me_menu%=.create|
00000700  5f 6d 65 6e 75 5f 62 6c  6b 28 6d 65 6e 75 5f 62  |_menu_blk(menu_b|
00000710  6c 6b 25 2c 22 4d 61 74  63 68 65 73 7c 2f 3e 55  |lk%,"Matches|/>U|
00000720  73 65 72 20 76 20 41 72  63 2c 63 6f 6d 70 5f 67  |ser v Arc,comp_g|
00000730  61 6d 65 5f 6d 65 6e 75  25 7c 2e 3e 55 73 65 72  |ame_menu%|.>User|
00000740  20 76 20 55 73 65 72 2c  74 77 6f 5f 67 61 6d 65  | v User,two_game|
00000750  5f 6d 65 6e 75 25 7c 4e  65 77 20 47 61 6d 65 22  |_menu%|New Game"|
00000760  29 0d 02 a8 13 63 75 72  72 65 6e 74 5f 6d 65 6e  |)....current_men|
00000770  75 25 3d 30 0d 02 b2 15  f2 69 6e 69 74 5f 6d 61  |u%=0.....init_ma|
00000780  74 63 68 5f 69 63 6f 6e  73 0d 02 bc 05 e1 0d 02  |tch_icons.......|
00000790  c6 05 3a 0d 02 d0 1b dd  20 a4 6c 6f 61 64 5f 74  |..:..... .load_t|
000007a0  65 6d 70 6c 61 74 65 28  6e 61 6d 65 24 29 0d 02  |emplate(name$)..|
000007b0  da 0d ea 20 77 69 6e 64  6f 77 25 0d 02 e4 6a c8  |... window%...j.|
000007c0  99 20 22 57 69 6d 70 5f  4c 6f 61 64 54 65 6d 70  |. "Wimp_LoadTemp|
000007d0  6c 61 74 65 22 2c 2c 70  6c 61 79 5f 77 69 6e 25  |late",,play_win%|
000007e0  2c 74 65 6d 70 6c 61 74  65 5f 69 6e 64 25 2c 74  |,template_ind%,t|
000007f0  65 6d 70 6c 61 74 65 5f  69 6e 64 5f 65 6e 64 25  |emplate_ind_end%|
00000800  2c 2d 31 2c 6e 61 6d 65  24 2b c4 31 32 2c bd 30  |,-1,name$+.12,.0|
00000810  29 2c 30 20 b8 20 2c 2c  74 65 6d 70 6c 61 74 65  |),0 . ,,template|
00000820  5f 69 6e 64 25 0d 02 ee  19 70 6c 61 79 5f 77 69  |_ind%....play_wi|
00000830  6e 25 21 36 34 3d 73 70  72 69 74 65 73 25 0d 02  |n%!64=sprites%..|
00000840  f8 2f c8 99 20 22 57 69  6d 70 5f 43 72 65 61 74  |./.. "Wimp_Creat|
00000850  65 57 69 6e 64 6f 77 22  2c 2c 70 6c 61 79 5f 77  |eWindow",,play_w|
00000860  69 6e 25 20 b8 20 77 69  6e 64 6f 77 25 0d 03 02  |in% . window%...|
00000870  0c 3d 77 69 6e 64 6f 77  25 0d 03 0c 05 3a 0d 03  |.=window%....:..|
00000880  16 10 dd 20 f2 70 6f 6c  6c 5f 77 69 6d 70 0d 03  |... .poll_wimp..|
00000890  20 27 c8 99 20 22 57 69  6d 70 5f 50 6f 6c 6c 22  | '.. "Wimp_Poll"|
000008a0  2c 2c 70 6f 6c 6c 5f 62  6c 6b 25 20 b8 20 61 63  |,,poll_blk% . ac|
000008b0  74 69 6f 6e 25 0d 03 2a  10 c8 8e 20 61 63 74 69  |tion%..*... acti|
000008c0  6f 6e 25 20 ca 0d 03 34  18 c9 20 30 20 3a 20 f2  |on% ...4.. 0 : .|
000008d0  63 6f 6d 70 75 74 65 72  5f 74 75 72 6e 0d 03 3e  |computer_turn..>|
000008e0  18 c9 20 31 20 3a 20 f2  72 65 64 72 61 77 5f 77  |.. 1 : .redraw_w|
000008f0  69 6e 64 6f 77 0d 03 48  29 c9 20 32 20 3a 20 c8  |indow..H). 2 : .|
00000900  99 20 22 57 69 6d 70 5f  4f 70 65 6e 57 69 6e 64  |. "Wimp_OpenWind|
00000910  6f 77 22 2c 2c 70 6f 6c  6c 5f 62 6c 6b 25 0d 03  |ow",,poll_blk%..|
00000920  52 2a c9 20 33 20 3a 20  c8 99 20 22 57 69 6d 70  |R*. 3 : .. "Wimp|
00000930  5f 43 6c 6f 73 65 57 69  6e 64 6f 77 22 2c 2c 70  |_CloseWindow",,p|
00000940  6f 6c 6c 5f 62 6c 6b 25  0d 03 5c 55 c9 20 36 20  |oll_blk%..\U. 6 |
00000950  3a 20 f2 6d 6f 75 73 65  5f 63 6c 69 63 6b 28 70  |: .mouse_click(p|
00000960  6f 6c 6c 5f 62 6c 6b 25  21 31 32 2c 70 6f 6c 6c  |oll_blk%!12,poll|
00000970  5f 62 6c 6b 25 21 31 36  2c 70 6f 6c 6c 5f 62 6c  |_blk%!16,poll_bl|
00000980  6b 25 21 30 2c 70 6f 6c  6c 5f 62 6c 6b 25 21 34  |k%!0,poll_blk%!4|
00000990  2c 70 6f 6c 6c 5f 62 6c  6b 25 21 38 29 0d 03 66  |,poll_blk%!8)..f|
000009a0  2f c9 20 39 20 3a 20 f2  6d 65 6e 75 5f 73 65 6c  |/. 9 : .menu_sel|
000009b0  65 63 74 28 70 6f 6c 6c  5f 62 6c 6b 25 21 30 2c  |ect(poll_blk%!0,|
000009c0  70 6f 6c 6c 5f 62 6c 6b  25 21 34 29 0d 03 70 21  |poll_blk%!4)..p!|
000009d0  c9 20 31 37 2c 31 38 20  3a 20 f2 6d 65 73 73 61  |. 17,18 : .messa|
000009e0  67 65 28 70 6f 6c 6c 5f  62 6c 6b 25 29 0d 03 7a  |ge(poll_blk%)..z|
000009f0  05 cb 0d 03 84 05 e1 0d  03 8e 05 3a 0d 03 98 14  |...........:....|
00000a00  dd 20 f2 72 65 64 72 61  77 5f 77 69 6e 64 6f 77  |. .redraw_window|
00000a10  0d 03 a2 2d c8 99 20 22  57 69 6d 70 5f 52 65 64  |...-.. "Wimp_Red|
00000a20  72 61 77 57 69 6e 64 6f  77 22 2c 2c 70 6f 6c 6c  |rawWindow",,poll|
00000a30  5f 62 6c 6b 25 20 b8 20  6d 6f 72 65 25 0d 03 ac  |_blk% . more%...|
00000a40  0c c8 95 20 6d 6f 72 65  25 0d 03 b6 2d c8 99 20  |... more%...-.. |
00000a50  22 57 69 6d 70 5f 47 65  74 52 65 63 74 61 6e 67  |"Wimp_GetRectang|
00000a60  6c 65 22 2c 2c 70 6f 6c  6c 5f 62 6c 6b 25 20 b8  |le",,poll_blk% .|
00000a70  20 6d 6f 72 65 25 0d 03  c0 05 ce 0d 03 ca 05 e1  | more%..........|
00000a80  0d 03 d4 05 3a 0d 03 de  11 dd 20 f2 63 6c 6f 73  |....:..... .clos|
00000a90  65 5f 77 69 6d 70 0d 03  e8 27 c8 99 20 22 57 69  |e_wimp...'.. "Wi|
00000aa0  6d 70 5f 43 6c 6f 73 65  44 6f 77 6e 22 2c 74 61  |mp_CloseDown",ta|
00000ab0  73 6b 25 2c 26 34 42 35  33 34 31 35 34 0d 03 f2  |sk%,&4B534154...|
00000ac0  05 e1 0d 03 fc 05 3a 0d  04 06 14 dd 20 f2 6d 65  |......:..... .me|
00000ad0  73 73 61 67 65 28 62 6c  6b 25 29 0d 04 10 19 e7  |ssage(blk%).....|
00000ae0  20 62 6c 6b 25 21 31 36  3d 30 20 8c 20 71 75 69  | blk%!16=0 . qui|
00000af0  74 25 3d b9 0d 04 1a 05  e1 0d 04 24 05 3a 0d 04  |t%=........$.:..|
00000b00  2e 31 dd 20 f2 63 72 65  61 74 65 5f 69 63 6f 6e  |.1. .create_icon|
00000b10  62 61 72 5f 69 63 6f 6e  28 74 65 78 74 24 2c 73  |bar_icon(text$,s|
00000b20  70 72 69 74 65 24 2c 77  69 6e 64 6f 77 25 29 0d  |prite$,window%).|
00000b30  04 38 18 77 69 6d 70 5f  74 65 6d 70 25 21 30 3d  |.8.wimp_temp%!0=|
00000b40  77 69 6e 64 6f 77 25 0d  04 42 12 77 69 6d 70 5f  |window%..B.wimp_|
00000b50  74 65 6d 70 25 21 34 3d  30 0d 04 4c 32 e7 20 74  |temp%!4=0..L2. t|
00000b60  65 78 74 24 3d 22 22 20  8c 20 77 69 6d 70 5f 74  |ext$="" . wimp_t|
00000b70  65 6d 70 25 21 38 3d 30  20 8b 20 77 69 6d 70 5f  |emp%!8=0 . wimp_|
00000b80  74 65 6d 70 25 21 38 3d  2d 31 36 0d 04 56 14 77  |temp%!8=-16..V.w|
00000b90  69 6d 70 5f 74 65 6d 70  25 21 31 32 3d 36 38 0d  |imp_temp%!12=68.|
00000ba0  04 60 34 e7 20 74 65 78  74 24 3d 22 22 20 8c 20  |.`4. text$="" . |
00000bb0  77 69 6d 70 5f 74 65 6d  70 25 21 31 36 3d 36 38  |wimp_temp%!16=68|
00000bc0  20 8b 20 77 69 6d 70 5f  74 65 6d 70 25 21 31 36  | . wimp_temp%!16|
00000bd0  3d 38 34 0d 04 6a 10 e7  20 74 65 78 74 24 3d 22  |=84..j.. text$="|
00000be0  22 20 8c 0d 04 74 12 e7  20 73 70 72 69 74 65 24  |" ...t.. sprite$|
00000bf0  3d 22 22 20 8c 0d 04 7e  05 e1 0d 04 88 05 cc 0d  |="" ...~........|
00000c00  04 92 1b 77 69 6d 70 5f  74 65 6d 70 25 21 32 30  |...wimp_temp%!20|
00000c10  3d 26 31 37 30 30 33 30  33 41 0d 04 9c 1c 24 28  |=&1700303A....$(|
00000c20  77 69 6d 70 5f 74 65 6d  70 25 2b 32 34 29 3d 73  |wimp_temp%+24)=s|
00000c30  70 72 69 74 65 24 0d 04  a6 05 cd 0d 04 b0 05 cc  |prite$..........|
00000c40  0d 04 ba 12 e7 20 73 70  72 69 74 65 24 3d 22 22  |..... sprite$=""|
00000c50  20 8c 0d 04 c4 1b 77 69  6d 70 5f 74 65 6d 70 25  | .....wimp_temp%|
00000c60  21 32 30 3d 26 31 37 30  30 33 30 33 39 0d 04 ce  |!20=&17003039...|
00000c70  1a 24 28 77 69 6d 70 5f  74 65 6d 70 25 2b 32 34  |.$(wimp_temp%+24|
00000c80  29 3d 74 65 78 74 24 0d  04 d8 05 cc 0d 04 e2 1c  |)=text$.........|
00000c90  de 20 74 65 78 74 5f 70  6c 61 63 65 25 20 a9 28  |. text_place% .(|
00000ca0  74 65 78 74 24 29 2b 32  0d 04 ec 20 de 20 73 70  |text$)+2... . sp|
00000cb0  72 69 74 65 5f 70 6c 61  63 65 25 20 a9 28 73 70  |rite_place% .(sp|
00000cc0  72 69 74 65 24 29 2b 33  0d 04 f6 19 24 74 65 78  |rite$)+3....$tex|
00000cd0  74 5f 70 6c 61 63 65 25  3d 74 65 78 74 24 2b bd  |t_place%=text$+.|
00000ce0  30 0d 05 00 21 24 73 70  72 69 74 65 5f 70 6c 61  |0...!$sprite_pla|
00000cf0  63 65 25 3d 22 53 22 2b  73 70 72 69 74 65 24 2b  |ce%="S"+sprite$+|
00000d00  bd 30 0d 05 0a 1b 77 69  6d 70 5f 74 65 6d 70 25  |.0....wimp_temp%|
00000d10  21 32 30 3d 26 31 37 30  30 33 31 33 42 0d 05 14  |!20=&1700313B...|
00000d20  1d 77 69 6d 70 5f 74 65  6d 70 25 21 32 34 3d 74  |.wimp_temp%!24=t|
00000d30  65 78 74 5f 70 6c 61 63  65 25 0d 05 1e 1f 77 69  |ext_place%....wi|
00000d40  6d 70 5f 74 65 6d 70 25  21 32 38 3d 73 70 72 69  |mp_temp%!28=spri|
00000d50  74 65 5f 70 6c 61 63 65  25 0d 05 28 1c 77 69 6d  |te_place%..(.wim|
00000d60  70 5f 74 65 6d 70 25 21  33 32 3d a9 28 74 65 78  |p_temp%!32=.(tex|
00000d70  74 24 29 2b 31 0d 05 32  05 cd 0d 05 3c 05 cd 0d  |t$)+1..2....<...|
00000d80  05 46 24 c8 99 20 22 57  69 6d 70 5f 43 72 65 61  |.F$.. "Wimp_Crea|
00000d90  74 65 49 63 6f 6e 22 2c  2c 77 69 6d 70 5f 74 65  |teIcon",,wimp_te|
00000da0  6d 70 25 0d 05 50 05 e1  0d 05 5a 05 3a 0d 05 64  |mp%..P....Z.:..d|
00000db0  2c dd 20 f2 6d 6f 75 73  65 5f 63 6c 69 63 6b 28  |,. .mouse_click(|
00000dc0  77 69 6e 64 6f 77 25 2c  69 63 6f 6e 25 2c 78 25  |window%,icon%,x%|
00000dd0  2c 79 25 2c 62 75 74 25  29 0d 05 6e 11 62 75 74  |,y%,but%)..n.but|
00000de0  25 3d 62 75 74 25 20 80  20 37 0d 05 78 12 e7 20  |%=but% . 7..x.. |
00000df0  28 62 75 74 25 20 80 20  35 29 20 8c 0d 05 82 10  |(but% . 5) .....|
00000e00  c8 8e 20 77 69 6e 64 6f  77 25 20 ca 0d 05 8c 2d  |.. window% ....-|
00000e10  c9 20 2d 32 20 3a 20 f2  6f 70 65 6e 5f 77 69 6e  |. -2 : .open_win|
00000e20  64 6f 77 28 70 6c 61 79  5f 77 69 6e 64 6f 77 25  |dow(play_window%|
00000e30  2c 31 30 30 2c 35 30 30  29 0d 05 96 28 c9 20 70  |,100,500)...(. p|
00000e40  6c 61 79 5f 77 69 6e 64  6f 77 25 20 3a 20 f2 6d  |lay_window% : .m|
00000e50  61 74 63 68 5f 63 6c 69  63 6b 28 69 63 6f 6e 25  |atch_click(icon%|
00000e60  29 0d 05 a0 05 cb 0d 05  aa 05 cc 0d 05 b4 10 c8  |)...............|
00000e70  8e 20 77 69 6e 64 6f 77  25 20 ca 0d 05 be 0a c9  |. window% ......|
00000e80  20 2d 32 20 3a 0d 05 c8  13 63 75 72 72 65 6e 74  | -2 :....current|
00000e90  5f 6d 65 6e 75 25 3d 31  0d 05 d2 32 c8 99 20 22  |_menu%=1...2.. "|
00000ea0  57 69 6d 70 5f 43 72 65  61 74 65 4d 65 6e 75 22  |Wimp_CreateMenu"|
00000eb0  2c 2c 69 63 6f 6e 5f 62  61 72 5f 6d 65 6e 75 25  |,,icon_bar_menu%|
00000ec0  2c 78 25 2d 36 34 2c 31  38 36 0d 05 dc 14 c9 20  |,x%-64,186..... |
00000ed0  70 6c 61 79 5f 77 69 6e  64 6f 77 25 20 3a 0d 05  |play_window% :..|
00000ee0  e6 13 63 75 72 72 65 6e  74 5f 6d 65 6e 75 25 3d  |..current_menu%=|
00000ef0  32 0d 05 f0 2a c8 99 20  22 57 69 6d 70 5f 43 72  |2...*.. "Wimp_Cr|
00000f00  65 61 74 65 4d 65 6e 75  22 2c 2c 67 61 6d 65 5f  |eateMenu",,game_|
00000f10  6d 65 6e 75 25 2c 78 25  2c 79 25 0d 05 fa 05 cb  |menu%,x%,y%.....|
00000f20  0d 06 04 05 cd 0d 06 0e  05 e1 0d 06 18 05 3a 0d  |..............:.|
00000f30  06 22 23 dd 20 a4 63 72  65 61 74 65 5f 6d 65 6e  |."#. .create_men|
00000f40  75 5f 62 6c 6b 28 6d 65  6e 75 25 2c 6d 65 6e 75  |u_blk(menu%,menu|
00000f50  24 29 0d 06 2c 15 6d 65  6e 75 5f 73 74 61 72 74  |$)..,.menu_start|
00000f60  25 3d 6d 65 6e 75 25 0d  06 36 25 6d 65 6e 75 5f  |%=menu%..6%menu_|
00000f70  74 69 74 6c 65 24 3d c0  6d 65 6e 75 24 2c a7 6d  |title$=.menu$,.m|
00000f80  65 6e 75 24 2c 22 7c 22  29 2d 31 29 0d 06 40 1f  |enu$,"|")-1)..@.|
00000f90  6d 65 6e 75 24 3d c1 6d  65 6e 75 24 2c a7 6d 65  |menu$=.menu$,.me|
00000fa0  6e 75 24 2c 22 7c 22 29  2b 31 29 0d 06 4a 1c 74  |nu$,"|")+1)..J.t|
00000fb0  65 78 74 5f 6c 65 6e 25  3d a9 28 6d 65 6e 75 5f  |ext_len%=.(menu_|
00000fc0  74 69 74 6c 65 24 29 0d  06 54 23 24 6d 65 6e 75  |title$)..T#$menu|
00000fd0  25 3d c0 6d 65 6e 75 5f  74 69 74 6c 65 24 2b c4  |%=.menu_title$+.|
00000fe0  31 32 2c bd 30 29 2c 31  32 29 0d 06 5e 16 6d 65  |12,.0),12)..^.me|
00000ff0  6e 75 25 21 31 32 3d 26  30 30 30 37 30 32 30 37  |nu%!12=&00070207|
00001000  0d 06 68 0e 6d 65 6e 75  25 21 31 36 3d 30 0d 06  |..h.menu%!16=0..|
00001010  72 0f 6d 65 6e 75 25 21  32 30 3d 34 34 0d 06 7c  |r.menu%!20=44..||
00001020  0e 6d 65 6e 75 25 21 32  34 3d 30 0d 06 86 0d 6d  |.menu%!24=0....m|
00001030  65 6e 75 25 2b 3d 32 38  0d 06 90 11 c8 95 20 a9  |enu%+=28...... .|
00001040  28 6d 65 6e 75 24 29 3e  30 0d 06 9a 15 e7 20 a7  |(menu$)>0..... .|
00001050  6d 65 6e 75 24 2c 22 7c  22 29 3e 30 20 8c 0d 06  |menu$,"|")>0 ...|
00001060  a4 10 6c 61 73 74 5f 69  74 65 6d 25 3d a3 0d 06  |..last_item%=...|
00001070  ae 24 6d 65 6e 75 5f 69  74 65 6d 24 3d c0 6d 65  |.$menu_item$=.me|
00001080  6e 75 24 2c a7 6d 65 6e  75 24 2c 22 7c 22 29 2d  |nu$,.menu$,"|")-|
00001090  31 29 0d 06 b8 1f 6d 65  6e 75 24 3d c1 6d 65 6e  |1)....menu$=.men|
000010a0  75 24 2c a7 6d 65 6e 75  24 2c 22 7c 22 29 2b 31  |u$,.menu$,"|")+1|
000010b0  29 0d 06 c2 05 cc 0d 06  cc 10 6c 61 73 74 5f 69  |).........last_i|
000010c0  74 65 6d 25 3d b9 0d 06  d6 14 6d 65 6e 75 5f 69  |tem%=.....menu_i|
000010d0  74 65 6d 24 3d 6d 65 6e  75 24 0d 06 e0 0c 6d 65  |tem$=menu$....me|
000010e0  6e 75 24 3d 22 22 0d 06  ea 05 cd 0d 06 f4 10 74  |nu$="".........t|
000010f0  69 63 6b 5f 6d 65 6e 75  25 3d a3 0d 06 fe 0f 73  |ick_menu%=.....s|
00001100  75 62 5f 6d 65 6e 75 25  3d a3 0d 07 08 11 77 72  |ub_menu%=.....wr|
00001110  69 74 65 5f 6d 65 6e 75  25 3d a3 0d 07 12 12 64  |ite_menu%=.....d|
00001120  6f 74 74 65 64 5f 6d 65  6e 75 25 3d a3 0d 07 1c  |otted_menu%=....|
00001130  58 c8 95 20 c0 6d 65 6e  75 5f 69 74 65 6d 24 2c  |X.. .menu_item$,|
00001140  31 29 3d 22 2f 22 20 84  20 c0 6d 65 6e 75 5f 69  |1)="/" . .menu_i|
00001150  74 65 6d 24 2c 31 29 3d  22 3e 22 20 84 20 c0 6d  |tem$,1)=">" . .m|
00001160  65 6e 75 5f 69 74 65 6d  24 2c 31 29 3d 22 3a 22  |enu_item$,1)=":"|
00001170  20 84 20 c0 6d 65 6e 75  5f 69 74 65 6d 24 2c 31  | . .menu_item$,1|
00001180  29 3d 22 2e 22 0d 07 26  27 e7 20 c0 6d 65 6e 75  |)="."..&'. .menu|
00001190  5f 69 74 65 6d 24 2c 31  29 3d 22 2f 22 20 8c 20  |_item$,1)="/" . |
000011a0  74 69 63 6b 5f 6d 65 6e  75 25 3d b9 0d 07 30 26  |tick_menu%=...0&|
000011b0  e7 20 c0 6d 65 6e 75 5f  69 74 65 6d 24 2c 31 29  |. .menu_item$,1)|
000011c0  3d 22 3e 22 20 8c 20 73  75 62 5f 6d 65 6e 75 25  |=">" . sub_menu%|
000011d0  3d b9 0d 07 3a 28 e7 20  c0 6d 65 6e 75 5f 69 74  |=...:(. .menu_it|
000011e0  65 6d 24 2c 31 29 3d 22  3a 22 20 8c 20 77 72 69  |em$,1)=":" . wri|
000011f0  74 65 5f 6d 65 6e 75 25  3d b9 0d 07 44 29 e7 20  |te_menu%=...D). |
00001200  c0 6d 65 6e 75 5f 69 74  65 6d 24 2c 31 29 3d 22  |.menu_item$,1)="|
00001210  2e 22 20 8c 20 64 6f 74  74 65 64 5f 6d 65 6e 75  |." . dotted_menu|
00001220  25 3d b9 0d 07 4e 1d 6d  65 6e 75 5f 69 74 65 6d  |%=...N.menu_item|
00001230  24 3d c1 6d 65 6e 75 5f  69 74 65 6d 24 2c 32 29  |$=.menu_item$,2)|
00001240  0d 07 58 05 ce 0d 07 62  12 e7 20 74 69 63 6b 5f  |..X....b.. tick_|
00001250  6d 65 6e 75 25 20 8c 0d  07 6c 0c 21 6d 65 6e 75  |menu% ...l.!menu|
00001260  25 3d 31 0d 07 76 05 cc  0d 07 80 0c 21 6d 65 6e  |%=1..v......!men|
00001270  75 25 3d 30 0d 07 8a 05  cd 0d 07 94 0e 6d 65 6e  |u%=0.........men|
00001280  75 25 21 34 3d 2d 31 0d  07 9e 15 6d 65 6e 75 25  |u%!4=-1....menu%|
00001290  21 38 3d 26 30 37 30 30  30 30 33 31 0d 07 a8 0e  |!8=&07000031....|
000012a0  6d 65 6e 75 25 21 31 32  3d 30 0d 07 b2 0e 6d 65  |menu%!12=0....me|
000012b0  6e 75 25 21 31 36 3d 30  0d 07 bc 0e 6d 65 6e 75  |nu%!16=0....menu|
000012c0  25 21 32 30 3d 30 0d 07  c6 11 e7 20 73 75 62 5f  |%!20=0..... sub_|
000012d0  6d 65 6e 75 25 20 8c 0d  07 d0 31 6d 65 6e 75 5f  |menu% ....1menu_|
000012e0  61 64 64 72 25 3d a0 28  c1 6d 65 6e 75 5f 69 74  |addr%=.(.menu_it|
000012f0  65 6d 24 2c a7 6d 65 6e  75 5f 69 74 65 6d 24 2c  |em$,.menu_item$,|
00001300  22 2c 22 29 2b 31 29 29  0d 07 da 2e 6d 65 6e 75  |",")+1))....menu|
00001310  5f 69 74 65 6d 24 3d c0  6d 65 6e 75 5f 69 74 65  |_item$=.menu_ite|
00001320  6d 24 2c a7 6d 65 6e 75  5f 69 74 65 6d 24 2c 22  |m$,.menu_item$,"|
00001330  2c 22 29 2d 31 29 0d 07  e4 16 6d 65 6e 75 25 21  |,")-1)....menu%!|
00001340  34 3d 6d 65 6e 75 5f 61  64 64 72 25 0d 07 ee 05  |4=menu_addr%....|
00001350  cd 0d 07 f8 13 e7 20 77  72 69 74 65 5f 6d 65 6e  |...... write_men|
00001360  75 25 20 8c 0d 08 02 15  21 6d 65 6e 75 25 3d 21  |u% .....!menu%=!|
00001370  6d 65 6e 75 25 20 84 20  34 0d 08 0c 30 77 72 69  |menu% . 4...0wri|
00001380  74 65 62 6c 6b 25 3d a0  28 c0 6d 65 6e 75 5f 69  |teblk%=.(.menu_i|
00001390  74 65 6d 24 2c a7 6d 65  6e 75 5f 69 74 65 6d 24  |tem$,.menu_item$|
000013a0  2c 22 2c 22 29 2d 31 29  29 0d 08 16 2e 6d 65 6e  |,",")-1))....men|
000013b0  75 5f 69 74 65 6d 24 3d  c1 6d 65 6e 75 5f 69 74  |u_item$=.menu_it|
000013c0  65 6d 24 2c a7 6d 65 6e  75 5f 69 74 65 6d 24 2c  |em$,.menu_item$,|
000013d0  22 2c 22 29 2b 31 29 0d  08 20 30 76 61 6c 69 64  |",")+1).. 0valid|
000013e0  62 6c 6b 25 3d a0 28 c0  6d 65 6e 75 5f 69 74 65  |blk%=.(.menu_ite|
000013f0  6d 24 2c a7 6d 65 6e 75  5f 69 74 65 6d 24 2c 22  |m$,.menu_item$,"|
00001400  2c 22 29 2d 31 29 29 0d  08 2a 30 77 72 69 74 65  |,")-1))..*0write|
00001410  6c 65 6e 25 3d a0 28 c1  6d 65 6e 75 5f 69 74 65  |len%=.(.menu_ite|
00001420  6d 24 2c a7 6d 65 6e 75  5f 69 74 65 6d 24 2c 22  |m$,.menu_item$,"|
00001430  2c 22 29 2b 31 29 29 0d  08 34 16 6d 65 6e 75 25  |,")+1))..4.menu%|
00001440  21 31 32 3d 77 72 69 74  65 62 6c 6b 25 0d 08 3e  |!12=writeblk%..>|
00001450  16 6d 65 6e 75 25 21 31  36 3d 76 61 6c 69 64 62  |.menu%!16=validb|
00001460  6c 6b 25 0d 08 48 16 6d  65 6e 75 25 21 32 30 3d  |lk%..H.menu%!20=|
00001470  77 72 69 74 65 6c 65 6e  25 0d 08 52 1a 6d 65 6e  |writelen%..R.men|
00001480  75 25 21 38 3d 6d 65 6e  75 25 21 38 20 84 20 26  |u%!8=menu%!8 . &|
00001490  31 30 30 0d 08 5c 05 cd  0d 08 66 26 e7 20 64 6f  |100..\....f&. do|
000014a0  74 74 65 64 5f 6d 65 6e  75 25 20 8c 20 21 6d 65  |tted_menu% . !me|
000014b0  6e 75 25 3d 21 6d 65 6e  75 25 20 84 20 32 0d 08  |nu%=!menu% . 2..|
000014c0  70 26 e7 20 6c 61 73 74  5f 69 74 65 6d 25 20 8c  |p&. last_item% .|
000014d0  20 21 6d 65 6e 75 25 3d  21 6d 65 6e 75 25 20 84  | !menu%=!menu% .|
000014e0  20 31 32 38 0d 08 7a 1a  e7 20 28 6d 65 6e 75 25  | 128..z.. (menu%|
000014f0  21 38 20 80 20 26 31 30  30 29 3d 30 20 8c 0d 08  |!8 . &100)=0 ...|
00001500  84 1f 24 28 6d 65 6e 75  25 2b 31 32 29 3d c0 6d  |..$(menu%+12)=.m|
00001510  65 6e 75 5f 69 74 65 6d  24 2c 31 31 29 0d 08 8e  |enu_item$,11)...|
00001520  24 e7 20 74 65 78 74 5f  6c 65 6e 25 3c a9 28 c0  |$. text_len%<.(.|
00001530  6d 65 6e 75 5f 69 74 65  6d 24 2c 31 31 29 29 20  |menu_item$,11)) |
00001540  8c 0d 08 98 20 74 65 78  74 5f 6c 65 6e 25 3d a9  |.... text_len%=.|
00001550  28 c0 6d 65 6e 75 5f 69  74 65 6d 24 2c 31 31 29  |(.menu_item$,11)|
00001560  29 0d 08 a2 05 cd 0d 08  ac 05 cd 0d 08 b6 0d 6d  |)..............m|
00001570  65 6e 75 25 2b 3d 32 34  0d 08 c0 05 ce 0d 08 ca  |enu%+=24........|
00001580  22 6d 65 6e 75 5f 73 74  61 72 74 25 21 31 36 3d  |"menu_start%!16=|
00001590  31 36 2a 74 65 78 74 5f  6c 65 6e 25 2b 31 36 0d  |16*text_len%+16.|
000015a0  08 d4 13 6d 65 6e 75 5f  62 6c 6b 25 3d 6d 65 6e  |...menu_blk%=men|
000015b0  75 25 0d 08 de 10 3d 6d  65 6e 75 5f 73 74 61 72  |u%....=menu_star|
000015c0  74 25 0d 08 e8 05 3a 0d  08 f2 17 dd 20 a4 63 74  |t%....:..... .ct|
000015d0  72 6c 5f 74 65 72 6d 28  61 64 64 72 25 29 0d 08  |rl_term(addr%)..|
000015e0  fc 08 ea 20 41 24 0d 09  06 09 41 24 3d 22 22 0d  |... A$....A$="".|
000015f0  09 10 10 c8 95 20 3f 61  64 64 72 25 3e 33 31 0d  |..... ?addr%>31.|
00001600  09 1a 0f 41 24 2b 3d bd  3f 61 64 64 72 25 0d 09  |...A$+=.?addr%..|
00001610  24 0c 61 64 64 72 25 2b  3d 31 0d 09 2e 05 ce 0d  |$.addr%+=1......|
00001620  09 38 07 3d 41 24 0d 09  42 05 3a 0d 09 4c 21 dd  |.8.=A$..B.:..L!.|
00001630  20 f2 6f 70 65 6e 5f 77  69 6e 64 6f 77 28 77 69  | .open_window(wi|
00001640  6e 64 6f 77 25 2c 78 25  2c 79 25 29 0d 09 56 17  |ndow%,x%,y%)..V.|
00001650  21 77 69 6d 70 5f 74 65  6d 70 25 3d 77 69 6e 64  |!wimp_temp%=wind|
00001660  6f 77 25 0d 09 60 28 c8  99 20 22 57 69 6d 70 5f  |ow%..`(.. "Wimp_|
00001670  47 65 74 57 69 6e 64 6f  77 53 74 61 74 65 22 2c  |GetWindowState",|
00001680  2c 77 69 6d 70 5f 74 65  6d 70 25 0d 09 6a 0e e7  |,wimp_temp%..j..|
00001690  20 78 25 3c 3e 2d 31 20  8c 0d 09 74 1f 77 69 6d  | x%<>-1 ...t.wim|
000016a0  70 5f 74 65 6d 70 25 21  31 32 2d 3d 77 69 6d 70  |p_temp%!12-=wimp|
000016b0  5f 74 65 6d 70 25 21 34  0d 09 7e 13 77 69 6d 70  |_temp%!4..~.wimp|
000016c0  5f 74 65 6d 70 25 21 34  3d 78 25 0d 09 88 15 77  |_temp%!4=x%....w|
000016d0  69 6d 70 5f 74 65 6d 70  25 21 31 32 2b 3d 78 25  |imp_temp%!12+=x%|
000016e0  0d 09 92 05 cd 0d 09 9c  0e e7 20 79 25 3c 3e 2d  |.......... y%<>-|
000016f0  31 20 8c 0d 09 a6 1f 77  69 6d 70 5f 74 65 6d 70  |1 .....wimp_temp|
00001700  25 21 38 2d 3d 77 69 6d  70 5f 74 65 6d 70 25 21  |%!8-=wimp_temp%!|
00001710  31 36 0d 09 b0 14 77 69  6d 70 5f 74 65 6d 70 25  |16....wimp_temp%|
00001720  21 31 36 3d 79 25 0d 09  ba 14 77 69 6d 70 5f 74  |!16=y%....wimp_t|
00001730  65 6d 70 25 21 38 2b 3d  79 25 0d 09 c4 05 cd 0d  |emp%!8+=y%......|
00001740  09 ce 14 77 69 6d 70 5f  74 65 6d 70 25 21 32 38  |...wimp_temp%!28|
00001750  3d 2d 31 0d 09 d8 24 c8  99 20 22 57 69 6d 70 5f  |=-1...$.. "Wimp_|
00001760  4f 70 65 6e 57 69 6e 64  6f 77 22 2c 2c 77 69 6d  |OpenWindow",,wim|
00001770  70 5f 74 65 6d 70 25 0d  09 e2 05 e1 0d 09 ec 05  |p_temp%.........|
00001780  3a 0d 09 f6 3a dd 20 f2  73 65 74 5f 69 63 6f 6e  |:...:. .set_icon|
00001790  5f 64 61 74 61 28 77 69  6e 64 6f 77 25 2c 69 63  |_data(window%,ic|
000017a0  6f 6e 25 2c 74 65 78 74  24 2c 76 61 6c 69 64 24  |on%,text$,valid$|
000017b0  2c 65 6f 72 25 2c 63 6c  72 25 29 0d 0a 00 17 21  |,eor%,clr%)....!|
000017c0  77 69 6d 70 5f 74 65 6d  70 25 3d 77 69 6e 64 6f  |wimp_temp%=windo|
000017d0  77 25 0d 0a 0a 16 77 69  6d 70 5f 74 65 6d 70 25  |w%....wimp_temp%|
000017e0  21 34 3d 69 63 6f 6e 25  0d 0a 14 26 c8 99 20 22  |!4=icon%...&.. "|
000017f0  57 69 6d 70 5f 47 65 74  49 63 6f 6e 53 74 61 74  |Wimp_GetIconStat|
00001800  65 22 2c 2c 77 69 6d 70  5f 74 65 6d 70 25 0d 0a  |e",,wimp_temp%..|
00001810  1e 28 e7 20 74 65 78 74  24 3c 3e 22 22 20 8c 20  |.(. text$<>"" . |
00001820  24 28 77 69 6d 70 5f 74  65 6d 70 25 21 32 38 29  |$(wimp_temp%!28)|
00001830  3d 74 65 78 74 24 0d 0a  28 2a e7 20 76 61 6c 69  |=text$..(*. vali|
00001840  64 24 3c 3e 22 22 20 8c  20 24 28 77 69 6d 70 5f  |d$<>"" . $(wimp_|
00001850  74 65 6d 70 25 21 33 32  29 3d 76 61 6c 69 64 24  |temp%!32)=valid$|
00001860  0d 0a 32 15 77 69 6d 70  5f 74 65 6d 70 25 21 38  |..2.wimp_temp%!8|
00001870  3d 65 6f 72 25 0d 0a 3c  16 77 69 6d 70 5f 74 65  |=eor%..<.wimp_te|
00001880  6d 70 25 21 31 32 3d 63  6c 72 25 0d 0a 46 26 c8  |mp%!12=clr%..F&.|
00001890  99 20 22 57 69 6d 70 5f  53 65 74 49 63 6f 6e 53  |. "Wimp_SetIconS|
000018a0  74 61 74 65 22 2c 2c 77  69 6d 70 5f 74 65 6d 70  |tate",,wimp_temp|
000018b0  25 0d 0a 50 05 e1 0d 0a  5a 05 3a 0d 0a 64 20 dd  |%..P....Z.:..d .|
000018c0  20 f2 6d 65 6e 75 5f 73  65 6c 65 63 74 28 69 74  | .menu_select(it|
000018d0  65 6d 25 2c 69 74 65 6d  32 25 29 0d 0a 6e 28 c8  |em%,item2%)..n(.|
000018e0  99 20 22 57 69 6d 70 5f  47 65 74 50 6f 69 6e 74  |. "Wimp_GetPoint|
000018f0  65 72 49 6e 66 6f 22 2c  2c 77 69 6d 70 5f 74 65  |erInfo",,wimp_te|
00001900  6d 70 25 0d 0a 78 18 62  75 74 74 6f 6e 25 3d 77  |mp%..x.button%=w|
00001910  69 6d 70 5f 74 65 6d 70  25 21 38 0d 0a 82 17 e7  |imp_temp%!8.....|
00001920  20 63 75 72 72 65 6e 74  5f 6d 65 6e 75 25 3d 31  | current_menu%=1|
00001930  20 8c 0d 0a 8c 17 e7 20  69 74 65 6d 25 3d 31 20  | ...... item%=1 |
00001940  8c 20 71 75 69 74 25 3d  b9 0d 0a 96 05 cd 0d 0a  |. quit%=........|
00001950  a0 17 e7 20 63 75 72 72  65 6e 74 5f 6d 65 6e 75  |... current_menu|
00001960  25 3d 32 20 8c 0d 0a aa  0f e7 20 69 74 65 6d 25  |%=2 ...... item%|
00001970  3d 30 20 8c 0d 0a b4 23  67 61 6d 65 5f 6d 65 6e  |=0 ....#game_men|
00001980  75 25 21 32 38 3d 67 61  6d 65 5f 6d 65 6e 75 25  |u%!28=game_menu%|
00001990  21 32 38 20 84 20 31 0d  0a be 27 67 61 6d 65 5f  |!28 . 1...'game_|
000019a0  6d 65 6e 75 25 21 35 32  3d 67 61 6d 65 5f 6d 65  |menu%!52=game_me|
000019b0  6e 75 25 21 35 32 20 80  20 28 ac 20 31 29 0d 0a  |nu%!52 . (. 1)..|
000019c0  c8 10 e7 20 69 74 65 6d  32 25 3d 30 20 8c 0d 0a  |... item2%=0 ...|
000019d0  d2 2d 63 6f 6d 70 5f 67  61 6d 65 5f 6d 65 6e 75  |.-comp_game_menu|
000019e0  25 21 32 38 3d 63 6f 6d  70 5f 67 61 6d 65 5f 6d  |%!28=comp_game_m|
000019f0  65 6e 75 25 21 32 38 20  84 20 31 0d 0a dc 31 63  |enu%!28 . 1...1c|
00001a00  6f 6d 70 5f 67 61 6d 65  5f 6d 65 6e 75 25 21 35  |omp_game_menu%!5|
00001a10  32 3d 63 6f 6d 70 5f 67  61 6d 65 5f 6d 65 6e 75  |2=comp_game_menu|
00001a20  25 21 35 32 20 80 20 28  ac 20 31 29 0d 0a e6 05  |%!52 . (. 1)....|
00001a30  cd 0d 0a f0 10 e7 20 69  74 65 6d 32 25 3d 31 20  |...... item2%=1 |
00001a40  8c 0d 0a fa 2d 63 6f 6d  70 5f 67 61 6d 65 5f 6d  |....-comp_game_m|
00001a50  65 6e 75 25 21 35 32 3d  63 6f 6d 70 5f 67 61 6d  |enu%!52=comp_gam|
00001a60  65 5f 6d 65 6e 75 25 21  35 32 20 84 20 31 0d 0b  |e_menu%!52 . 1..|
00001a70  04 31 63 6f 6d 70 5f 67  61 6d 65 5f 6d 65 6e 75  |.1comp_game_menu|
00001a80  25 21 32 38 3d 63 6f 6d  70 5f 67 61 6d 65 5f 6d  |%!28=comp_game_m|
00001a90  65 6e 75 25 21 32 38 20  80 20 28 ac 20 31 29 0d  |enu%!28 . (. 1).|
00001aa0  0b 0e 05 cd 0d 0b 18 05  cd 0d 0b 22 0f e7 20 69  |...........".. i|
00001ab0  74 65 6d 25 3d 31 20 8c  0d 0b 2c 23 67 61 6d 65  |tem%=1 ...,#game|
00001ac0  5f 6d 65 6e 75 25 21 35  32 3d 67 61 6d 65 5f 6d  |_menu%!52=game_m|
00001ad0  65 6e 75 25 21 35 32 20  84 20 31 0d 0b 36 27 67  |enu%!52 . 1..6'g|
00001ae0  61 6d 65 5f 6d 65 6e 75  25 21 32 38 3d 67 61 6d  |ame_menu%!28=gam|
00001af0  65 5f 6d 65 6e 75 25 21  32 38 20 80 20 28 ac 20  |e_menu%!28 . (. |
00001b00  31 29 0d 0b 40 10 e7 20  69 74 65 6d 32 25 3d 30  |1)..@.. item2%=0|
00001b10  20 8c 0d 0b 4a 2b 74 77  6f 5f 67 61 6d 65 5f 6d  | ...J+two_game_m|
00001b20  65 6e 75 25 21 32 38 3d  74 77 6f 5f 67 61 6d 65  |enu%!28=two_game|
00001b30  5f 6d 65 6e 75 25 21 32  38 20 84 20 31 0d 0b 54  |_menu%!28 . 1..T|
00001b40  2f 74 77 6f 5f 67 61 6d  65 5f 6d 65 6e 75 25 21  |/two_game_menu%!|
00001b50  35 32 3d 74 77 6f 5f 67  61 6d 65 5f 6d 65 6e 75  |52=two_game_menu|
00001b60  25 21 35 32 20 80 20 28  ac 20 31 29 0d 0b 5e 05  |%!52 . (. 1)..^.|
00001b70  cd 0d 0b 68 10 e7 20 69  74 65 6d 32 25 3d 31 20  |...h.. item2%=1 |
00001b80  8c 0d 0b 72 2b 74 77 6f  5f 67 61 6d 65 5f 6d 65  |...r+two_game_me|
00001b90  6e 75 25 21 35 32 3d 74  77 6f 5f 67 61 6d 65 5f  |nu%!52=two_game_|
00001ba0  6d 65 6e 75 25 21 35 32  20 84 20 31 0d 0b 7c 2f  |menu%!52 . 1..|/|
00001bb0  74 77 6f 5f 67 61 6d 65  5f 6d 65 6e 75 25 21 32  |two_game_menu%!2|
00001bc0  38 3d 74 77 6f 5f 67 61  6d 65 5f 6d 65 6e 75 25  |8=two_game_menu%|
00001bd0  21 32 38 20 80 20 28 ac  20 31 29 0d 0b 86 05 cd  |!28 . (. 1).....|
00001be0  0d 0b 90 05 cd 0d 0b 9a  0f e7 20 69 74 65 6d 25  |.......... item%|
00001bf0  3d 32 20 8c 0d 0b a4 11  f2 69 6e 69 74 5f 6d 61  |=2 ......init_ma|
00001c00  74 63 68 65 73 0d 0b ae  15 f2 69 6e 69 74 5f 6d  |tches.....init_m|
00001c10  61 74 63 68 5f 69 63 6f  6e 73 0d 0b b8 0e f2 69  |atch_icons.....i|
00001c20  6e 69 74 5f 67 61 6d 65  0d 0b c2 24 f2 6f 70 65  |nit_game...$.ope|
00001c30  6e 5f 77 69 6e 64 6f 77  28 70 6c 61 79 5f 77 69  |n_window(play_wi|
00001c40  6e 64 6f 77 25 2c 2d 31  2c 2d 31 29 0d 0b cc 05  |ndow%,-1,-1)....|
00001c50  cd 0d 0b d6 05 cd 0d 0b  e0 17 e7 20 28 62 75 74  |........... (but|
00001c60  74 6f 6e 25 20 80 20 31  29 3d 31 20 8c 0d 0b ea  |ton% . 1)=1 ....|
00001c70  2f e7 20 63 75 72 72 65  6e 74 5f 6d 65 6e 75 25  |/. current_menu%|
00001c80  3d 31 20 8c 20 63 75 72  6d 65 6e 75 25 3d 69 63  |=1 . curmenu%=ic|
00001c90  6f 6e 5f 62 61 72 5f 6d  65 6e 75 25 0d 0b f4 2b  |on_bar_menu%...+|
00001ca0  e7 20 63 75 72 72 65 6e  74 5f 6d 65 6e 75 25 3d  |. current_menu%=|
00001cb0  32 20 8c 20 63 75 72 6d  65 6e 75 25 3d 67 61 6d  |2 . curmenu%=gam|
00001cc0  65 5f 6d 65 6e 75 25 0d  0b fe 28 c8 99 20 22 57  |e_menu%...(.. "W|
00001cd0  69 6d 70 5f 43 72 65 61  74 65 4d 65 6e 75 22 2c  |imp_CreateMenu",|
00001ce0  2c 63 75 72 6d 65 6e 75  25 2c 78 25 2c 79 25 0d  |,curmenu%,x%,y%.|
00001cf0  0c 08 05 cd 0d 0c 12 05  e1 0d 0c 1c 05 3a 0d 0c  |.............:..|
00001d00  26 17 dd 20 f2 69 6e 69  74 5f 6d 61 74 63 68 5f  |&.. .init_match_|
00001d10  69 63 6f 6e 73 0d 0c 30  1c 21 77 69 6d 70 5f 74  |icons..0.!wimp_t|
00001d20  65 6d 70 25 3d 70 6c 61  79 5f 77 69 6e 64 6f 77  |emp%=play_window|
00001d30  25 0d 0c 3a 26 c8 99 20  22 57 69 6d 70 5f 44 65  |%..:&.. "Wimp_De|
00001d40  6c 65 74 65 57 69 6e 64  6f 77 22 2c 2c 77 69 6d  |leteWindow",,wim|
00001d50  70 5f 74 65 6d 70 25 0d  0c 44 34 c8 99 20 22 57  |p_temp%..D4.. "W|
00001d60  69 6d 70 5f 43 72 65 61  74 65 57 69 6e 64 6f 77  |imp_CreateWindow|
00001d70  22 2c 2c 70 6c 61 79 5f  77 69 6e 25 20 b8 20 70  |",,play_win% . p|
00001d80  6c 61 79 5f 77 69 6e 64  6f 77 25 0d 0c 4e 1c 21  |lay_window%..N.!|
00001d90  77 69 6d 70 5f 74 65 6d  70 25 3d 70 6c 61 79 5f  |wimp_temp%=play_|
00001da0  77 69 6e 64 6f 77 25 0d  0c 58 1a e3 20 58 25 3d  |window%..X.. X%=|
00001db0  30 b8 20 6e 6f 5f 6f 66  5f 6c 69 6e 65 73 25 2d  |0. no_of_lines%-|
00001dc0  31 0d 0c 62 16 e7 20 6d  61 74 63 68 65 73 25 28  |1..b.. matches%(|
00001dd0  58 25 29 3c 38 20 8c 0d  0c 6c 1c e3 20 59 25 3d  |X%)<8 ...l.. Y%=|
00001de0  37 b8 6d 61 74 63 68 65  73 25 28 58 25 29 20 88  |7.matches%(X%) .|
00001df0  20 2d 31 0d 0c 76 28 77  69 6d 70 5f 74 65 6d 70  | -1..v(wimp_temp|
00001e00  25 21 34 3d 59 25 2b 58  25 2a 6d 61 74 63 68 65  |%!4=Y%+X%*matche|
00001e10  73 5f 70 65 72 5f 6c 69  6e 65 25 0d 0c 80 24 c8  |s_per_line%...$.|
00001e20  99 20 22 57 69 6d 70 5f  44 65 6c 65 74 65 49 63  |. "Wimp_DeleteIc|
00001e30  6f 6e 22 2c 2c 77 69 6d  70 5f 74 65 6d 70 25 0d  |on",,wimp_temp%.|
00001e40  0c 8a 08 ed 20 59 25 0d  0c 94 05 cd 0d 0c 9e 08  |.... Y%.........|
00001e50  ed 20 58 25 0d 0c a8 05  e1 0d 0c b2 05 3a 0d 0c  |. X%.........:..|
00001e60  bc 10 dd 20 f2 69 6e 69  74 5f 67 61 6d 65 0d 0c  |... .init_game..|
00001e70  c6 1d e7 20 28 28 67 61  6d 65 5f 6d 65 6e 75 25  |... ((game_menu%|
00001e80  21 32 38 29 20 80 20 31  29 20 8c 0d 0c d0 11 74  |!28) . 1) .....t|
00001e90  77 6f 5f 70 6c 61 79 65  72 25 3d a3 0d 0c da 22  |wo_player%=...."|
00001ea0  e7 20 28 28 63 6f 6d 70  5f 67 61 6d 65 5f 6d 65  |. ((comp_game_me|
00001eb0  6e 75 25 21 32 38 29 20  80 20 31 29 20 8c 0d 0c  |nu%!28) . 1) ...|
00001ec0  e4 14 63 6f 6d 70 75 74  65 72 5f 74 75 72 6e 25  |..computer_turn%|
00001ed0  3d a3 0d 0c ee 05 cc 0d  0c f8 14 63 6f 6d 70 75  |=..........compu|
00001ee0  74 65 72 5f 74 75 72 6e  25 3d b9 0d 0d 02 05 cd  |ter_turn%=......|
00001ef0  0d 0d 0c 05 cc 0d 0d 16  11 74 77 6f 5f 70 6c 61  |.........two_pla|
00001f00  79 65 72 25 3d b9 0d 0d  20 14 63 6f 6d 70 75 74  |yer%=... .comput|
00001f10  65 72 5f 74 75 72 6e 25  3d a3 0d 0d 2a 21 e7 20  |er_turn%=...*!. |
00001f20  28 28 74 77 6f 5f 67 61  6d 65 5f 6d 65 6e 75 25  |((two_game_menu%|
00001f30  21 32 38 29 20 80 20 31  29 20 8c 0d 0d 34 14 70  |!28) . 1) ...4.p|
00001f40  6c 61 79 65 72 5f 32 5f  74 75 72 6e 25 3d a3 0d  |layer_2_turn%=..|
00001f50  0d 3e 05 cc 0d 0d 48 14  70 6c 61 79 65 72 5f 32  |.>....H.player_2|
00001f60  5f 74 75 72 6e 25 3d b9  0d 0d 52 05 cd 0d 0d 5c  |_turn%=...R....\|
00001f70  05 cd 0d 0d 66 10 67 61  6d 65 5f 6f 76 65 72 25  |....f.game_over%|
00001f80  3d a3 0d 0d 70 05 e1 0d  0d 7a 05 3a 0d 0d 84 19  |=...p....z.:....|
00001f90  dd 20 f2 6d 61 74 63 68  5f 63 6c 69 63 6b 28 69  |. .match_click(i|
00001fa0  63 6f 6e 25 29 0d 0d 8e  19 ea 20 6c 69 6e 65 25  |con%)..... line%|
00001fb0  2c 6d 61 74 63 68 25 2c  74 6f 74 61 6c 25 0d 0d  |,match%,total%..|
00001fc0  98 14 e7 20 67 61 6d 65  5f 6f 76 65 72 25 3d a3  |... game_over%=.|
00001fd0  20 8c 0d 0d a2 18 e7 20  63 6f 6d 70 75 74 65 72  | ...... computer|
00001fe0  5f 74 75 72 6e 25 3d a3  20 8c 0d 0d ac 37 e7 20  |_turn%=. ....7. |
00001ff0  69 63 6f 6e 25 3e 3d 30  20 80 20 69 63 6f 6e 25  |icon%>=0 . icon%|
00002000  3c 6e 6f 5f 6f 66 5f 6c  69 6e 65 73 25 2a 6d 61  |<no_of_lines%*ma|
00002010  74 63 68 65 73 5f 70 65  72 5f 6c 69 6e 65 25 20  |tches_per_line% |
00002020  8c 0d 0d b6 1c 21 77 69  6d 70 5f 74 65 6d 70 25  |.....!wimp_temp%|
00002030  3d 70 6c 61 79 5f 77 69  6e 64 6f 77 25 0d 0d c0  |=play_window%...|
00002040  16 77 69 6d 70 5f 74 65  6d 70 25 21 34 3d 69 63  |.wimp_temp%!4=ic|
00002050  6f 6e 25 0d 0d ca 26 c8  99 20 22 57 69 6d 70 5f  |on%...&.. "Wimp_|
00002060  47 65 74 49 63 6f 6e 53  74 61 74 65 22 2c 2c 77  |GetIconState",,w|
00002070  69 6d 70 5f 74 65 6d 70  25 0d 0d d4 25 e7 20 28  |imp_temp%...%. (|
00002080  28 77 69 6d 70 5f 74 65  6d 70 25 21 32 34 29 20  |(wimp_temp%!24) |
00002090  80 20 28 31 3c 3c 32 33  29 29 3d 30 20 8c 0d 0d  |. (1<<23))=0 ...|
000020a0  de 23 6c 69 6e 65 25 3d  69 63 6f 6e 25 20 81 20  |.#line%=icon% . |
000020b0  6d 61 74 63 68 65 73 5f  70 65 72 5f 6c 69 6e 65  |matches_per_line|
000020c0  25 0d 0d e8 24 6d 61 74  63 68 25 3d 69 63 6f 6e  |%...$match%=icon|
000020d0  25 20 83 20 6d 61 74 63  68 65 73 5f 70 65 72 5f  |% . matches_per_|
000020e0  6c 69 6e 65 25 0d 0d f2  3a e3 20 58 25 3d 69 63  |line%...:. X%=ic|
000020f0  6f 6e 25 20 b8 20 6d 61  74 63 68 65 73 25 28 6c  |on% . matches%(l|
00002100  69 6e 65 25 29 2b 6c 69  6e 65 25 2a 6d 61 74 63  |ine%)+line%*matc|
00002110  68 65 73 5f 70 65 72 5f  6c 69 6e 65 25 2d 31 0d  |hes_per_line%-1.|
00002120  0d fc 13 77 69 6d 70 5f  74 65 6d 70 25 21 34 3d  |...wimp_temp%!4=|
00002130  58 25 0d 0e 06 24 c8 99  20 22 57 69 6d 70 5f 44  |X%...$.. "Wimp_D|
00002140  65 6c 65 74 65 49 63 6f  6e 22 2c 2c 77 69 6d 70  |eleteIcon",,wimp|
00002150  5f 74 65 6d 70 25 0d 0e  10 08 ed 20 58 25 0d 0e  |_temp%..... X%..|
00002160  1a 35 c8 99 20 22 57 69  6d 70 5f 46 6f 72 63 65  |.5.. "Wimp_Force|
00002170  52 65 64 72 61 77 22 2c  70 6c 61 79 5f 77 69 6e  |Redraw",play_win|
00002180  64 6f 77 25 2c 30 2c 2d  31 30 30 30 2c 31 30 30  |dow%,0,-1000,100|
00002190  30 2c 30 0d 0e 24 1a 6d  61 74 63 68 65 73 25 28  |0,0..$.matches%(|
000021a0  6c 69 6e 65 25 29 3d 6d  61 74 63 68 25 0d 0e 2e  |line%)=match%...|
000021b0  13 e7 20 74 77 6f 5f 70  6c 61 79 65 72 25 20 8c  |.. two_player% .|
000021c0  0d 0e 38 2e e7 20 c6 8e  28 6d 61 74 63 68 65 73  |..8.. ..(matches|
000021d0  25 28 29 29 3d 31 20 8c  20 f2 6c 6f 73 65 28 70  |%())=1 . .lose(p|
000021e0  6c 61 79 65 72 5f 32 5f  74 75 72 6e 25 29 0d 0e  |layer_2_turn%)..|
000021f0  42 30 e7 20 c6 8e 28 6d  61 74 63 68 65 73 25 28  |B0. ..(matches%(|
00002200  29 29 3d 30 20 8c 20 f2  6c 6f 73 65 28 ac 20 70  |))=0 . .lose(. p|
00002210  6c 61 79 65 72 5f 32 5f  74 75 72 6e 25 29 0d 0e  |layer_2_turn%)..|
00002220  4c 23 70 6c 61 79 65 72  5f 32 5f 74 75 72 6e 25  |L#player_2_turn%|
00002230  3d ac 20 70 6c 61 79 65  72 5f 32 5f 74 75 72 6e  |=. player_2_turn|
00002240  25 0d 0e 56 05 cc 0d 0e  60 14 63 6f 6d 70 75 74  |%..V....`.comput|
00002250  65 72 5f 74 75 72 6e 25  3d b9 0d 0e 6a 21 e7 20  |er_turn%=...j!. |
00002260  c6 8e 28 6d 61 74 63 68  65 73 25 28 29 29 3d 31  |..(matches%())=1|
00002270  20 8c 20 f2 6c 6f 73 65  28 31 29 0d 0e 74 21 e7  | . .lose(1)..t!.|
00002280  20 c6 8e 28 6d 61 74 63  68 65 73 25 28 29 29 3d  | ..(matches%())=|
00002290  30 20 8c 20 f2 6c 6f 73  65 28 30 29 0d 0e 7e 05  |0 . .lose(0)..~.|
000022a0  cd 0d 0e 88 05 cd 0d 0e  92 05 cd 0d 0e 9c 05 cd  |................|
000022b0  0d 0e a6 05 cd 0d 0e b0  05 e1 0d 0e ba 05 3a 0d  |..............:.|
000022c0  0e c4 1b dd 20 f2 6c 6f  73 65 28 63 6f 6d 70 75  |.... .lose(compu|
000022d0  74 65 72 5f 6c 6f 73 74  25 29 0d 0e ce 13 e7 20  |ter_lost%)..... |
000022e0  74 77 6f 5f 70 6c 61 79  65 72 25 20 8c 0d 0e d8  |two_player% ....|
000022f0  16 e7 20 63 6f 6d 70 75  74 65 72 5f 6c 6f 73 74  |.. computer_lost|
00002300  25 20 8c 0d 0e e2 2e f2  77 69 6d 70 5f 6d 65 73  |% ......wimp_mes|
00002310  73 61 67 65 28 22 43 6f  6e 67 72 61 74 75 6c 61  |sage("Congratula|
00002320  74 69 6f 6e 73 20 70 6c  61 79 65 72 20 32 21 22  |tions player 2!"|
00002330  29 0d 0e ec 05 cc 0d 0e  f6 2e f2 77 69 6d 70 5f  |)..........wimp_|
00002340  6d 65 73 73 61 67 65 28  22 43 6f 6e 67 72 61 74  |message("Congrat|
00002350  75 6c 61 74 69 6f 6e 73  20 70 6c 61 79 65 72 20  |ulations player |
00002360  31 21 22 29 0d 0f 00 05  cd 0d 0f 0a 05 cc 0d 0f  |1!")............|
00002370  14 16 e7 20 63 6f 6d 70  75 74 65 72 5f 6c 6f 73  |... computer_los|
00002380  74 25 20 8c 0d 0f 1e 2d  f2 77 69 6d 70 5f 6d 65  |t% ....-.wimp_me|
00002390  73 73 61 67 65 28 22 43  6f 6e 67 72 61 74 75 6c  |ssage("Congratul|
000023a0  61 74 69 6f 6e 73 21 20  59 6f 75 20 77 6f 6e 22  |ations! You won"|
000023b0  29 0d 0f 28 05 cc 0d 0f  32 24 f2 77 69 6d 70 5f  |)..(....2$.wimp_|
000023c0  6d 65 73 73 61 67 65 28  22 48 61 20 48 61 21 20  |message("Ha Ha! |
000023d0  59 6f 75 20 6c 6f 73 74  22 29 0d 0f 3c 05 cd 0d  |You lost")..<...|
000023e0  0f 46 05 cd 0d 0f 50 10  67 61 6d 65 5f 6f 76 65  |.F....P.game_ove|
000023f0  72 25 3d b9 0d 0f 5a 05  e1 0d 0f 64 05 3a 0d 0f  |r%=...Z....d.:..|
00002400  6e 14 dd 20 f2 63 6f 6d  70 75 74 65 72 5f 74 75  |n.. .computer_tu|
00002410  72 6e 0d 0f 78 16 20 e7  20 74 77 6f 5f 70 6c 61  |rn..x. . two_pla|
00002420  79 65 72 25 3d a3 20 8c  0d 0f 82 1a 20 20 e7 20  |yer%=. .....  . |
00002430  63 6f 6d 70 75 74 65 72  5f 74 75 72 6e 25 3d b9  |computer_turn%=.|
00002440  20 8c 0d 0f 8c 17 20 20  20 e7 20 67 61 6d 65 5f  | .....   . game_|
00002450  6f 76 65 72 25 3d a3 20  8c 0d 0f 96 10 20 20 20  |over%=. .....   |
00002460  20 6c 69 6e 65 73 25 3d  30 0d 0f a0 1d 20 20 20  | lines%=0....   |
00002470  20 e3 20 58 25 3d 30 b8  6e 6f 5f 6f 66 5f 6c 69  | . X%=0.no_of_li|
00002480  6e 65 73 25 2d 31 0d 0f  aa 25 20 20 20 20 20 e7  |nes%-1...%     .|
00002490  20 6d 61 74 63 68 65 73  25 28 58 25 29 3e 30 20  | matches%(X%)>0 |
000024a0  8c 20 6c 69 6e 65 73 25  2b 3d 31 0d 0f b4 0c 20  |. lines%+=1.... |
000024b0  20 20 20 ed 20 58 25 0d  0f be 16 20 20 20 20 62  |   . X%....    b|
000024c0  65 73 74 5f 70 6c 61 79  25 28 29 3d 30 0d 0f c8  |est_play%()=0...|
000024d0  14 20 20 20 20 e7 20 6c  69 6e 65 73 25 3e 31 20  |.    . lines%>1 |
000024e0  8c 0d 0f d2 0f 20 20 20  20 20 65 6f 72 25 3d 30  |.....     eor%=0|
000024f0  0d 0f e6 1e 20 20 20 20  20 e3 20 58 25 3d 30 b8  |....     . X%=0.|
00002500  6e 6f 5f 6f 66 5f 6c 69  6e 65 73 25 2d 31 0d 0f  |no_of_lines%-1..|
00002510  f0 22 20 20 20 20 20 20  65 6f 72 25 3d 65 6f 72  |."      eor%=eor|
00002520  25 20 82 20 6d 61 74 63  68 65 73 25 28 58 25 29  |% . matches%(X%)|
00002530  0d 0f fa 1a 20 20 20 20  20 20 e3 20 59 25 3d 30  |....      . Y%=0|
00002540  b8 6d 61 78 5f 62 69 74  73 25 0d 10 04 3c 20 20  |.max_bits%...<  |
00002550  20 20 20 20 20 e7 20 28  6d 61 74 63 68 65 73 25  |     . (matches%|
00002560  28 58 25 29 20 80 20 28  31 3c 3c 59 25 29 29 3c  |(X%) . (1<<Y%))<|
00002570  3e 30 20 8c 20 62 65 73  74 5f 70 6c 61 79 25 28  |>0 . best_play%(|
00002580  59 25 29 2b 3d 31 0d 10  0e 0e 20 20 20 20 20 20  |Y%)+=1....      |
00002590  ed 20 59 25 0d 10 18 0d  20 20 20 20 20 ed 20 58  |. Y%....     . X|
000025a0  25 0d 10 22 12 20 20 20  20 20 58 25 3d 30 3a 59  |%..".     X%=0:Y|
000025b0  25 3d 30 0d 10 2c 2c 20  20 20 20 20 62 6d 25 3d  |%=0..,,     bm%=|
000025c0  62 65 73 74 5f 70 6c 61  79 25 28 30 29 2d 28 6d  |best_play%(0)-(m|
000025d0  61 74 63 68 65 73 25 28  30 29 20 80 20 31 29 0d  |atches%(0) . 1).|
000025e0  10 36 1b 20 20 20 20 20  e3 20 5a 25 3d 31 20 b8  |.6.     . Z%=1 .|
000025f0  20 6d 61 78 5f 62 69 74  73 25 0d 10 40 41 20 20  | max_bits%..@A  |
00002600  20 20 20 20 e7 20 62 65  73 74 5f 70 6c 61 79 25  |    . best_play%|
00002610  28 5a 25 29 2b 28 28 6d  61 74 63 68 65 73 25 28  |(Z%)+((matches%(|
00002620  30 29 20 80 20 28 31 3c  3c 5a 25 29 29 3e 30 29  |0) . (1<<Z%))>0)|
00002630  3e 30 20 8c 20 62 6d 25  3d 2d 31 0d 10 4a 0d 20  |>0 . bm%=-1..J. |
00002640  20 20 20 20 ed 20 5a 25  0d 10 4b 11 20 20 20 20  |    . Z%..K.    |
00002650  20 6d 6f 76 65 25 3d 2d  31 0d 10 54 0a 20 20 20  | move%=-1..T.   |
00002660  20 20 f5 0d 10 5e 1c 20  20 20 20 20 20 e7 20 6d  |  ...^.      . m|
00002670  61 74 63 68 65 73 25 28  59 25 29 3e 30 20 8c 0d  |atches%(Y%)>0 ..|
00002680  10 68 34 20 20 20 20 20  20 20 e7 20 28 62 6d 25  |.h4       . (bm%|
00002690  3e 3d 30 20 80 20 28 28  62 6d 25 20 80 20 31 29  |>=0 . ((bm% . 1)|
000026a0  82 31 29 3c 6d 61 74 63  68 65 73 25 28 59 25 29  |.1)<matches%(Y%)|
000026b0  29 20 8c 0d 10 72 34 20  20 20 20 20 20 20 20 6d  |) ...r4        m|
000026c0  6f 76 65 25 3d 28 28 62  6d 25 20 80 20 31 29 82  |ove%=((bm% . 1).|
000026d0  31 29 2b 59 25 2a 6d 61  74 63 68 65 73 5f 70 65  |1)+Y%*matches_pe|
000026e0  72 5f 6c 69 6e 65 25 0d  10 7c 0d 20 20 20 20 20  |r_line%..|.     |
000026f0  20 20 cc 20 0d 10 86 2c  20 20 20 20 20 20 20 20  |  . ...,        |
00002700  e7 20 28 65 6f 72 25 20  82 20 6d 61 74 63 68 65  |. (eor% . matche|
00002710  73 25 28 59 25 29 20 82  20 58 25 29 3d 30 20 8c  |s%(Y%) . X%)=0 .|
00002720  0d 10 90 2a 20 20 20 20  20 20 20 20 20 6d 6f 76  |...*         mov|
00002730  65 25 3d 58 25 2b 59 25  2a 6d 61 74 63 68 65 73  |e%=X%+Y%*matches|
00002740  5f 70 65 72 5f 6c 69 6e  65 25 0d 10 9a 0d 20 20  |_per_line%....  |
00002750  20 20 20 20 20 20 cd 0d  10 a4 0c 20 20 20 20 20  |      .....     |
00002760  20 20 cd 0d 10 ae 10 20  20 20 20 20 20 20 58 25  |  .....       X%|
00002770  2b 3d 31 0d 10 b8 1f 20  20 20 20 20 20 20 e7 20  |+=1....       . |
00002780  58 25 3e 3d 6d 61 74 63  68 65 73 25 28 59 25 29  |X%>=matches%(Y%)|
00002790  20 8c 0d 10 c2 16 20 20  20 20 20 20 20 20 58 25  | .....        X%|
000027a0  3d 30 3a 59 25 2b 3d 31  0d 10 c3 1f 20 20 20 20  |=0:Y%+=1....    |
000027b0  20 20 20 20 e7 20 59 25  3c 6e 6f 5f 6f 66 5f 6c  |    . Y%<no_of_l|
000027c0  69 6e 65 73 25 20 8c 0d  10 cc 31 20 20 20 20 20  |ines% ....1     |
000027d0  20 20 20 20 62 6d 25 3d  62 65 73 74 5f 70 6c 61  |    bm%=best_pla|
000027e0  79 25 28 30 29 2d 28 6d  61 74 63 68 65 73 25 28  |y%(0)-(matches%(|
000027f0  59 25 29 20 80 20 31 29  0d 10 d6 1f 20 20 20 20  |Y%) . 1)....    |
00002800  20 20 20 20 20 e3 20 5a  25 3d 31 20 b8 20 6d 61  |     . Z%=1 . ma|
00002810  78 5f 62 69 74 73 25 0d  10 e0 46 20 20 20 20 20  |x_bits%...F     |
00002820  20 20 20 20 20 e7 20 62  65 73 74 5f 70 6c 61 79  |     . best_play|
00002830  25 28 5a 25 29 2b 28 28  6d 61 74 63 68 65 73 25  |%(Z%)+((matches%|
00002840  28 59 25 29 20 80 20 28  31 3c 3c 5a 25 29 29 3e  |(Y%) . (1<<Z%))>|
00002850  30 29 3e 30 20 8c 20 62  6d 25 3d 2d 31 0d 10 ea  |0)>0 . bm%=-1...|
00002860  11 20 20 20 20 20 20 20  20 20 ed 20 5a 25 0d 10  |.         . Z%..|
00002870  eb 0d 20 20 20 20 20 20  20 20 cd 0d 10 f4 0c 20  |..        ..... |
00002880  20 20 20 20 20 20 cd 0d  10 fe 0b 20 20 20 20 20  |      .....     |
00002890  20 cc 0d 11 08 10 20 20  20 20 20 20 20 59 25 2b  | .....       Y%+|
000028a0  3d 31 0d 11 12 20 20 20  20 20 20 20 20 e7 20 28  |=1...        . (|
000028b0  59 25 3c 6e 6f 5f 6f 66  5f 6c 69 6e 65 73 25 29  |Y%<no_of_lines%)|
000028c0  20 8c 0d 11 1c 31 20 20  20 20 20 20 20 20 20 62  | ....1         b|
000028d0  6d 25 3d 62 65 73 74 5f  70 6c 61 79 25 28 30 29  |m%=best_play%(0)|
000028e0  2d 28 6d 61 74 63 68 65  73 25 28 59 25 29 20 80  |-(matches%(Y%) .|
000028f0  20 31 29 0d 11 26 1f 20  20 20 20 20 20 20 20 20  | 1)..&.         |
00002900  e3 20 5a 25 3d 31 20 b8  20 6d 61 78 5f 62 69 74  |. Z%=1 . max_bit|
00002910  73 25 0d 11 30 46 20 20  20 20 20 20 20 20 20 20  |s%..0F          |
00002920  e7 20 62 65 73 74 5f 70  6c 61 79 25 28 5a 25 29  |. best_play%(Z%)|
00002930  2b 28 28 6d 61 74 63 68  65 73 25 28 59 25 29 20  |+((matches%(Y%) |
00002940  80 20 28 31 3c 3c 5a 25  29 29 3e 30 29 3e 30 20  |. (1<<Z%))>0)>0 |
00002950  8c 20 62 6d 25 3d 2d 31  0d 11 3a 11 20 20 20 20  |. bm%=-1..:.    |
00002960  20 20 20 20 20 ed 20 5a  25 0d 11 44 0c 20 20 20  |     . Z%..D.   |
00002970  20 20 20 20 cd 0d 11 4e  0b 20 20 20 20 20 20 cd  |    ...N.      .|
00002980  0d 11 58 26 20 20 20 20  20 fd 20 59 25 3e 3d 6e  |..X&     . Y%>=n|
00002990  6f 5f 6f 66 5f 6c 69 6e  65 73 25 20 84 20 6d 6f  |o_of_lines% . mo|
000029a0  76 65 25 3e 2d 31 0d 11  62 16 20 20 20 20 20 e7  |ve%>-1..b.     .|
000029b0  20 6d 6f 76 65 25 3c 3d  2d 31 20 8c 0d 11 6c 0b  | move%<=-1 ...l.|
000029c0  20 20 20 20 20 20 f5 0d  11 76 22 20 20 20 20 20  |      ...v"     |
000029d0  20 20 6c 69 6e 65 25 3d  b3 28 6e 6f 5f 6f 66 5f  |  line%=.(no_of_|
000029e0  6c 69 6e 65 73 25 2d 31  29 0d 11 80 1d 20 20 20  |lines%-1)....   |
000029f0  20 20 20 fd 20 6d 61 74  63 68 65 73 25 28 6c 69  |   . matches%(li|
00002a00  6e 65 25 29 3e 30 0d 11  8a 27 20 20 20 20 20 20  |ne%)>0...'      |
00002a10  6d 61 74 63 68 65 73 25  3d b3 28 6d 61 74 63 68  |matches%=.(match|
00002a20  65 73 25 28 6c 69 6e 65  25 29 2d 31 29 0d 11 94  |es%(line%)-1)...|
00002a30  30 20 20 20 20 20 20 6d  6f 76 65 25 3d 6d 61 74  |0      move%=mat|
00002a40  63 68 65 73 25 2b 6c 69  6e 65 25 2a 6d 61 74 63  |ches%+line%*matc|
00002a50  68 65 73 5f 70 65 72 5f  6c 69 6e 65 25 0d 11 9e  |hes_per_line%...|
00002a60  0a 20 20 20 20 20 cd 0d  11 a8 09 20 20 20 20 cc  |.     .....    .|
00002a70  0d 11 b2 1e 20 20 20 20  20 e3 20 58 25 3d 30 b8  |....     . X%=0.|
00002a80  6e 6f 5f 6f 66 5f 6c 69  6e 65 73 25 2d 31 0d 11  |no_of_lines%-1..|
00002a90  bc 25 20 20 20 20 20 20  e7 20 6d 61 74 63 68 65  |.%      . matche|
00002aa0  73 25 28 58 25 29 3e 30  20 8c 20 6c 69 6e 65 25  |s%(X%)>0 . line%|
00002ab0  3d 58 25 0d 11 c6 0d 20  20 20 20 20 ed 20 58 25  |=X%....     . X%|
00002ac0  0d 11 d0 26 20 20 20 20  20 6d 6f 76 65 25 3d 6c  |...&     move%=l|
00002ad0  69 6e 65 25 2a 6d 61 74  63 68 65 73 5f 70 65 72  |ine%*matches_per|
00002ae0  5f 6c 69 6e 65 25 0d 11  da 09 20 20 20 20 cd 0d  |_line%....    ..|
00002af0  11 e4 27 20 20 20 20 6c  69 6e 65 25 3d 6d 6f 76  |..'    line%=mov|
00002b00  65 25 20 81 20 6d 61 74  63 68 65 73 5f 70 65 72  |e% . matches_per|
00002b10  5f 6c 69 6e 65 25 0d 11  ee 28 20 20 20 20 6d 61  |_line%...(    ma|
00002b20  74 63 68 25 3d 6d 6f 76  65 25 20 83 20 6d 61 74  |tch%=move% . mat|
00002b30  63 68 65 73 5f 70 65 72  5f 6c 69 6e 65 25 0d 11  |ches_per_line%..|
00002b40  f8 3e 20 20 20 20 e3 20  58 25 3d 6d 6f 76 65 25  |.>    . X%=move%|
00002b50  20 b8 20 6d 61 74 63 68  65 73 25 28 6c 69 6e 65  | . matches%(line|
00002b60  25 29 2b 6c 69 6e 65 25  2a 6d 61 74 63 68 65 73  |%)+line%*matches|
00002b70  5f 70 65 72 5f 6c 69 6e  65 25 2d 31 0d 12 02 18  |_per_line%-1....|
00002b80  20 20 20 20 20 77 69 6d  70 5f 74 65 6d 70 25 21  |     wimp_temp%!|
00002b90  34 3d 58 25 0d 12 0c 29  20 20 20 20 20 c8 99 20  |4=X%...)     .. |
00002ba0  22 57 69 6d 70 5f 44 65  6c 65 74 65 49 63 6f 6e  |"Wimp_DeleteIcon|
00002bb0  22 2c 2c 77 69 6d 70 5f  74 65 6d 70 25 0d 12 16  |",,wimp_temp%...|
00002bc0  0c 20 20 20 20 ed 20 58  25 0d 12 20 39 20 20 20  |.    . X%.. 9   |
00002bd0  20 c8 99 20 22 57 69 6d  70 5f 46 6f 72 63 65 52  | .. "Wimp_ForceR|
00002be0  65 64 72 61 77 22 2c 70  6c 61 79 5f 77 69 6e 64  |edraw",play_wind|
00002bf0  6f 77 25 2c 30 2c 2d 31  30 30 30 2c 31 30 30 30  |ow%,0,-1000,1000|
00002c00  2c 30 0d 12 2a 1e 20 20  20 20 6d 61 74 63 68 65  |,0..*.    matche|
00002c10  73 25 28 6c 69 6e 65 25  29 3d 6d 61 74 63 68 25  |s%(line%)=match%|
00002c20  0d 12 34 18 20 20 20 20  63 6f 6d 70 75 74 65 72  |..4.    computer|
00002c30  5f 74 75 72 6e 25 3d a3  0d 12 3e 25 20 20 20 20  |_turn%=...>%    |
00002c40  e7 20 c6 8e 28 6d 61 74  63 68 65 73 25 28 29 29  |. ..(matches%())|
00002c50  3d 31 20 8c 20 f2 6c 6f  73 65 28 30 29 0d 12 48  |=1 . .lose(0)..H|
00002c60  08 20 20 20 cd 0d 12 52  07 20 20 cd 0d 12 5c 06  |.   ...R.  ...\.|
00002c70  20 cd 0d 12 66 05 e1 0d  ff                       | ...f....|
00002c79