Home » Recent acquisitions » Acorn ADFS disks » adfs_ArchimedesWorld_199204.adf » April92 » !AWApr92/Goodies/BackGammon/!Backgamon/Backgammon

!AWApr92/Goodies/BackGammon/!Backgamon/Backgammon

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_ArchimedesWorld_199204.adf » April92
Filename: !AWApr92/Goodies/BackGammon/!Backgamon/Backgammon
Read OK:
File size: D1BB bytes
Load address: 0000
Exec address: 0000
File contents
   10REM> <Backg$Dir>.Backgammon
   20REM Jonathan Evans, December 1989
   25REM (c) Archimedes World April 1992
   30
   40*FX200,1
   50PROCinit
   60REPEAT
   70PROCinitgame
   80PROCscreen
   90PROCstartgame
  100PROCplay
  110UNTIL FALSE
  120END
  130
  140DEFPROCscreen
  150LOCAL screen
  160update_bank=2:display_bank=2
  170*FX113,2
  180*FX112,2
  190SYS "Hourglass_On"
  200COLOUR 128+black:CLS
  210FOR screen = 1 TO 2
  220PROCswitch_update_bank
  230PROCboard
  240PROCpanel
  250PROCswitch_display_bank
  260MOUSE ON
  270NEXT screen
  280SYS "Hourglass_Off"
  290ENDPROC
  300
  310DEFPROCinit
  320X=RND(-TIME)
  330MODE 140: VDU 23,0,10,32|
  340blackmoney=1000:whitemoney=1000:blackplayer$="COMPUTER":whiteplayer$="HUMAN"
  350midgrey = 9: lightgrey = 10: darkgrey = 11: black = 0: white = 7
  360green = 2: brown = 6: red = 1: blue = 4: ivory = 14
  370COLOUR midgrey, 128,128,128: COLOUR darkgrey, 64,64,64: COLOUR lightgrey, 196,196,196
  380COLOUR green, 32,132,32: COLOUR brown, 148,50,52: COLOUR red,200,16,016
  390COLOUR 15,0,0,0:COLOUR 14,240,240,176: REM dice colours
  400DIM board 24, initboard 24, bestboard 24,whiteblots 24,blackblots 24,white_cover 24,black_cover 24
  410boardsize = 1024: bordersize = 48: barwidth = 72: pointwidth = (boardsize-2*bordersize-barwidth)/12: pointheight = 380: ytop = boardsize-bordersize-2: ybottom = bordersize+6: piecesize = 60
  420DIM whitethrowbox(4),blackthrowbox(4),gamebox(4),dice(2),showdice(4),barbox(4)
  430barbox(1)=(boardsize-barwidth)/2:barbox(2)=0:barbox(3)=barbox(1)+barwidth:barbox(4)=barbox(4)+boardsize
  440blackthrowbox(1)=bordersize+16:blackthrowbox(2)=bordersize+pointheight+16:blackthrowbox(3)=(boardsize-barwidth)/2-16:blackthrowbox(4)=boardsize-bordersize-pointheight-16
  450whitethrowbox(1)=(boardsize+barwidth)/2+4:whitethrowbox(2)=blackthrowbox(2):whitethrowbox(3)=boardsize-bordersize-4:whitethrowbox(4)=blackthrowbox(4)
  460gamebox(1)=0:gamebox(2)=0:gamebox(3)=boardsize:gamebox(4)=boardsize
  470evaldisplay$="ON":double=FALSE:firstpair=FALSE
  480DIM legalmoves(5,50):nlegal=0
  490DIM opttext$(5),pointbox(4),surebox(4)
  500surebox(1)=1240/3-32:surebox(2)=1024/3
  510surebox(3)=2*surebox(1):surebox(4)=2*surebox(2)
  520FOR i = 1 TO 5:READ opttext$(i):NEXT i
  530DATA "WHITE","BLACK","MONEY","VALUE","QUIT"
  540DIM optbox(4),cantbox(4): optbox(1)=1240/4:optbox(2)=1024/4:optbox(3)=optbox(1)+1024/2:optbox(4)=optbox(2)+1024/2
  550cantbox()=optbox():cantbox(2)+=80:cantbox(4)-=80
  560DIM  bestmoves(40),newboard 24
  570PROCinitpieces
  580PROCinitpanels
  590PROCinit_weightings
  600PROCinit_opening_moves
  610PROCinit_sprites
  620VOICES 2
  630*CHANNELVOICE 1 1
  640*CHANNELVOICE 2 6
  650*<Backg$Dir>.HAND3
  660MOUSE ON 1
  670ENDPROC
  680
  690DEFPROCinit_sprites
  700spritesize% = 100*1024
  710DIM spritearea spritesize%
  720!spritearea = spritesize%
  730spritearea!4=0
  740spritearea!8=16
  750spritearea!16=16
  760SYS "OS_SpriteOp",256+10,spritearea,"<Backg$Dir>.sprites"
  770ENDPROC
  780
  790DEFPROCinitgame
  800whiteturn=TRUE:gameinprogress=FALSE: whitegamescore=0:blackgamescore=0
  810barblack=0:barwhite = 0:dicerolled=FALSE
  820PROCinitpanelactivity
  830doublecube = 64:doubleturn$ = "either":doubled=FALSE
  840blackpieces=15:whitepieces=15:winner$=""
  850blackopening=TRUE: whiteopening=TRUE: current_score=0
  860allpast=FALSE: allpast_weight=FALSE: double_refused = FALSE
  870display_bank=2:update_bank=2:*SHADOW
  880whitebearing=FALSE:blackbearing=FALSE
  890ENDPROC
  900
  910DEFPROCinitpanels
  920LOCAL panno
  930REM initialise panels in right hand strip
  940DIM paneltext$(4),panel(4),panels(4,4),panelactive(5),movepanel(4),dicepanel(4),optpanel(4),quitpanel(4),okpanel(4),panelbox(4)
  950optpanel(1)=optbox(1)+200:optpanel(2)=optbox(4)-112:optpanel(3)=optpanel(1)+240:optpanel(4)=optpanel(2)+50
  960quitpanel(1)=optbox(1)+60:quitpanel(2)=optbox(2)+50:quitpanel(3)=quitpanel(1)+300:quitpanel(4)=quitpanel(2)+80
  970okpanel(1)=quitpanel(1)+320:okpanel(2)=quitpanel(2):okpanel(3)=okpanel(1)+80:okpanel(4)=quitpanel(4)
  980paneltext$(1)="ROLL DICE": paneltext$(2)="OFFER DOUBLE": paneltext$(3) = "SET OPTIONS": paneltext$(4) = "START GAME"
  990panel(1) = boardsize+16:panel(3)=panel(1)+200:panel(2) =320:panel(4)=400
 1000dicepanel()=panel():dicepanel(2)+=100:dicepanel(4)+=100
 1010movepanel(1)=panel(1):movepanel(3)=panel(3):movepanel(2)=730:movepanel(4)=780
 1020FOR panno = 1 TO 4
 1030panels(1,panno) = panel(1)
 1040panels(2,panno) = panel(2)-100*(panno-1)
 1050panels(3,panno) = panel(3)
 1060panels(4,panno) = panel(4)-100*(panno-1)
 1070NEXT panno
 1080panelbox(1)=panels(1,4):panelbox(2)=panels(2,4):panelbox(3)=panels(3,1):panelbox(4)=panels(4,1)
 1090ENDPROC
 1100
 1110
 1120DEFPROCinitpanelactivity
 1130REM sets up initial state of panel activity
 1140panelactive(1)=FALSE: panelactive(2) = FALSE: panelactive(3) = TRUE: panelactive(4) = TRUE
 1150ENDPROC
 1160
 1170
 1180DEFPROCboard
 1190REM draws board at start of new game
 1200COLOUR 128+black:CLS
 1210LOCAL i
 1220FOR i = 1 TO 24: board?i = initboard?i:NEXT i
 1230REM FOR i = 1 TO 24: board?i = testboard?i:NEXT i:blackpieces=11:whitepieces=9:blackopening=FALSE:whiteopening=FALSE
 1240GCOL midgrey: RECTANGLE FILL boardsize+8,0,1240-boardsize,boardsize
 1250GCOL brown: RECTANGLE FILL 0,0,boardsize,boardsize
 1260GCOL green: RECTANGLE FILL bordersize,bordersize,boardsize-2*bordersize, boardsize-2*bordersize
 1270GCOL black: RECTANGLE  bordersize,bordersize,boardsize-2*bordersize, boardsize-2*bordersize
 1280MOVE bordersize,bordersize:DRAW 0,0
 1290MOVE bordersize,boardsize-bordersize:DRAW 0,boardsize
 1300MOVE boardsize-bordersize,bordersize:DRAW boardsize,0
 1310MOVE boardsize-bordersize,boardsize-bordersize: DRAW boardsize,boardsize
 1320PROCdrawpoints
 1330PROCdrawbar
 1340ENDPROC
 1350
 1360
 1370DEFPROCdraw_inner_rects
 1380REM black outline rectangles to replace possible obscuring
 1390REM by redrawing of points
 1400LOCAL width,height,barright
 1410GCOL black
 1420width = (boardsize-barwidth)/2 - bordersize
 1430barright = width+bordersize+barwidth
 1440height=boardsize-2*bordersize
 1450WAIT
 1460RECTANGLE bordersize,bordersize,width,height
 1470WAIT
 1480RECTANGLE barright,bordersize,width,height
 1490ENDPROC
 1500
 1510DEFPROCshadow_drawbar
 1520PROCswitch_display_bank
 1530PROCdrawbar
 1540PROCswitch_display_bank
 1550PROCshadow_box(barbox())
 1560ENDPROC
 1570
 1580DEFPROCdrawbar
 1590LOCAL barleft,x,y,xoff,yoff
 1600barleft = (boardsize-barwidth)/2
 1610GCOL brown: RECTANGLE FILL barleft,0,barwidth,boardsize
 1620GCOL black:RECTANGLE (boardsize-barwidth)/2,bordersize,barwidth,boardsize-2*bordersize
 1630IF barblack>0 THEN PROCpiecesonbar(barblack,"black")
 1640IF barwhite>0 THEN PROCpiecesonbar(barwhite,"white")
 1650REM draw doubleing cube
 1660x = barleft+10: y = boardsize/2-20
 1670GCOL ivory
 1680RECTANGLE FILL x,y,54,54
 1690GCOL black
 1700RECTANGLE x,y,54,54
 1710yoff = 36: IF doublecube > 9 THEN xoff = 10 ELSE xoff = 20
 1720VDU 5: GCOL blue
 1730MOVE x+xoff,y+yoff:PRINT; doublecube
 1740VDU 4
 1750REM IF gameinprogress THEN PROCshadow_box(barbox())
 1760ENDPROC
 1770
 1780DEFPROCpiecesonbar(nopieces,col$)
 1790LOCAL piece,x,y
 1800CASE col$ OF
 1810WHEN "black":
 1820PROCstartpoint(18,x,y)
 1830x+=pointwidth+barwidth/2-piecesize/2
 1840WHEN "white":
 1850PROCstartpoint(7,x,y)
 1860x+=pointwidth+barwidth/2-piecesize/2
 1870ENDCASE
 1880FOR piece = 1 TO nopieces
 1890offset = (piece-0.50)*piecesize
 1900CASE col$ OF
 1910WHEN "black"
 1920y = ybottom +offset-piecesize/2
 1930MOVE x,y:PROCplot_sprite(col$,8)
 1940WHEN "white"
 1950y = ytop -offset-piecesize/2
 1960MOVEx,y:PROCplot_sprite(col$,8)
 1970ENDCASE
 1980NEXT piece
 1990ENDPROC
 2000
 2010DEFPROCdrawpoints
 2020LOCAL point,pointcolour,startpoint
 2030FOR point = 1 TO 24
 2040PROCdrawpoint(point)
 2050NEXT point
 2060ENDPROC
 2070
 2080DEFPROCshadow_drawpoint(point,mfb)
 2090LOCAL screen
 2100IF mfb THEN PROCshadow_drawbar
 2110PROCswitch_update_bank
 2120PROCdrawpoint(point)
 2130PROCswitch_display_bank
 2140PROCgrabbox(pointbox(),"temp")
 2150PROCswitch_update_bank
 2160PROCrestorebox(pointbox(),"temp")
 2170PROCswitch_update_bank
 2180ENDPROC
 2190
 2200DEFPROCdrawpoint(point)
 2210LOCAL piece,pieces,piececol,offset,s$,r,screen
 2220REM Draw point
 2230IF point <13 THEN offset = -pointheight ELSE offset = pointheight
 2240PROCstartpoint(point,x,y):GCOLgreen: RECTANGLE FILL x,y,pointwidth,offset
 2250IF point > 12 THEN
 2260pointbox(1)=x:pointbox(2)=y:pointbox(3)=x+pointwidth:pointbox(4)=y+offset
 2270ELSE
 2280pointbox(1)=x:pointbox(2)=y+offset:pointbox(3)=x+pointwidth:pointbox(4)=y
 2290ENDIF
 2300IF point MOD 2 = 1 THEN pointcolour = lightgrey ELSE pointcolour = red
 2310GCOL pointcolour
 2320MOVE x,y: MOVE x+pointwidth,y
 2330IF point < 13 THEN PLOT 81,-pointwidth/2,-pointheight ELSE PLOT 81,-pointwidth/2,pointheight
 2340REM Draw pieces on point
 2350pieces = board?point
 2360IF pieces >0 THEN
 2370IF pieces >128 THEN piececol = black: pieces = pieces MOD 128 ELSE piececol=white
 2380r=piecesize/2
 2390x+= pointwidth/2-r: piece=0
 2400IF piececol = white THEN s$="white" ELSE s$="black"
 2410REPEAT: piece+=1
 2420offset = (piece-0.50)*piecesize
 2430IF point < 13 THEN y = ytop - offset-r ELSE y = ybottom + offset-r
 2440REM GCOL piececol: CIRCLE FILL x,y,piecesize/2
 2450REM IF piececol = white THEN GCOL black: CIRCLE  x,y,piecesize/2
 2460MOVE x,y: PROCplot_sprite(s$,8)
 2470UNTIL piece = pieces OR piece = 6
 2480IF pieces >6 THEN PROCnumberpile(pieces,x+r,y+r,piececol)
 2490ENDIF
 2500REM GCOL black: RECTANGLE  bordersize,bordersize,boardsize-2*bordersize, boardsize-2*bordersize
 2510PROCdraw_inner_rects
 2520ENDPROC
 2530
 2540DEFPROCstartpoint(point,RETURN x,RETURN y)
 2550REM finds top left hand co-ordinates of point
 2560IF point <13 THEN y = ytop ELSE y = ybottom: point = 25-point
 2570x = boardsize-bordersize-point*pointwidth
 2580IF point > 6 THEN x-= barwidth
 2590ENDPROC
 2600
 2610DEFPROCinitpieces
 2620LOCAL point,pieces
 2630DIM testboard 24
 2640FOR point = 1 TO 24
 2650READ pieces: initboard?point = pieces
 2660NEXT point
 2670DATA 2,0,0,0,0,128+5,0,128+3,0,0,0,5,128+5,0,0,0,3,0,5,0,0,0,0,128+2
 2680FOR point = 1 TO 24
 2690READ pieces: testboard?point = pieces
 2700NEXT point
 2710DATA 128+3,3,0,0,0,128+2,0,128+3,0,0,0,0,0,0,0,0,0,0,0,2,0,128+3,0,4
 2720barwhite=0:barblack=0
 2730ENDPROC
 2740
 2750DEFPROCnumberpile(no,x,y,piececol)
 2760LOCAL nocol,xoff,yoff
 2770yoff = 12: IF no > 9 THEN xoff = -16 ELSE xoff = -8
 2780IF piececol = black THEN nocol = white ELSE nocol = black
 2790VDU 5: GCOL nocol
 2800MOVE x+xoff,y+yoff:PRINT; no
 2810VDU 4
 2820ENDPROC
 2830
 2840REM Mouse and sprite library procedures
 2850REM ===================================
 2860
 2870DEFPROCdrawtextbox(box(),text$,boxcol%,textcol%)
 2880REM Draws unfilled box colour boxcol%
 2890REM and centres text label printed in colour textcol%
 2900LOCAL boxwidth%,boxheight%,textwidth%, textx, texty
 2910VDU5: GCOL boxcol%
 2920RECTANGLE FILL box(1),box(2),box(3)-box(1),box(4)-box(2)
 2930GCOL black:RECTANGLE box(1),box(2),box(3)-box(1),box(4)-box(2)
 2940textwidth%=LEN(text$)*1280 DIV 80
 2950boxwidth% = box(3)-box(1)
 2960boxheight% = box(4) - box(2)
 2970textx = box(1)+(boxwidth%-textwidth%) DIV 2
 2980texty = box(2)+(boxheight%-16) DIV 2 + 16
 2990GCOL textcol%
 3000MOVE textx,texty
 3010PRINT text$
 3020VDU4
 3030ENDPROC
 3040
 3050DEFFNmouseinbox(box(),RETURN button)
 3060REM Returns TRUE if mouse clicked inside box, otherwise FALSE
 3070REM Also returns variable holding value of button
 3080LOCAL x,y,t
 3090*FX15
 3100MOUSE x,y,button
 3110IF button THEN
 3120PROCdelay(1)
 3130REM delay to give user time to release button
 3140IF x>= box(1) AND x <= box(3) AND y >= box(2) AND y <= box(4) THEN = TRUE ELSE =FALSE
 3150ELSE
 3160=FALSE
 3170ENDIF
 3180
 3190DEFPROCplot_sprite(sprite$,action)
 3200REM Plots sprite using mask
 3210SYS "OS_SpriteOp",256+28,spritearea,sprite$,,,action
 3220ENDPROC
 3230
 3240DEFPROCget_sprite(sprite$,box())
 3250MOVE box(1),box(2):MOVE box(3),box(4)
 3260SYS "OS_SpriteOp",256+14,spritearea,sprite$
 3270ENDPROC
 3280
 3290DEFPROCgrabbox(box(),sprite$)
 3300REM grabs the screen area defined by box and
 3310REM saves it as a sprite called sprite$
 3320PROCget_sprite(sprite$,box())
 3330ENDPROC
 3340
 3350DEFPROCrestorebox(box(),sprite$)
 3360REM restores screen area defined by box and previously
 3370REM saved by PROCgrabbox
 3380MOVE box(1),box(2)
 3390PROCplot_sprite(sprite$,0)
 3400PROCdelay(20):*FX15
 3410ENDPROC
 3420
 3430DEFPROCgraphicwindow(box())
 3440REM creates graphic window of the area specified by box()
 3450VDU24,box(1);box(2);box(3);box(4);
 3460ENDPROC
 3470
 3480REM End of mouse/sprite library procedures
 3490REM ======================================
 3500
 3510DEFPROCdice
 3520IF startset THEN startset = FALSE:ENDPROC
 3530IF whiteturn THEN PROCrolldice(whitethrowbox()) ELSE PROCrolldice(blackthrowbox())
 3540ENDPROC
 3550
 3560DEFPROCrolldice(throwbox())
 3570LOCAL x1,y1,x2,y2,toss,ntosses,a,d,p,count
 3580PROCdrawtextbox(dicepanel(),"",ivory,ivory)
 3590ntosses=12:count =0
 3600REM REPEAT
 3610FOR toss = 1 TO ntosses
 3620dice1=RND(6):dice2=RND(6)
 3621
 3630REM This is the cheating bit
 3631REM ==== == === ======== ===
 3640REM IF col$="white" THEN dice2=dice1
 3641
 3650x1 = throwbox(1)+20+RND(180)
 3660y1 = throwbox(2)+20+RND(60)
 3670x2 = x1+60+RND(60)
 3680y2 = throwbox(2)+20+RND(60)
 3690MOVE x1,y1
 3700PROCplot_sprite(STR$dice1,0)
 3710MOVE x2,y2
 3720PROCplot_sprite(STR$dice2,0)
 3730count+=1
 3740IF count=2 THEN
 3750count=0
 3760a=1:p=120+RND(30):d=5+RND(5)
 3770SOUND 2,-a,p,d: PROCdelay(5)
 3780ENDIF
 3790IF toss < ntosses THEN PROCclearthrowbox(throwbox())
 3800NEXT toss
 3810PROCswitch_update_bank
 3820MOVE x1,y1: PROCplot_sprite(STR$dice1,0)
 3830MOVE x2,y2: PROCplot_sprite(STR$dice2,0)
 3840PROCswitch_update_bank
 3850REM UNTIL dice1=dice2
 3860PROCsetdice(dice1,dice2)
 3870ENDPROC
 3880
 3890DEFPROCsetdice(dice1,dice2)
 3900IF dice1 <dice2 THEN SWAP dice1,dice2
 3910IF dice1 = dice2 THEN double=TRUE ELSE double=FALSE
 3920dice(1)=dice1:dice(2)=dice2:dice(0)=2
 3930diceavailable = 2
 3940REM IF double THEN dice(3)=dice1:dice(4)=dice1
 3950ENDPROC
 3960
 3970DEFPROCrollstartdice(col$,dice1,RETURN dice)
 3980LOCAL throwbox():DIM throwbox(4)
 3990IF col$="white" THEN throwbox()=whitethrowbox() ELSE throwbox()=blackthrowbox()
 4000ntosses=8:count =0
 4010FOR toss = 1 TO ntosses
 4020dice=RND(6)
 4030IF (col$="black" AND dice=dice1 AND toss=ntosses) THEN
 4040REPEAT:dice=RND(6):UNTIL dice<>dice1
 4050ENDIF
 4060x1 = throwbox(1)+20+RND(200)
 4070y1 = throwbox(2)+20+RND(60)
 4080x2 = x1+60+RND(80)
 4090y2 = throwbox(2)+20+RND(60)
 4100MOVE x1,y1
 4110PROCplot_sprite(STR$dice,0)
 4120count+=1
 4130IF count=2 THEN
 4140count=0
 4150a=1:p=120+RND(30):d=5+RND(5)
 4160SOUND 2,-a,p,d: PROCdelay(5)
 4170ENDIF
 4180IF toss < ntosses THEN PROCclearthrowbox(throwbox())
 4190IF toss=ntosses THEN
 4200PROCswitch_update_bank
 4210MOVE x1,y1:PROCplot_sprite(STR$dice,0)
 4220PROCswitch_update_bank
 4230ENDIF
 4240NEXT toss
 4250ENDPROC
 4260
 4270DEFPROCdelay(t)
 4280TIME=0:REPEAT UNTIL TIME > t
 4290ENDPROC
 4300
 4310DEFPROCclearthrowbox(throwbox())
 4320GCOL green: RECTANGLE FILL throwbox(1),throwbox(2),throwbox(3)-throwbox(1),throwbox(4)-throwbox(2)
 4330ENDPROC
 4340
 4350DEFPROCshadow_panel
 4360LOCAL screen
 4370FOR screen = 1 TO 2
 4380PROCswitch_update_bank
 4390PROCpanel
 4400PROCswitch_display_bank
 4410NEXT screen
 4420ENDPROC
 4430
 4440DEFPROCpanel
 4450GCOL midgrey
 4460RECTANGLE FILL boardsize+8,0,1240-boardsize,boardsize
 4470COLOUR 128+midgrey
 4480COLOUR white
 4490PRINT TAB(66,1);"W H I T E"
 4500PRINT TAB(66,3) FNcentre(whiteplayer$)
 4510PRINT TAB(69,4);"�";whitemoney
 4520PRINT TAB(66,5);"Game score "
 4530PRINT TAB(70,6);whitegamescore
 4540COLOUR black
 4550PRINT TAB(66,10)"B L A C K"
 4560PRINT TAB(66,12) FNcentre(blackplayer$)
 4570PRINT TAB(69,13) "�";blackmoney
 4580PRINT TAB(66,14);"Game score "
 4590PRINT TAB(70,15);blackgamescore
 4600PROCmovepanel
 4610PROCdrawpanels
 4620PROCdicepanel
 4630ENDPROC
 4640
 4650DEFFNcentre(S$)
 4660LOCAL L%
 4670L%=LENS$
 4680IF L% <10 THEN S$=STRING$((10-L%)DIV2," ")+S$
 4690=S$
 4700
 4710DEFPROCdicepanel
 4720LOCAL dice,roll,xoff,i,n,s
 4730IF double THEN
 4740xoff = 8:n=4
 4750IF firstpair THEN
 4760showdice(1)=dice(1):showdice(2)=dice(2)
 4770showdice(3)=dice(1) MOD 128: showdice(4)=dice(2) MOD 128
 4780ELSE
 4790showdice(1)=dice(1)+128:showdice(2)=dice(2)+128
 4800showdice(3)=dice(1):showdice(4)=dice(2)
 4810ENDIF
 4820ELSE
 4830showdice(1)=dice(1):showdice(2)=dice(2)
 4840xoff = 40:n=2
 4850ENDIF
 4860VDU 5
 4870IF dicerolled THEN
 4880FOR dice = 1 TO n
 4890roll = showdice(dice)
 4900IF roll > 128 THEN GCOL lightgrey ELSE GCOL black
 4910MOVE dicepanel(1)+xoff+30*dice,dicepanel(2)+48
 4920PRINT; roll MOD 128
 4930NEXT dice
 4940ELSE
 4950PROCdrawtextbox(dicepanel(),"",ivory,ivory)
 4960ENDIF
 4970VDU4
 4980IF gameinprogress PROCshadow_box(dicepanel())
 4990ENDPROC
 5000
 5010DEFPROCmovepanel
 5020LOCAL text$
 5030IF gameinprogress THEN
 5040IF whiteturn THEN text$="White Move" ELSE text$="Black Move"
 5050ELSE
 5060text$="New Game"
 5070ENDIF
 5080PROCdrawtextbox(movepanel(),text$,ivory,blue)
 5090IF gameinprogress THEN PROCshadow_box(movepanel())
 5100ENDPROC
 5110
 5120DEFPROCdrawpanels
 5130LOCAL panno,textcol,s
 5140IF gameinprogress THEN paneltext$(4)="QUIT GAME" ELSE paneltext$(4)="START GAME"
 5150FOR panno = 1 TO 4
 5160IF panelactive(panno) THEN textcol = red ELSE textcol = lightgrey
 5170PROCpanelcoords(panno,panel())
 5180PROCdrawtextbox(panel(),paneltext$(panno),white,textcol)
 5190NEXT panno
 5200IF gameinprogress THEN PROCshadow_box(panelbox())
 5210ENDPROC
 5220
 5230DEFPROCdraw_double_panel
 5240LOCAL s,d:d=2
 5250FOR s = 1 TO 2
 5260PROCswitch_update_bank
 5270PROCpanelcoords(d,panel())
 5280PROCdrawtextbox(panel(),paneltext$(d),white,lightgrey)
 5290PROCswitch_display_bank
 5300NEXT s
 5310ENDPROC
 5320
 5330DEFPROCpanelcoords(panno,panel())
 5340LOCAL i
 5350FOR i = 1 TO 4
 5360panel(i) = panels(i,panno)
 5370NEXT i
 5380ENDPROC
 5390
 5400DEFPROCstartgame
 5410LOCAL panno,x,y,button
 5420REPEAT
 5430panno = FNgetpanel
 5440IF panno = 3 THEN PROCsetoptions
 5450UNTIL panno = 4
 5460PROCchoosestart
 5470IF whiteplayer$="HUMAN" THEN whiteopening=FALSE
 5480IF blackplayer$="HUMAN" THEN blackopening=FALSE
 5490gameinprogress=TRUE
 5500ENDPROC
 5510
 5520DEFPROCchoosestart
 5530LOCAL dicew,diceb,message$,box()
 5540DIM box(4):box()=cantbox():box(2)-=270:box(4)-=270:box(1)-=60:box(3)-=60
 5550PROCrollstartdice("white",0,dice1)
 5560PROCrollstartdice("black",dice1,dice2)
 5570whiteturn = (dice1>dice2)
 5580IF whiteturn THEN message$="WHITE STARTS" ELSE message$="BLACK STARTS"
 5590PROCgrabbox(box(),"temp")
 5600PROCdisplaybox(box(),message$)
 5610PROCrestorebox(box(),"temp")
 5620PROCsetdice(dice1,dice2):startset=TRUE
 5630ENDPROC
 5640
 5650DEFFNgetpanel
 5660REM checks mouse presses in panel and returns number
 5670REM if active panel clicked else 0
 5680LOCAL panno, button,x,y, found,last: panno = 0: found = FALSE
 5690IF gameinprogress THEN last=5 ELSE last=4
 5700REPEAT
 5710panno +=1
 5720IF panno=5 THEN
 5730panel()=gamebox()
 5740ELSE
 5750PROCpanelcoords(panno,panel())
 5760ENDIF
 5770IF FNmouseinbox(panel(),button) THEN
 5780IF panelactive(panno) OR panno=5 THEN found = TRUE ELSE VDU7
 5790ENDIF
 5800UNTIL found OR panno = last
 5810IF panno=5 THEN panno=1
 5820IF found THEN = panno ELSE = 0
 5830
 5840DEFPROCsetoptions
 5850LOCAL moneyreset,ok
 5860moneyreset=FALSE
 5870PROCgrabbox(optbox(),"temp")
 5880PROCoptionsbox
 5890ok=FALSE
 5900REPEAT
 5910panel()=optpanel()
 5920button=0
 5930FOR i = 1 TO 4
 5940IF i>1 THEN panel(2)-=76:panel(4)-=76
 5950IF FNmouseinbox(panel(),button)THEN
 5960CASE i OF
 5970WHEN 1: IF whiteplayer$="COMPUTER" THEN whiteplayer$="HUMAN" ELSE whiteplayer$="COMPUTER"
 5980PROCdrawtextbox(panel(),whiteplayer$,white,red)
 5990WHEN 2: IF blackplayer$="COMPUTER" THEN blackplayer$="HUMAN" ELSE blackplayer$="COMPUTER"
 6000PROCdrawtextbox(panel(),blackplayer$,white,red)
 6010WHEN 3: blackmoney=100:whitemoney=100
 6020IF moneyreset THEN moneyreset=FALSE:PROCdrawtextbox(panel(),"RESET",white,red) ELSE moneyreset=TRUE:PROCdrawtextbox(panel(),"RESET",white,lightgrey)
 6030WHEN 4: IF evaldisplay$="ON" THEN evaldisplay$="OFF" ELSE evaldisplay$="ON"
 6040PROCdrawtextbox(panel(),evaldisplay$,white,red)
 6050ENDCASE
 6060ENDIF
 6070MOUSE RECTANGLE optbox(1),optbox(2),optbox(3)-optbox(1),optbox(4)-optbox(2)
 6080NEXT i
 6090IF FNmouseinbox(quitpanel(),button) THEN sure=FNsurebox(""):IF sure THEN MODE12:OSCLI("FX 200,0"):END
 6100IF FNmouseinbox(okpanel(),button) THEN ok=TRUE
 6110UNTIL ok
 6120button=0:*FX15
 6130REPEAT
 6140MOUSE x,y,button
 6150UNTIL button
 6160MOUSE RECTANGLE 0,0,1239,1203
 6170VDU4
 6180PROCrestorebox(optbox(),"temp")
 6190PROCshadow_panel
 6200ENDPROC
 6210
 6220DEFPROCoptionsbox
 6230LOCAL i,x,y,border:border=32
 6240VDU5
 6250PROCshowbox(optbox(),black,ivory)
 6260x=optbox(1)+2*border
 6270GCOL black
 6280FOR i = 1 TO 4
 6290y=optbox(4)-i*76
 6300MOVE x,y:PRINT opttext$(i)
 6310NEXT i
 6320PROCdrawtextbox(quitpanel(),"QUIT PROGRAM",white,blue)
 6330PROCdrawtextbox(okpanel(),"OK",lightgrey,black)
 6340panel()=optpanel()
 6350FOR i = 1 TO 4
 6360IF i>1 THEN panel(2)-=76:panel(4)-=76
 6370CASE i OF
 6380WHEN 1: text$=whiteplayer$
 6390WHEN 2: text$=blackplayer$
 6400WHEN 3: text$="RESET"
 6410WHEN 4: text$=evaldisplay$
 6420ENDCASE
 6430PROCdrawtextbox(panel(),text$,white,red)
 6440NEXT i
 6450ENDPROC
 6460
 6470
 6480DEFPROCplay
 6490LOCAL x,y,button,screen
 6500*FX200,0
 6510LOCAL ERROR
 6520ON ERROR LOCAL gameinprogress=FALSE:MOUSE ON:MOUSE RECTANGLE 0,0,1239,1023:VDU4,26:OSCLI("FX 200,1"):ENDPROC
 6530IF whiteplayer$="COMPUTER" AND blackplayer$="COMPUTER" THEN MOUSE OFF
 6540WHILE gameinprogress
 6550IF whiteturn THEN
 6560IF whiteplayer$ = "HUMAN" THEN PROChumanplay("white") ELSE PROCcomputerplay("white")
 6570whiteturn = FALSE
 6580ELSE
 6590IF blackplayer$ = "HUMAN" THEN PROChumanplay("black") ELSE PROCcomputerplay("black")
 6600whiteturn = TRUE
 6610ENDIF
 6620FOR screen = 1 TO 2
 6630PROCclearthrowbox(whitethrowbox()):PROCclearthrowbox(blackthrowbox())
 6640PROCswitch_update_bank
 6650NEXT screen
 6660PROCshowscore
 6670IF gameinprogress AND NOT (whiteplayer$="COMPUTER" AND blackplayer$="COMPUTER") THEN
 6680REM IF (whiteturn AND whiteplayer$="COMPUTER") OR (NOT whiteturn AND blackplayer$="COMPUTER") THEN
 6690REM button=0:*FX15
 6700REM REPEAT:MOUSE x,y,button:UNTIL button
 6710REM ENDIF
 6720ENDIF
 6730IF allpast AND NOT allpast_weight THEN PROCallpast_weightings: allpast_weight = TRUE
 6740ENDWHILE
 6750MOUSE ON
 6760*FX200,0
 6770ENDPROC
 6780
 6790DEFFNallpast
 6800REM returns TRUE when pieces of each colour are past each other
 6810REM and no hitting is possible
 6820LOCAL point,present,allpast,found,maxblack,minwhite
 6830IF barwhite OR barblack THEN =FALSE
 6840point=0:found=FALSE
 6850WHILE NOT found
 6860point+=1
 6870IF board?point < 128 AND board?point>0 THEN minwhite=point:found=TRUE
 6880ENDWHILE
 6890point=25:found=FALSE
 6900WHILE NOT found
 6910point-=1
 6920IF board?point > 128 THEN maxblack=point:found=TRUE
 6930ENDWHILE
 6940allpast=(minwhite>maxblack)
 6950=allpast
 6960
 6970DEFPROCshowscore
 6980LOCAL text$,x,y,button,screen
 6990IF evaldisplay$="ON" THEN
 7000IF whiteturn THEN col$="black" ELSE col$="white"
 7010current_score=FNevaluateboard(col$,board,whitepieces,blackpieces,barwhite,barblack,winner$)
 7020text$=col$+" "+STR$current_score
 7030FOR screen = 1 TO 2
 7040PROCdrawtextbox(dicepanel(),text$,ivory,black)
 7050PROCswitch_update_bank
 7060NEXT screen
 7070ENDIF
 7080ENDIF
 7090ENDPROC
 7100
 7110
 7120DEFPROCcomputerplay(col$)
 7130LOCAL move,moveover,p,s
 7140CASE col$ OF
 7150WHEN "white":whitebearing=FALSE
 7160WHEN "black":blackbearing=FALSE
 7170ENDCASE
 7180REM SYS "Hourglass_On"
 7190FOR p = 1 TO 4
 7200panelactive(p)=FALSE
 7210NEXT p
 7220PROCmovepanel:PROCdrawpanels
 7230moveover=FALSE
 7240PROCcomputer_offer(col$): IF NOT gameinprogress THEN ENDPROC
 7250MOUSE OFF
 7260PROCdice: dicerolled=TRUE:firstpair=TRUE:PROCdicepanel
 7270IF FNopening_move(col$) THEN PROCfind_opening_moves(col$)
 7280IF double THEN firstpair=TRUE:diceavailable=2
 7290REPEAT
 7300IF FNlegalmoveavailable(col$) THEN
 7310IF NOT allpast THEN allpast = FNallpast
 7320move = FNchoosecomputermove(col$)
 7330startpoint = legalmoves(1,move)
 7340endpoint = legalmoves(2,move)
 7350diceused = legalmoves(3,move)
 7360barmove = legalmoves(4,move)
 7370bearing = legalmoves(5,move)
 7380dice(diceused) +=128
 7390diceavailable -= 1
 7400PROCcomputerdrag(col$,startpoint,endpoint,FALSE)
 7410PROCexecutemove(col$,startpoint,endpoint)
 7420PROCdicepanel
 7430ELSE
 7440MOUSE ON:PROCcantmove(col$,"")
 7450moveover=TRUE
 7460ENDIF
 7470IF diceavailable=0 THEN
 7480IF double THEN
 7490IF firstpair THEN
 7500diceavailable=2:firstpair=FALSE:dice(1)-=128:dice(2)-=128
 7510ELSE
 7520moveover=TRUE
 7530ENDIF
 7540ELSE
 7550moveover=TRUE
 7560ENDIF
 7570ENDIF
 7580UNTIL NOT gameinprogress OR moveover
 7590dicerolled=FALSE:PROCdicepanel
 7600IF FNopening_move(col$) THEN
 7610IF col$="white" THEN whiteopening=FALSE ELSE blackopening=FALSE
 7620ENDIF
 7630REM REPEAT UNTIL GET:REM **************************
 7640ENDPROC
 7650
 7660DEFFNopening_move(col$)
 7670CASE col$ OF
 7680WHEN "white": = whiteopening
 7690WHEN "black": = blackopening
 7700ENDCASE
 7710
 7720DEFPROChumanplay(col$)
 7730MOUSE ON
 7740LOCALx,y,button,startpoint,endpoint,legal,moveover,s
 7750CASE col$ OF
 7760WHEN "white":whitebearing=FALSE
 7770WHEN "black":blackbearing=FALSE
 7780ENDCASE
 7790REM SYS "Hourglass_On"
 7800moveover=FALSE
 7810LOCAL pressed, panno: pressed = FALSE: panno = 0
 7820panelactive(1) = TRUE
 7830IF doubleturn$ ="either" OR doubleturn$ = col$ THEN panelactive(2) = TRUE
 7840panelactive(3) = FALSE
 7850panelactive(4) = TRUE
 7860PROCmovepanel:PROCdrawpanels
 7870REM look for mouse presses in panel
 7880REM SYS "Hourglass_Off"
 7890IF NOT startset THEN
 7900REPEAT
 7910panno = FNgetpanel
 7920IF panno = 2 THEN PROCofferdouble(col$)
 7930IF panno = 4 THEN
 7940IF FNsurebox("") THEN gameinprogress=FALSE:gamecompleted=FALSE
 7950MOUSE RECTANGLE 0,0,1239,1023
 7960ENDIF
 7970UNTIL NOT gameinprogress OR panno = 1
 7980ENDIF
 7990IF NOT gameinprogress THEN ENDPROC
 8000panelactive(1)=FALSE:panelactive(2)=FALSE:panelactive(4)=FALSE:PROCdrawpanels
 8010REM game may be over due to refused offer so
 8020IF gameinprogress THEN
 8030PROCdice:dicerolled=TRUE:firstpair=TRUE:PROCdicepanel
 8040IF double THEN firstpair=TRUE:diceavailable=2
 8050REPEAT
 8060IF FNlegalmoveavailable(col$) THEN
 8070IF NOT allpast THEN allpast = FNallpast
 8080REPEAT
 8090startpoint=0:endpoint=0
 8100*FX15
 8110MOUSE x,y,button
 8120IF button THEN startpoint = FNpointxy(x,y)
 8130IF FNlegalstart(startpoint,col$) THEN
 8140endpoint =FNdrag(col$,x,y)
 8150legal= FNlegalmove(col$,startpoint,endpoint)
 8160ELSE
 8170legal=FALSE
 8180ENDIF
 8190UNTIL legal
 8200PROCexecutemove(col$,startpoint,endpoint)
 8210PROCdicepanel
 8220ELSE
 8230PROCcantmove(col$,"")
 8240moveover=TRUE
 8250ENDIF
 8260IF diceavailable=0 THEN
 8270IF double THEN
 8280IF firstpair THEN
 8290diceavailable=2:firstpair=FALSE:dice(1)-=128:dice(2)-=128
 8300ELSE
 8310moveover=TRUE
 8320ENDIF
 8330ELSE
 8340moveover=TRUE
 8350ENDIF
 8360ENDIF
 8370UNTIL NOT gameinprogress OR moveover
 8380ENDIF
 8390dicerolled=FALSE:PROCdicepanel
 8400ENDPROC
 8410
 8420DEFFNshowcol(col$)
 8430IF col$="white" THEN ="WHITE" ELSE ="BLACK"
 8440
 8450DEFPROCofferdouble(col$)
 8460LOCAL oppcol$,offset,tempbox():DIM tempbox(4)
 8470tempbox()=surebox():offset=60
 8480surebox(2)-=240:surebox(4)-=240:surebox(1)-=offset:surebox(3)-=offset
 8490IF col$="white" THEN oppcol$="black" ELSE oppcol$="white"
 8500IF FNsurebox("OFFER DOUBLE?") THEN
 8510IF FNcomputercol(oppcol$) THEN
 8520doubled=FNdouble_accepted(oppcol$)
 8530ELSE
 8540doubled = FNsurebox("ACCEPT DOUBLE?")
 8550ENDIF
 8560IF doubled THEN
 8570PROCaccept_double(oppcol$)
 8580ELSE
 8590double_refused=TRUE
 8600PROCwinner(col$)
 8610ENDIF
 8620ENDIF
 8630surebox()=tempbox()
 8640ENDPROC
 8650
 8660DEFPROCcomputer_offer(col$)
 8670MOUSE ON
 8680IF NOT (doubleturn$=col$ OR doubleturn$="either") THEN ENDPROC
 8690LOCAL oppcol$,offset,tempbox():DIM tempbox(4)
 8700tempbox()=surebox():offset=60
 8710surebox(2)-=240:surebox(4)-=240:surebox(1)-=offset:surebox(3)-=offset
 8720IF col$="white" THEN oppcol$="black" ELSE oppcol$="white"
 8730IF current_score < 8 - double_threshold THEN
 8740REM offer double
 8750IF FNcomputercol(oppcol$) THEN
 8760PROCcantmove(col$,"  "+FNshowcol(col$)+" DOUBLES")
 8770doubled = FNdouble_accepted(oppcol$)
 8780ELSE
 8790doubled = FNsurebox("ACCEPT DOUBLE?")
 8800ENDIF
 8810IF doubled THEN
 8820PROCaccept_double(oppcol$)
 8830ELSE
 8840double_refused=TRUE
 8850PROCwinner(col$)
 8860ENDIF
 8870ENDIF
 8880surebox()=tempbox()
 8890ENDPROC
 8900
 8910DEFFNcomputercol(col$)
 8920=(col$="white" AND whiteplayer$="COMPUTER") OR (col$="black" AND blackplayer$="COMPUTER")
 8930
 8940DEFFNdouble_accepted(col$)
 8950LOCAL threshold,ownpieces,opppieces
 8960IF col$="white" THEN ownpieces = whitepieces: opppieces = blackpieces ELSE ownpieces = blackpieces: opppieces = whitepieces
 8970threshold = -double_threshold -8
 8980IF allpast THEN threshold = -16
 8990IF opppieces < 10 THEN threshold = 0
 9000IF current_score < threshold THEN
 9010double_refused=TRUE
 9020PROCcantmove(col$,"  "+FNshowcol(col$)+" REFUSES")
 9030=FALSE
 9040ELSE
 9050=TRUE
 9060ENDIF
 9070
 9080DEFPROCaccept_double(col$)
 9090SYS "Hourglass_On"
 9100IF doublecube = 64 THEN doublecube = 2 ELSE doublecube = 2*doublecube
 9110IF doublecube = 64 THEN doubleturn$="neither" ELSE doubleturn$=col$
 9120panelactive(2)=FALSE:doubled=TRUE
 9130IF FNcomputercol(col$) THEN PROCcantmove(col$,"  "+FNshowcol(col$)+" ACCEPTS")
 9140PROCshadow_drawbar
 9150PROCdraw_double_panel
 9160SYS "Hourglass_Off"
 9170ENDPROC
 9180
 9190DEFFNlegalstart(point,col$)
 9200LOCAL legal,bar
 9210IF point = 0 THEN = FALSE
 9220REM check for pieces on bar
 9230IF FNpiecesonbar(col$) THEN
 9240IF point = 99 THEN =TRUE ELSE = FALSE
 9250ENDIF
 9260REM Otherwise point is "legal" if pieces of correct colour are present on it
 9270legal=FALSE
 9280CASE col$ OF
 9290WHEN "white": IF board?point >0 AND board?point<128 THEN legal=TRUE
 9300WHEN "black": IF board?point >128 THEN legal = TRUE
 9310ENDCASE
 9320=legal
 9330
 9340DEFFNpiecesonbar(col$)
 9350LOCAL bar:bar=FALSE
 9360CASE col$ OF
 9370WHEN "white":
 9380IF barwhite >0 THEN
 9390bar=TRUE
 9400ENDIF
 9410WHEN "black":
 9420IF barblack >0 THEN
 9430bar=TRUE
 9440ENDIF
 9450ENDCASE
 9460=bar
 9470
 9480
 9490DEFFNpointxy(x,y)
 9500REM returns point number corresponding to screen co-ordinates
 9510REM or 99 for click on bar or else 0
 9520LOCAL barleft,topboard,bottomboard,point,xp,yp,found
 9530barleft = (boardsize-barwidth)/2
 9540IF x > barleft AND x < barleft+barwidth THEN =99
 9550IF y > boardsize-bordersize-pointheight AND x < boardsize THEN topboard = TRUE ELSE topboard = FALSE
 9560IF y  < bordersize+pointheight AND x < boardsize THEN bottomboard = TRUE ELSE bottom = FALSE
 9570IF NOT (topboard OR bottomboard) THEN =0
 9580found = FALSE
 9590IF topboard THEN point = 0 ELSE point = 12
 9600WHILE NOT found AND point <24
 9610point+=1
 9620PROCstartpoint(point,xp,yp)
 9630IF x> xp AND x < xp+pointwidth THEN found = TRUE
 9640ENDWHILE
 9650IF (topboard AND point>12) OR (bottomboard AND point>24) THEN =0 ELSE = point
 9660
 9670DEFFNdrag(col$,startx,starty)
 9680REM allows player to drag circle from starting point
 9690REM returns point number of position where mouse is released
 9700LOCAL x,y,button,r:r=piecesize/2
 9710GCOL 3,1
 9720MOUSE x,y,button
 9730IF button THEN CIRCLE startx,starty,r
 9740WHILE button
 9750MOUSE ON 2
 9760*FX15
 9770MOUSE x,y,button
 9780CIRCLE startx,starty,r
 9790IF button THEN
 9800CIRCLE x,y,r
 9810startx=x:starty=y
 9820ENDIF
 9830ENDWHILE
 9840MOUSE ON 1
 9850IF startx>boardsize THEN =111 ELSE =FNpointxy(startx,starty)
 9860REM 111 code for bearing off move
 9870
 9880DEFPROCcomputerdrag(col$,startpoint,endpoint,hitmove)
 9890LOCAL startx,starty,endx,endy,npstart,npend,offset,xstep,ystep,x,y,steps,step,r,oldx1,oldy1,oldx2,oldy2,box(),oppcol$,sprite$,oldsprite1$,oldsprite2$,k,i
 9900VDU 24,0;0;1024;1023;
 9910k=20
 9920IF col$="white" THEN oppcol$="black" ELSE oppcol$="white"
 9930DIM box(4)
 9940REM PROCget_sprite("temp",gamebox())
 9950r=piecesize/2
 9960IF startpoint = 99 THEN
 9970IF col$="white" THEN npstart = barwhite ELSE npstart = barblack
 9980ELSE
 9990npstart = board?startpoint MOD 128
10000ENDIF
10010IF hitmove THEN
10020IF col$="white" THEN npend = barwhite ELSE npend = barblack
10030ELSE
10040npend = board?endpoint MOD 128
10050ENDIF
10060IF npstart>6 THEN npstart=6
10070IF npend <6 THEN npend +=1
10080IF npend>6 THEN npend=6
10090IF npend = 2 AND FNpointstate(endpoint) = ("one"+oppcol$) THEN npend=1
10100PROCfindpiecepoint(col$,npstart,startpoint,startx,starty)
10110PROCfindpiecepoint(col$,npend,endpoint,endx,endy)
10120steps = INT(36*FNdistance(startx,starty,endx,endy)/480)
10130xstep=(endx-startx)/steps
10140ystep=(endy-starty)/steps
10150IF NOT hitmove THEN
10160IF startpoint <99 THEN
10170board?startpoint=board?startpoint-1
10180IF board?startpoint=128 THEN board?startpoint=0
10190ELSE
10200CASE col$ OF
10210WHEN "white": barwhite -=1
10220WHEN "black": barblack -=1
10230ENDCASE
10240ENDIF
10250ENDIF
10260REM GCOL 3,1
10270REM CIRCLE startx,starty,r
10280startx-=r:starty-=r
10290*FX 112,1
10300*FX 113,1
10310update_bank=1:display_bank=1
10320IF startpoint = 99 THEN
10330PROCshadow_drawbar
10340ELSE
10350PROCshadow_drawpoint(startpoint,FALSE)
10360ENDIF
10370PROCgrabarea("temp1",startx,starty,k)
10380MOVE startx,starty
10390IF NOT hitmove THEN
10400PROCplot_sprite(col$,8)
10410FOR i = 1 TO 8:PROCswitch_display_bank:PROCdelay(10):NEXT i
10420ENDIF
10430oldx1=startx:oldy1=starty
10440PROCswitch_update_bank
10450PROCgrabarea("temp2",startx,starty,k)
10460MOVE startx,starty
10470IF NOT hitmove THEN PROCplot_sprite(col$,8)
10480oldx2=startx:oldy2=starty
10490PROCswitch_update_bank
10500oldsprite1$="temp1":oldsprite2$="temp2"
10510PROCswitch_display_bank
10520REM
10530FOR step = 1 TO steps + 1
10540IF update_bank=1 THEN
10550sprite$=oldsprite1$
10560MOVE oldx1-k,oldy1-k
10570ELSE
10580sprite$=oldsprite2$
10590MOVE oldx2-k,oldy2-k
10600ENDIF
10610PROCplot_sprite(sprite$,0)
10620IF step < steps + 1 THEN
10630startx+=xstep:starty+=ystep
10640ENDIF
10650IF update_bank = 1 THEN
10660oldx1=startx: oldy1 = starty
10670ELSE
10680oldx2=startx: oldy2 = starty
10690ENDIF
10700sprite$=FNupdate_sprite
10710PROCgrabarea(sprite$,startx,starty,k)
10720IF update_bank = 1 THEN oldsprite1$=sprite$ ELSE oldsprite2$=sprite$
10730MOVE startx,starty
10740PROCplot_sprite(col$,8)
10750PROCswitch_display_bank
10760PROCswitch_update_bank
10770REM PROCdelay(1)
10780NEXT step
10790PROCswitch_display_bank
10800REM
10810VDU 26
10820ENDPROC
10830
10840DEFFNdistance(x1,y1,x2,y2)
10850=SQR((x1-x2)^2+(y1-y2)^2)
10860
10870DEFPROCgrabarea(sprite$,x,y,k)
10880MOVE x-k,y-k:MOVE x+piecesize+k,starty+piecesize+k
10890SYS "OS_SpriteOp",256+14,spritearea,sprite$
10900ENDPROC
10910
10920
10930DEFFNupdate_sprite
10940="temp"+STR$update_bank
10950
10960DEFPROCfindpiecepoint(col$,piece,point,RETURN x,RETURN y)
10970LOCAL offset
10980IF point = 111 THEN
10990x = boardsize + 64
11000y = boardsize/2
11010ENDPROC
11020ENDIF
11030IF point = 99 THEN
11040offset = (piece-0.5)*piecesize
11050CASE col$ OF
11060WHEN "white":
11070PROCstartpoint(7,x,y)
11080y =ytop-offset
11090WHEN "black"
11100PROCstartpoint(18,x,y)
11110y = ybottom + offset
11120ENDCASE
11130x+=pointwidth+barwidth/2
11140ELSE
11150PROCstartpoint(point,x,y)
11160x+= pointwidth/2
11170offset = (piece-0.50)*piecesize
11180IF point < 13 THEN y = ytop-offset ELSE y =ybottom+offset
11190ENDIF
11200ENDPROC
11210
11220DEFFNlegalmoveavailable(col$)
11230REM Called at start of move to check that move can be made
11240REM also creates list of legal moves for use by computer version
11250LOCAL dice,roll,from,to,using,dest,code
11260nlegal=0: bearingpossible=FALSE
11270IF FNopening_move(col$) THEN IF FNset_opening_move(col$) THEN =TRUE
11280REM check barmove
11290IF FNpiecesonbar(col$) THEN barmove = TRUE ELSE barmove = FALSE
11300IF barmove THEN
11310FOR dice = 1 TO dice(0)
11320roll=dice(dice)
11330IF roll < 128 THEN
11340IF FNdestinationOK(99,roll,col$,dest) THEN PROCaddlegal(99,dest,dice)
11350ENDIF
11360NEXT dice
11370ELSE
11380FOR from = 1 TO 24
11390code = board?from
11400IF (col$="white" AND code>0 AND code<128) OR (col$="black" AND code>128) THEN
11410FOR dice = 1 TO dice(0)
11420roll=dice(dice)
11430IF roll < 128 THEN
11440IF FNdestinationOK(from,roll,col$,dest) THEN PROCaddlegal(from,dest,dice)
11450ENDIF
11460NEXT dice
11470ENDIF
11480NEXT from
11490ENDIF
11500REM PRINT TAB(0,0);nlegal
11510=nlegal
11520
11530DEFFNset_opening_move(col$)
11540REM returns TRUE if destination point clear of opposition
11550REM so that computer can usually make set moves if
11560REM the second to move
11570LOCAL ok,oppcol$,from,to
11580ok=TRUE
11590IF col$="white" THEN oppcol$="black" ELSE oppcol$="white"
11600bearing=FALSE:barmove=FALSE:movefrombar=FALSE
11610dice = dice(0)+1-diceavailable
11620IF diceavailable=2 THEN ok=FNproject_opening_move(col$,2,from,to)
11630IF NOT ok THEN =FNnotok(col$)
11640ok=FNproject_opening_move(col$,dice,from,to)
11650IF NOT ok THEN =FNnotok(col$)
11660PROCaddlegal(from,to,dice)
11670=TRUE
11680
11690DEFFNnotok(col$)
11700CASE col$ OF
11710WHEN "white":whiteopening=FALSE
11720WHEN "black":blackopening=FALSE
11730ENDCASE
11740nlegal=0
11750REM PRINT TAB(0,0);col$;" ";diceavailable,dice
11760=FALSE
11770
11780DEFFNproject_opening_move(col$,dice,RETURN from,RETURN to)
11790LOCAL ok,oppcol$,d
11800IF double AND NOT firstpair THEN d=dice+2 ELSE d=dice
11810from = openings(d)
11820IF col$="white" THEN to=from+dice(dice) ELSE to=from-dice(dice)
11830IF col$="white" THEN oppcol$="black" ELSE oppcol$="white"
11840IF FNpointpieces(oppcol$,to,board)=0 THEN ok=TRUE ELSE ok=FALSE
11850=ok
11860
11870DEFPROCcantmove(col$,message$)
11880VDU7
11890PROCgrabbox(cantbox(),"temp")
11900PROCcantbox(col$,message$)
11910PROCrestorebox(cantbox(),"temp")
11920dicerolled=FALSE:PROCdicepanel
11930ENDPROC
11940
11950
11960DEFPROCaddlegal(from,to,using)
11970nlegal+=1
11980legalmoves(1,nlegal) = from
11990IF bearing THEN bearingpossible=TRUE:legalmoves(2,nlegal) = 111 ELSE legalmoves(2,nlegal) = to
12000legalmoves(3,nlegal) = using
12010legalmoves(4,nlegal) = barmove
12020legalmoves(5,nlegal) = bearing
12030ENDPROC
12040
12050DEFFNdestinationOK(startpoint,roll,col$,RETURN dest)
12060LOCAL state$,diff,legal,d,dicefound
12070legal=FALSE
12080REM check for moving off bar
12090IF startpoint = 99 THEN
12100movefrombar=TRUE
12110CASE col$ OF
12120WHEN "white": startpoint=0
12130WHEN "black": startpoint=25
12140ENDCASE
12150ELSE
12160movefrombar=FALSE
12170ENDIF
12180REM check for destination on board
12190IF col$ ="white" THEN dest = startpoint+roll ELSE dest=startpoint-roll
12200IF dest <1 OR dest > 24 THEN
12210REM PRINT TAB(0,0);startpoint,dest
12220bearing = FNbearingcheck(startpoint,dest,col$)
12230IF bearing THEN = TRUE ELSE = FALSE
12240ELSE
12250bearing=FALSE
12260ENDIF
12270REM check for state of destination
12280state$ = FNpointstate(dest)
12290IF (state$="onewhite" AND col$="black") OR (state$="oneblack" AND col$="white") THEN
12300barmove=TRUE:=TRUE
12310ELSE
12320barmove=FALSE
12330ENDIF
12340IF state$ ="empty" OR state$=col$ OR RIGHT$(state$,5)=col$ THEN = TRUE
12350=FALSE
12360
12370DEFFNbearingcheck(start,dest,col$)
12380LOCAL possible,point,maxpoint,minpoint
12390IF (col$="white" AND dest<0) OR (col$="black" AND dest>24) THEN =FALSE
12400IF NOT FNbearingpossible(col$) THEN =FALSE
12410possible=FALSE
12420CASE col$ OF
12430WHEN "black":
12440IF dest=0 THEN
12450possible =TRUE: REM exact number
12460ELSE
12470maxpoint=0
12480FOR point=1 TO 6
12490IF board?point>128 AND point>maxpoint THEN maxpoint=point
12500NEXT point
12510IF maxpoint <FNmindice AND maxpoint = start THEN possible=TRUE
12520ENDIF
12530WHEN "white":
12540IF dest=25 THEN
12550possible=TRUE
12560ELSE
12570minpoint=25
12580FOR point=18 TO 24
12590IF board?point>0 AND board?point<128 AND point<minpoint THEN minpoint=point
12600NEXT point
12610IF (25-minpoint) <FNmindice AND minpoint = start THEN possible=TRUE
12620ENDIF
12630ENDCASE
12640=possible
12650
12660DEFFNmindice
12670REM returns number of smallest dice available
12680LOCAL dice,roll,min
12690min=6
12700FOR dice = 1 TO dice(0)
12710roll=dice(dice)
12720IF roll <128 THEN
12730IF roll<min THEN min=roll
12740ENDIF
12750NEXT dice
12760=min
12770
12780DEFFNbearingpossible(col$)
12790REM Checks whether all pieces within home board
12800LOCAL point,possible: possible = TRUE
12810CASE col$ OF
12820WHEN "white":
12830IF barwhite >0 THEN
12840possible=FALSE
12850ELSE
12860point=0
12870REPEAT
12880point+=1
12890IF board?point>0 AND board?point<128 THEN possible=FALSE
12900UNTIL point=18 OR NOT possible
12910ENDIF
12920WHEN "black":
12930IF barblack>0 THEN
12940possible=FALSE
12950ELSE
12960point=6
12970REPEAT
12980point+=1
12990IF board?point>128 THEN possible =FALSE
13000UNTIL point=24 OR NOT possible
13010ENDIF
13020ENDCASE
13030=possible
13040
13050DEFFNlegalmove(col$,startpoint,endpoint)
13060LOCAL state$,diff,legal,d,dicefound
13070legal=0:dicefound=0
13080REPEAT
13090legal+=1
13100IF legalmoves(1,legal)=startpoint AND legalmoves(2,legal) = endpoint THEN
13110dicefound = legalmoves(3,legal): barmove = legalmoves(4,legal): bearing=legalmoves(5,legal)
13120ENDIF
13130UNTIL dicefound OR legal = nlegal
13140IF dicefound THEN
13150dice(dicefound) +=128
13160diceavailable -= 1
13170ENDIF
13180= dicefound
13190
13200DEFFNpointstate(point)
13210IF board?point MOD 128 =0 THEN ="empty"
13220IF board?point =1 THEN ="onewhite"
13230IF board?point =129 THEN ="oneblack"
13240IF board?point>128 THEN ="black"
13250="white"
13260
13270DEFPROCexecutemove(col$,start,end)
13280LOCAL screen,oppcol$
13290IF col$="white" THEN oppcol$="black" ELSE oppcol$="white"
13300IF bearing THEN PROCbearoffpiece(col$,start):ENDPROC
13310IF movefrombar AND NOT FNcomputercol(col$) THEN
13320CASE col$ OF
13330WHEN "white": barwhite -=1
13340WHEN "black": barblack -=1
13350ENDCASE
13360PROCshadow_drawbar
13370ELSE
13380IF NOT FNcomputercol(col$) THEN
13390board?start=board?start-1
13400IF board?start=128 THEN board?start=0
13410ENDIF
13420ENDIF
13430IF NOT barmove THEN
13440IF col$="black" AND board?end=0 THEN board?end=128
13450board?end=board?end+1
13460ELSE
13470board?end=1
13480IF col$="black" THEN board?end += 128
13490ENDIF
13500FOR screen = 1 TO 2
13510PROCswitch_update_bank
13520PROCdrawpoint(start)
13530PROCdrawpoint(end)
13540PROCswitch_display_bank
13550NEXT screen
13560IF barmove THEN
13570SOUND 1,-10,70,5
13580PROCcomputerdrag(oppcol$,end,99,TRUE)
13590CASE col$ OF
13600WHEN "white": barblack+=1: board?end=1
13610WHEN "black": barwhite+=1: board?end=129
13620ENDCASE
13630PROCshadow_drawbar
13640ENDIF
13650REM IF movefrombar THEN PROCshadow_box(barbox())
13660ENDPROC
13670
13680DEFPROCcantbox(col$,message$)
13690IF message$="" THEN
13700IF col$="white" THEN message$ ="WHITE" ELSE message$="BLACK"
13710message$+=" CANNOT MOVE"
13720ENDIF
13730SYS "Hourglass_Smash"
13740PROCdisplaybox(cantbox(),message$)
13750ENDPROC
13760
13770DEFPROCdisplaybox(cantbox(),message$)
13780LOCAL x,y,button,xm,ym
13790PROCshowbox(cantbox(),black,ivory)
13800button=0:*FX15
13810xm = cantbox(1)+128
13820ym = cantbox(2)+240
13830GCOL blue
13840VDU 5
13850MOVE xm,ym: PRINT message$
13860GCOL red
13870MOVE cantbox(1)+128,cantbox(2)+100:PRINT "Press any button"
13880REPEAT
13890MOUSE x,y,button
13900UNTIL button
13910VDU 4
13920MOUSE RECTANGLE 0,0,1239,1023
13930ENDPROC
13940
13950DEFPROCshowbox(box(),bordercol,boxcol)
13960LOCAL border:border=32
13970GCOL bordercol
13980RECTANGLE FILL box(1),box(2),box(3)-box(1),box(4)-box(2)
13990GCOL boxcol
14000RECTANGLE FILL box(1)+border,box(2)+border,box(3)-box(1)-2*border,box(4)-box(2)-2*border
14010MOUSE RECTANGLE box(1),box(2),box(3)-box(1),box(4)-box(2)
14020ENDPROC
14030
14040DEFPROCwindisplay(m1$,m2$,m3$)
14050LOCAL border,x,y,ystep,centresize,button
14060border=32:centresize=(optbox(3)-optbox(1))DIV16
14070PROCgrabbox(optbox(),"temp")
14080PROCshowbox(optbox(),black,white)
14090VDU5
14100ystep=3*border
14110x=optbox(1): y = optbox(4)-ystep
14120GCOL black
14130MOVE x,y:PRINT FNcentrel(m1$,centresize)
14140y-=ystep: GCOL red
14150MOVE x,y:PRINT FNcentrel(m2$,centresize)
14160y-=ystep:GCOL blue
14170MOVE x,y:PRINT FNcentrel(m3$,centresize)
14180y-=ystep: GCOL black
14190MOVE x,y:PRINT FNcentrel("Press any button",centresize)
14200VDU4
14210*FX15
14220REPEAT:MOUSEx,y,button:UNTIL button
14230PROCrestorebox(optbox(),"temp")
14240MOUSE RECTANGLE 0,0,1239,1023
14250ENDPROC
14260
14270DEFFNcentrel(text$,space)
14280REM adds blanks to left of text$ to centre in space
14290LOCAL l,a
14300l=LEN(text$):a=(space-l) DIV 2
14310=STRING$(a," ")+text$
14320
14330DEFFNsurebox(message$)
14340LOCAL yespanel(),nopanel(),border,button,sure,decision
14350border=32
14360DIM yespanel(4),nopanel(4)
14370yespanel(1)=surebox(1)+70:yespanel(2)=surebox(2)+100:yespanel(3)=yespanel(1)+100:yespanel(4)=yespanel(2)+80
14380nopanel()=yespanel():nopanel(1)+=130:nopanel(3)+=130
14390PROCgrabbox(surebox(),"temp2")
14400PROCshowbox(surebox(),midgrey,white)
14410PROCdrawtextbox(yespanel(),"YES",ivory,red)
14420PROCdrawtextbox(nopanel(),"NO",ivory,red)
14430GCOL blue:VDU7
14440VDU5
14450IF message$="" THEN message$="ARE YOU SURE?"
14460MOVE surebox(1)+80,surebox(4)-80:PRINT message$
14470button=0:decision=FALSE
14480REPEAT
14490IF FNmouseinbox(yespanel(),button) THEN sure=TRUE:decision=TRUE
14500IF FNmouseinbox(nopanel(),button) THEN sure=FALSE:decision=TRUE
14510UNTIL decision
14520PROCrestorebox(surebox(),"temp2")
14530VDU4:MOUSE RECTANGLE 0,0,1239,1023
14540=sure
14550
14560
14570DEFPROCbearoffpiece(col$,start)
14580LOCAL winner$,s: winner$=""
14590CASE col$ OF
14600WHEN "white":
14610COLOUR white
14620whitebearing=TRUE
14630whitegamescore +=1
14640whitepieces -=1
14650IF whitepieces = 0 THEN winner$ =col$
14660FOR s = 1 TO 2
14670PRINT TAB(70,6);whitegamescore
14680PROCswitch_update_bank
14690NEXT s
14700WHEN "black":
14710COLOUR black
14720blackbearing=TRUE
14730blackgamescore +=1
14740blackpieces -=1
14750IF blackpieces = 0 THEN winner$ = col$
14760FOR s = 1 TO 2
14770PRINT TAB(70,15);blackgamescore
14780PROCswitch_update_bank
14790NEXT s
14800ENDCASE
14810IF NOT FNcomputercol(col$) THEN
14820board?start=board?start-1
14830IF board?start=128 THEN board?start=0
14840PROCshadow_drawpoint(start,FALSE)
14850ENDIF
14860REM When computer is bearing off, start point is redrawn
14870REM by PROCcomputerdrag
14880IF winner$ >"" THEN PROCwinner(winner$)
14890ENDPROC
14900
14910DEFPROCwinner(col$)
14920LOCAL message1$,message2$,message3$,winnings,bonus,winner$,loser$
14930IF doublecube = 64 AND doubleturn$="either" THEN winnings = 1 ELSE winnings = doublecube
14940bonus=FNwinbonus(col$,board)
14950winnings = winnings*bonus
14960IF col$="white" THEN winner$="WHITE":loser$="BLACK" ELSE winner$="BLACK":loser$="WHITE"
14970message1$=winner$+" WINS!"
14980CASE bonus OF
14990WHEN 1: message2$="STANDARD PAYOUT"
15000WHEN 2: message2$=loser$+" IS GAMMONED"
15010WHEN 3: message2$=loser$+" IS BACKGAMMONED"
15020ENDCASE
15030message3$=loser$+" PAYS �"+STR$winnings
15040PROCwindisplay(message1$,message2$,message3$)
15050IF col$="white" THEN whitemoney+=winnings:blackmoney-=winnings ELSE blackmoney+=winnings:whitemoney-=winnings
15060IF whitemoney < 0 OR blackmoney <0 THEN PROCbankrupt(loser$)
15070gameinprogress=FALSE
15080ENDPROC
15090
15100DEFPROCbankrupt(loser$)
15110LOCAL message$
15120PROCdelay(30):*FX15
15130message$=loser$+" IS BANKRUPT!"
15140PROCgrabbox(cantbox(),"temp")
15150PROCdisplaybox(cantbox(),message$)
15160PROCrestorebox(cantbox(),"temp")
15170MOUSE RECTANGLE 0,0,1239,1023
15180whitemoney=100:blackmoney=100
15190ENDPROC
15200
15210DEFFNwinbonus(col$,board)
15220IF double_refused THEN =1
15230REM Returns 2 for gammon, 3 for backgammon, otherwise 1
15240LOCAL bonus,point
15250CASE col$ OF
15260WHEN "white"
15270IF blackpieces < 15 THEN
15280bonus=1
15290ELSE
15300bonus=2
15310FOR point = 19 TO 24
15320IF FNpointpieces("black",point,board) THEN bonus=3
15330NEXT point
15340ENDIF
15350WHEN "black"
15360IF whitepieces <15 THEN
15370bonus =1
15380ELSE
15390bonus=2
15400FOR point = 1 TO 6
15410IF FNpointpieces("white",point,board) THEN bonus=3
15420NEXT point
15430ENDIF
15440ENDCASE
15450=bonus
15460
15470REM Computer strategy
15480REM =================
15490
15500DEFFNchoosecomputermove(col$)
15510LOCAL legal,value,max,nmax,move
15520IF nlegal=1 THEN =1
15530IF NOT bearingpossible AND (allpast OR FNopponentbearing(col$)) THEN
15540=FNmostdistantmove(col$)
15550ENDIF
15560IF bearingpossible THEN
15570IF FNnohomeblots(col$) THEN =FNchoosebearingmove(col$)
15580ENDIF
15590IF move>0 THEN =move
15600REM Evaluate possible moves and keep list of those with
15610REM equal maximum score. Then choose one at random
15620max = FNevaluatemove(1,col$)
15630nmax = 1: bestmoves(1) = 1:move=1
15640REM PRINT TAB(0,1);"            "
15650REM PRINT TAB(0,1);col$;" ";1;" ";legalmoves(1,1);" ";max;"  "
15660FOR legal = 2 TO nlegal
15670value=FNevaluatemove(legal,col$)
15680REM FOR i=1 TO 24:bestboard?i = newboard?i:NEXT
15690IF value > max THEN
15700max=value:nmax=1:bestmoves(1)=legal:move=legal
15710ELSE
15720IF value = max THEN
15730nmax+=1: bestmoves(nmax) = legal
15740ENDIF
15750ENDIF
15760REM PRINT TAB(0,legal);"            "
15770REM PRINT TAB(0,legal);col$;" ";legal;" ";legalmoves(1,legal);" ";value;"  "
15780NEXT legal
15790REM PRINT TAB(0,legal);"            "
15800REM PRINT TAB(0,legal)nmax,max
15810REM IF nmax = 1 THEN move =bestmoves(1) ELSE move =bestmoves(RND(nmax))
15820REM PRINT TAB(0,0);SPC50;
15830REM PRINT TAB(0,0);"colour ";col$;" nlegal ";nlegal;" bestmove ";move;" value ";max
15840=move
15850
15860DEFFNplayerbearing(col$)
15870= ((col$="white" AND whitebearing) OR (col$="black" AND blackbearing))
15880
15890DEFFNopponentbearing(col$)
15900IF (col$="white" AND blackpieces<7) OR (col$="black" AND whitepieces<7) THEN = FALSE
15910=(col$="white" AND blackbearing) OR (col$="black" AND whitebearing)
15920
15930DEFFNmostdistantmove(col$)
15940REM returns legal move of piece most distant from home
15950LOCAL move,best,furthest,current
15960best = 1: furthest = legalmoves(1,1)
15970FOR move = 2 TO nlegal
15980current = legalmoves(1,move)
15990CASE col$ OF
16000WHEN "white": IF current < furthest THEN current = furthest:best=move
16010WHEN "black": IF current > furthest THEN current = furthest:best=move
16020ENDCASE
16030NEXT move
16040=best
16050
16060DEFFNnohomeblots(col$)
16070REM returns TRUE if no blots in home board that can be attacked
16080LOCAL start,end,point,blotscore,present
16090IF (col$="white" AND barblack) OR (col$="black" AND barwhite) THEN =FALSE
16100blotscore=0
16110IF col$="white" THEN start=19:end=24 ELSE start=1:end=6
16120FOR point=start TO end
16130present = FNpointpieces(col$,point,board)
16140IF present=1 THEN blotscore -= FNblotscore(col$,point,col$,barwhite,barblack,board,1,0,0)
16150NEXT point
16160REM PRINT TAB(0,0);"     ";TAB(0,0);blotscore
16170=(blotscore=0)
16180
16190DEFFNchoosebearingmove(col$)
16200REM chooses bearing move that is furthest from the end of the board
16210LOCAL move,from,bestmove,bestmovefrom
16220bestmove=0
16230FOR move = 1 TO nlegal
16240IF legalmoves(5,move) THEN
16250from = legalmoves(1,move)
16260IF bestmove=0 THEN
16270bestmove=move:bestmovefrom=from
16280ELSE
16290CASE col$ OF
16300WHEN "white":IF from<bestmovefrom THEN bestmove=move:bestmovefrom=bestmovefrom
16310WHEN "black":IF from>bestmovefrom THEN bestmove=move:bestmovefrom=bestmovefrom
16320ENDCASE
16330ENDIF
16340ENDIF
16350NEXT move
16360REM PRINT TAB(0,1);"    ";TAB(0,1);bestmove
16370=bestmove
16380
16390DEFFNevaluatemove(move,col$)
16400PROCprojectmove(move,col$)
16410=FNevaluateboard(col$,newboard,newwhitepieces,newblackpieces,newbarwhite,newbarblack,newwinner$)
16420
16430DEFPROCprojectmove(move,col$)
16440LOCAL point
16450FOR point=1 TO 24:newboard?point=board?point:NEXT point
16460start = legalmoves(1,move)
16470end = legalmoves(2,move)
16480diceused = legalmoves(3,move)
16490barmove = legalmoves(4,move)
16500bearing = legalmoves(5,move)
16510movefrombar = (start=99)
16520newwhitepieces = whitepieces
16530newblackpieces = blackpieces
16540newbarwhite = barwhite
16550newbarblack = barblack
16560newwinner$=""
16570IF bearing THEN PROCprojectbearing(col$,start):ENDPROC
16580IF movefrombar THEN
16590CASE col$ OF
16600WHEN "white": newbarwhite -=1
16610WHEN "black": newbarblack -=1
16620ENDCASE
16630ELSE
16640newboard?start=newboard?start-1
16650IF newboard?start=128 THEN newboard?start=0
16660ENDIF
16670IF barmove THEN
16680CASE col$ OF
16690WHEN "white": newbarblack +=1: newboard?end=1
16700WHEN "black": newbarwhite +=1: newboard?end=129
16710ENDCASE
16720ELSE
16730IF col$="black" AND newboard?end=0 THEN newboard?end=128
16740newboard?end=newboard?end+1
16750ENDIF
16760ENDPROC
16770
16780DEFPROCprojectbearing(col$,start)
16790newwinner$=""
16800CASE col$ OF
16810WHEN "white":
16820COLOUR white
16830newwhitepieces -=1
16840IF newwhitepieces = 0 THEN newwinner$ =col$
16850WHEN "black":
16860COLOUR black
16870newblackpieces -=1
16880IF newblackpieces = 0 THEN newwinner$ = col$
16890ENDCASE
16900newboard?start=newboard?start-1
16910IF newboard?start=128 THEN newboard?start=0
16920ENDPROC
16930
16940DEFFNevaluateboard(col$,board,whitepieces,blackpieces,barwhite,barblack,win$)
16950IF col$ = win$ THEN =playerwins
16960LOCAL score,wp,bp,whc,woc,bhc,boc: score = 0
16970PROCcount_board(board,wp,bp,whc,woc,bhc,boc)
16980CASE col$ OF
16990WHEN "white":
17000score = FNboardscore("white",board,col$,barwhite,barblack,wp,whc,woc,bhc,boc,whiteblots)-FNboardscore("black",board,col$,barwhite,barblack,bp,bhc,boc,whc,woc,blackblots)
17010score += barwhite*pieceonbar
17020score -= barblack*pieceonbar
17030score += (15-whitepieces)*pieceoffboard
17040score -= (15-blackpieces)*pieceoffboard
17050WHEN "black"
17060score = FNboardscore("black",board,col$,barwhite,barblack,bp,bhc,boc,whc,woc,blackblots)-FNboardscore("white",board,col$,barwhite,barblack,wp,whc,woc,bhc,boc,whiteblots)
17070score -= barwhite*pieceonbar
17080score += barblack*pieceonbar
17090score -= (15-whitepieces)*pieceoffboard
17100score += (15-blackpieces)*pieceoffboard
17110REM VDU7:PRINT TAB(0,1);"     ";TAB(0,1);score
17120REM REPEAT UNTIL GET
17130ENDCASE
17140=score
17150
17160DEFPROCcount_board(board,RETURN whitepoints,RETURN blackpoints,RETURN white_hc,RETURN white_oc,RETURN black_hc,RETURN black_oc)
17170LOCAL point,whitepresent,blackpresent
17180whitepoints=0:blackpoints=0:white_hc=0:white_oc=0:black_hc=0:black_oc=0
17190FOR point = 1 TO 24
17200whitepresent = FNpointpieces("white",point,board)
17210whiteblots?point = (whitepresent = 1)
17220white_cover?point = (whitepresent > 1)
17230blackpresent = FNpointpieces("black",point,board)
17240blackblots?point = (blackpresent = 1)
17250black_cover?point = (blackpresent > 1)
17260IF whitepresent > 0 THEN
17270IF point<19 THEN whitepoints += whitepresent*point ELSE whitepoints +=whitepresent*pieceinhomeboard
17280IF whitepresent >1 THEN
17290IF point > 18 THEN white_hc+=1 ELSE IF point>12 THEN white_oc+=1
17300ENDIF
17310ENDIF
17320IF blackpresent > 0 THEN
17330IF point>6 THEN blackpoints += blackpresent*(25-point) ELSE blackpoints +=blackpresent*pieceinhomeboard
17340IF blackpresent >1 THEN
17350IF point < 7 THEN black_hc+=1 ELSE IF point<13 THEN black_oc+=1
17360ENDIF
17370ENDIF
17380NEXT point
17390ENDPROC
17400
17410DEFFNboardscore(col$,board,movecol$,barwhite,barblack,board_points,own_hc,own_oc,opp_hc,opp_oc,ownblots)
17420LOCAL point,present,score,blotscore,ntrapping,ntrapped,trapscore
17430blotscore=0:ntrapped=0:ntrapping=0:trapscore=0
17440score=board_points+own_hc*doubleinhomebonus+own_oc*doubleinouterbonus
17450FOR point = 1 TO 24
17460IF ownblots?point THEN blotscore += FNblotscore(col$,point,movecol$,barwhite,barblack,board,diceavailable,opp_hc,opp_oc)
17470CASE col$ OF
17480WHEN "white":
17490IF white_cover?point THEN
17500IF point>18 THEN
17510trapscore+=FNtrapbonus(col$,point,board,ntrapping)
17520ELSE
17530IF point >12 THEN trapscore+=FNtrapbonus(col$,point,board,ntrapping)
17540ENDIF
17550ENDIF
17560WHEN "black"
17570IF black_cover?point THEN
17580IF point <7 THEN
17590trapscore+=FNtrapbonus(col$,point,board,ntrapping)
17600ELSE
17610IF point <13 THEN trapscore+=FNtrapbonus(col$,point,board,ntrapping)
17620ENDIF
17630ENDIF
17640ENDCASE
17650REM PRINT TAB(0,point);point,present,score,blotscore
17660NEXT point
17670IF ntrapping >4 THEN trapscore = 2*trapscore
17680score+=trapscore
17690REM IF col$="white" THEN x=0 ELSE x=40
17700REM PRINT TAB(x,0)SPC60;
17710REM PRINT TAB(x,0);col$;" ";score;" ";trapscore,ntrapping
17720=INT(score+blotscore)
17730
17740DEFFNtrapbonus(col$,doublepoint,board,RETURN ntrapping)
17750REM awards points for enemy pieces inside doubled point
17760REM in home and outer boards
17770LOCAL point,oppcol$,bonus,tb,pp
17780IF FNplayerbearing(col$) THEN tp = bearingtrapbonus ELSE tp = trapbonus
17790bonus=0
17800IF col$="white" THEN oppcol$="black" ELSE oppcol$="white"
17810CASE col$ OF
17820WHEN "white":
17830bonus += barblack*tp
17840FOR point = doublepoint TO 24
17850bonus+= FNpointpieces(oppcol$,point,board)*tp
17860NEXT point
17870WHEN "black":
17880bonus += barwhite*tp
17890FOR point = 1 TO doublepoint
17900bonus+=FNpointpieces(oppcol$,point,board)*tp
17910NEXT point
17920ENDCASE
17930REM PRINT TAB(0,0);SPC30;TAB(0,0);col$,doublepoint,bonus:REPEAT UNTIL GET
17940IF bonus>0 THEN ntrapping +=1
17950=bonus
17960
17970
17980DEFFNblotscore(col$,blotpoint,movecol$,barwhite,barblack,board,diceleft,opp_hc,opp_oc)
17990REM penalty for blot depends on how advanced the point
18000REM and how many opponent within six points ahead
18010REM and covering of opponents home and outerboards
18020LOCAL blotscore,coverable,penalty,ahead,oppcover
18030IF allpast THEN =0
18040IF col$ <> movecol$ OR diceleft <2 THEN penalty = TRUE ELSE penalty=FALSE
18050REM blots always scored as penalties when evaluating opponents move
18060REM or when playing second dice
18070IF NOT penalty THEN
18080IF NOT FNcoverable_blot(col$,blotpoint,board,barblack,barwhite) THEN penalty = TRUE
18090ENDIF
18100REM also treated as penalties if playing the first dice and a
18110REM second one cannot cover the blot
18120IF NOT penalty THEN
18130CASE col$ OF
18140WHEN "white": blotscore = blotposweight*((blotpoint-1)DIV 6)+1
18150WHEN "black": blotscore = blotposweight*((25-blotpoint-1)DIV 6)+1
18160ENDCASE
18170ELSE
18180REM penalise blots
18190oppcover = 2*opp_hc + opp_oc
18200ahead = FNaheadofblot(col$,blotpoint,board,barblack,barwhite,oppcover,blotscore)
18210ENDIF
18220REM VDU7:PRINT TAB(0,0);SPC30;TAB(0,0);col$,blotpoint,blotscore:REPEAT UNTIL GET
18230=blotscore
18240
18250DEFFNaheadofblot(col$,blotpoint,board,barblack,barwhite,oppcover,RETURN blotscore)
18260LOCAL ahead, aheadpoint,point,blotneg,coverscore
18270IF (col$="white" AND blotpoint>12) OR (col$="black" AND blotpoint <13) THEN
18280coverscore=oppcover DIV 4
18290ELSE
18300coverscore=0
18310ENDIF
18320CASE col$ OF
18330WHEN "white":
18340IF blotpoint > 18 AND barblack>0 THEN ahead+=2
18350REM piece on bar counted double to deter hitting in home board
18360aheadpoint=blotpoint+6:IF aheadpoint >24 THEN aheadpoint = 24
18370FOR point = blotpoint TO aheadpoint
18380IF FNpointpieces("black",point,board)>0 THEN ahead+=1
18390NEXT point
18400IF ahead = 0 THEN blotneg =1 ELSE blotneg = blotnegweight
18410blotscore=(ahead+coverscore)*blotneg*((blotpoint-1) DIV 6)+1
18420WHEN "black":
18430IF blotpoint <7 AND barwhite>0 THEN ahead+=2
18440aheadpoint=blotpoint-6:IF aheadpoint <1 THEN aheadpoint = 1
18450FOR point = aheadpoint TO blotpoint
18460IF FNpointpieces("white",point,board)>0 THEN ahead+=1
18470NEXT point
18480IF ahead = 0 THEN blotneg =1 ELSE blotneg = blotnegweight
18490blotscore=(ahead+coverscore)*blotneg*((25-blotpoint-1) DIV 6)+1
18500ENDCASE
18510blotscore = -blotscore
18520=ahead
18530
18540DEFFNcoverable_blot(col$,blotpoint,board,barblack,barwhite)
18550LOCAL dicefree,startpoint,roll,present,ok,endpoint,state$,dummy
18560IF diceused = 1 THEN dicefree=2 ELSE dicefree=1
18570roll=dice(dicefree)
18580IF col$="white" THEN startpoint = blotpoint-roll ELSE startpoint=blotpoint+roll
18590IF startpoint <0 OR startpoint >24 THEN
18600ok=FALSE
18610ELSE
18620present = FNpointpieces(col$,startpoint,board)
18630IF present >0 AND present <> 2 THEN ok=TRUE ELSE ok=FALSE
18640REM if covering point has two pieces then covering would
18650REM create a blot!
18660ENDIF
18670REM If blot cannot be covered then check if it could be move out
18680REM of danger by second dice. The destination point must be
18690REM in the same state as in newboard and board
18700IF NOT ok THEN
18710IF col$="white" THEN endpoint = blotpoint+roll:oppcol$="black" ELSE endpoint = blotpoint-roll:oppcol$="black"
18720IF endpoint<0 OR endpoint>24 THEN
18730ok = FALSE
18740ELSE
18750state$=FNpointstate(endpoint)
18760IF RIGHT$(state$,5)=oppcol$ THEN =TRUE
18770IF state$="empty" OR state$=col$ THEN ok = NOT FNaheadofblot(col$,blotpoint,board,barblack,barwhite,0,dummy)
18780ENDIF
18790ENDIF
18800=ok
18810
18820DEFFNpointpieces(col$,point,board)
18830LOCAL pieces
18840pieces = board?point
18850IF pieces = 0 THEN =0
18860CASE col$ OF
18870WHEN "white":
18880IF pieces >128 THEN =0 ELSE = pieces
18890WHEN "black":
18900IF pieces <129 THEN =0 ELSE = pieces MOD 128
18910ENDCASE
18920
18930
18940DEFPROCinit_weightings
18950REM signed for player of current colour, opponent
18960REM pieces scored as negation of these
18970REM alter these to tweak the strategy
18980playerwins = 999
18990pieceinhomeboard = 19
19000pieceinawayboard = -2: REM ie opponent's home board
19010pieceoffboard = 30
19020pieceonbar = -5
19030doubleinhomebonus=3
19040doubleinouterbonus=2
19050trapbonus = 1        :REM bonus for piece inside doubled point
19060bearingtrapbonus = 2.5 :REM as above when also bearing off
19070double_threshold = 30
19080REM since all pieces score for how advanced they are on the board
19090REM hitting and advanced piece automatically incurs a substantial
19100REM benefit
19110blotnegweight = 2
19120blotposweight = 2
19130ENDPROC
19140
19150DEFPROCallpast_weightings
19160REM weightings reset when pieces pass each other
19170pieceinhomeboard = 30
19180pieceoffboard = 50
19190ENDPROC
19200
19210DEFPROCfind_opening_moves(col$)
19220LOCAL moves,n,i,j,dice1,dice2
19230dice1=dice(1):dice2=dice(2)
19240moves=0
19250REPEAT:moves+=1
19260UNTIL dice1 = opening_moves(1,moves) AND dice2=opening_moves(2,moves)
19270IF double THEN
19280FOR i=1 TO 4
19290CASE i OF
19300WHEN 1,2: j=3
19310WHEN 3,4: j=4
19320ENDCASE
19330openings(i)=FNopening_point(opening_moves(j,moves),col$)
19340REM PRINT TAB(0,i);i,openings(i)
19350NEXT i
19360ELSE
19370FOR i=1 TO 2
19380openings(i)=FNopening_point(opening_moves(i+2,moves),col$)
19390REM PRINT TAB(0,i);i,openings(i)
19400NEXT i
19410ENDIF
19420ENDPROC
19430
19440DEFFNopening_point(point,col$)
19450IF col$="black" THEN
19460=(25-point)
19470ELSE
19480=point
19490ENDIF
19500
19510DEFPROCinit_opening_moves
19520LOCAL move,i
19530RESTORE 19610
19540DIM opening_moves(4,21),openings(4)
19550FOR move=1 TO 21
19560FOR i=1 TO 4
19570READ opening_moves(i,move)
19580NEXT i
19590NEXT move
19600ENDPROC
19610DATA 3,1,17,19
19620DATA 6,1,12,17
19630DATA 4,2,17,19
19640DATA 5,3,17,19
19650DATA 6,5,1,7
19660DATA 6,4,1,7
19670DATA 6,3,1,7
19680DATA 6,2,12,18
19690DATA 5,1,12,19
19700DATA 4,1,12,19
19710DATA 2,1,12,19
19720DATA 5,4,12,12
19730DATA 5,2,12,12
19740DATA 4,3,12,12
19750DATA 3,2,12,12
19760DATA 6,6,1,12
19770DATA 5,5,12,17
19780DATA 4,4,1,12
19790DATA 3,3,17,19
19800DATA 2,2,12,19
19810DATA 1,1,17,19
19820
19830
19840REM End of computer strategy
19850REM ========================
19860
19870
19880DEFPROCswitch_display_bank
19890IF display_bank=1 THEN display_bank=2 ELSE display_bank=1
19900WAIT
19910OSCLI "FX 113,"+STR$display_bank
19920ENDPROC
19930
19940DEFPROCswitch_update_bank
19950IF update_bank=1 THEN update_bank=2 ELSE update_bank=1
19960WAIT
19970OSCLI "FX 112,"+STR$update_bank
19980ENDPROC
19990
20000DEFPROCshadow_box(box())
20010REM Copy screen area into shadow screen
20020PROCgrabbox(box(),"temp")
20030PROCswitch_update_bank
20040PROCrestorebox(box(),"temp")
20050PROCswitch_update_bank
20060ENDPROC
20070

�> <Backg$Dir>.Backgammon
#� Jonathan Evans, December 1989
%� (c) Archimedes World April 1992

(*FX200,1
2	�init
<�
F
�initgame
P�screen
Z�startgame
d	�play
n� �
x�
�
���screen
�� screen
� update_bank=2:display_bank=2
�*FX113,2
�*FX112,2
�ș "Hourglass_On"
�� 128+black:�
�� screen = 1 � 2
��switch_update_bank
�
�board
�
�panel
��switch_display_bank
ȗ �
� screen
ș "Hourglass_Off"
"�
,
6
��init
@X=�(-�)
J� 140: � 23,0,10,32|
TPblackmoney=1000:whitemoney=1000:blackplayer$="COMPUTER":whiteplayer$="HUMAN"
^Dmidgrey = 9: lightgrey = 10: darkgrey = 11: black = 0: white = 7
h7green = 2: brown = 6: red = 1: blue = 4: ivory = 14
rJ� midgrey, 128,128,128: � darkgrey, 64,64,64: � lightgrey, 196,196,196
|<� green, 32,132,32: � brown, 148,50,52: � red,200,16,016
�/� 15,0,0,0:� 14,240,240,176: � dice colours
�d� board 24, initboard 24, bestboard 24,whiteblots 24,blackblots 24,white_cover 24,black_cover 24
��boardsize = 1024: bordersize = 48: barwidth = 72: pointwidth = (boardsize-2*bordersize-barwidth)/12: pointheight = 380: ytop = boardsize-bordersize-2: ybottom = bordersize+6: piecesize = 60
�P� whitethrowbox(4),blackthrowbox(4),gamebox(4),dice(2),showdice(4),barbox(4)
�kbarbox(1)=(boardsize-barwidth)/2:barbox(2)=0:barbox(3)=barbox(1)+barwidth:barbox(4)=barbox(4)+boardsize
��blackthrowbox(1)=bordersize+16:blackthrowbox(2)=bordersize+pointheight+16:blackthrowbox(3)=(boardsize-barwidth)/2-16:blackthrowbox(4)=boardsize-bordersize-pointheight-16
™whitethrowbox(1)=(boardsize+barwidth)/2+4:whitethrowbox(2)=blackthrowbox(2):whitethrowbox(3)=boardsize-bordersize-4:whitethrowbox(4)=blackthrowbox(4)
�Ggamebox(1)=0:gamebox(2)=0:gamebox(3)=boardsize:gamebox(4)=boardsize
�*evaldisplay$="ON":double=�:firstpair=�
�� legalmoves(5,50):nlegal=0
�(� opttext$(5),pointbox(4),surebox(4)
�*surebox(1)=1240/3-32:surebox(2)=1024/3
�3surebox(3)=2*surebox(1):surebox(4)=2*surebox(2)
!� i = 1 � 5:� opttext$(i):� i
,� "WHITE","BLACK","MONEY","VALUE","QUIT"
s� optbox(4),cantbox(4): optbox(1)=1240/4:optbox(2)=1024/4:optbox(3)=optbox(1)+1024/2:optbox(4)=optbox(2)+1024/2
&4cantbox()=optbox():cantbox(2)+=80:cantbox(4)-=80
0 �  bestmoves(40),newboard 24
:�initpieces
D�initpanels
N�init_weightings
X�init_opening_moves
b�init_sprites
lȠ 2
v*CHANNELVOICE 1 1
�*CHANNELVOICE 2 6
�*<Backg$Dir>.HAND3
�
ȗ � 1
��
�
���init_sprites
�spritesize% = 100*1024
�� spritearea spritesize%
�!spritearea = spritesize%
�spritearea!4=0
�spritearea!8=16
�spritearea!16=16
�<ș "OS_SpriteOp",256+10,spritearea,"<Backg$Dir>.sprites"
�

��initgame
 Cwhiteturn=�:gameinprogress=�: whitegamescore=0:blackgamescore=0
*(barblack=0:barwhite = 0:dicerolled=�
4�initpanelactivity
>4doublecube = 64:doubleturn$ = "either":doubled=�
H,blackpieces=15:whitepieces=15:winner$=""
R3blackopening=�: whiteopening=�: current_score=0
\3allpast=�: allpast_weight=�: double_refused = �
f(display_bank=2:update_bank=2:*SHADOW
p!whitebearing=�:blackbearing=�
z�
�
���initpanels
�� panno
�+� initialise panels in right hand strip
��� paneltext$(4),panel(4),panels(4,4),panelactive(5),movepanel(4),dicepanel(4),optpanel(4),quitpanel(4),okpanel(4),panelbox(4)
�noptpanel(1)=optbox(1)+200:optpanel(2)=optbox(4)-112:optpanel(3)=optpanel(1)+240:optpanel(4)=optpanel(2)+50
�rquitpanel(1)=optbox(1)+60:quitpanel(2)=optbox(2)+50:quitpanel(3)=quitpanel(1)+300:quitpanel(4)=quitpanel(2)+80
�hokpanel(1)=quitpanel(1)+320:okpanel(2)=quitpanel(2):okpanel(3)=okpanel(1)+80:okpanel(4)=quitpanel(4)
�xpaneltext$(1)="ROLL DICE": paneltext$(2)="OFFER DOUBLE": paneltext$(3) = "SET OPTIONS": paneltext$(4) = "START GAME"
�Lpanel(1) = boardsize+16:panel(3)=panel(1)+200:panel(2) =320:panel(4)=400
�;dicepanel()=panel():dicepanel(2)+=100:dicepanel(4)+=100
�Qmovepanel(1)=panel(1):movepanel(3)=panel(3):movepanel(2)=730:movepanel(4)=780
�� panno = 1 � 4
panels(1,panno) = panel(1)
,panels(2,panno) = panel(2)-100*(panno-1)
panels(3,panno) = panel(3)
$,panels(4,panno) = panel(4)-100*(panno-1)
.� panno
8cpanelbox(1)=panels(1,4):panelbox(2)=panels(2,4):panelbox(3)=panels(3,1):panelbox(4)=panels(4,1)
B�
L
V
`��initpanelactivity
j-� sets up initial state of panel activity
tPpanelactive(1)=�: panelactive(2) = �: panelactive(3) = �: panelactive(4) = �
~�
�
�
���board
�&� draws board at start of new game
�� 128+black:�
�� i
�+� i = 1 � 24: board?i = initboard?i:� i
�v� FOR i = 1 TO 24: board?i = testboard?i:NEXT i:blackpieces=11:whitepieces=9:blackopening=FALSE:whiteopening=FALSE
�;� midgrey: ȓ Ȑ boardsize+8,0,1240-boardsize,boardsize
�*� brown: ȓ Ȑ 0,0,boardsize,boardsize
�W� green: ȓ Ȑ bordersize,bordersize,boardsize-2*bordersize, boardsize-2*bordersize
�U� black: ȓ  bordersize,bordersize,boardsize-2*bordersize, boardsize-2*bordersize
!� bordersize,bordersize:� 0,0

3� bordersize,boardsize-bordersize:� 0,boardsize
3� boardsize-bordersize,bordersize:� boardsize,0
F� boardsize-bordersize,boardsize-bordersize: � boardsize,boardsize
(�drawpoints
2�drawbar
<�
F
P
Z��draw_inner_rects
d<� black outline rectangles to replace possible obscuring
n� by redrawing of points
x� width,height,barright
�� black
�/width = (boardsize-barwidth)/2 - bordersize
�(barright = width+bordersize+barwidth
�!height=boardsize-2*bordersize
�Ȗ
�)ȓ bordersize,bordersize,width,height
�Ȗ
�'ȓ barright,bordersize,width,height
��
�
���shadow_drawbar
��switch_display_bank
��drawbar
�switch_display_bank
�shadow_box(barbox())
�
"
,
��drawbar
6� barleft,x,y,xoff,yoff
@$barleft = (boardsize-barwidth)/2
J/� brown: ȓ Ȑ barleft,0,barwidth,boardsize
TP� black:ȓ (boardsize-barwidth)/2,bordersize,barwidth,boardsize-2*bordersize
^1� barblack>0 � �piecesonbar(barblack,"black")
h1� barwhite>0 � �piecesonbar(barwhite,"white")
r� draw doubleing cube
|&x = barleft+10: y = boardsize/2-20
�� ivory
�ȓ Ȑ x,y,54,54
�� black
�ȓ x,y,54,54
�7yoff = 36: � doublecube > 9 � xoff = 10 � xoff = 20
�� 5: � blue
�!� x+xoff,y+yoff:�; doublecube
�� 4
�5� IF gameinprogress THEN PROCshadow_box(barbox())
��
�
� ��piecesonbar(nopieces,col$)
�� piece,x,y

Ȏ col$ �
� "black":
�startpoint(18,x,y)
&(x+=pointwidth+barwidth/2-piecesize/2
0� "white":
:�startpoint(7,x,y)
D(x+=pointwidth+barwidth/2-piecesize/2
N�
X� piece = 1 � nopieces
b#offset = (piece-0.50)*piecesize
l
Ȏ col$ �
v
� "black"
�#y = ybottom +offset-piecesize/2
�� x,y:�plot_sprite(col$,8)
�
� "white"
� y = ytop -offset-piecesize/2
��x,y:�plot_sprite(col$,8)
��
�� piece
��
�
���drawpoints
�"� point,pointcolour,startpoint
�� point = 1 � 24
��drawpoint(point)
� point
�

 !��shadow_drawpoint(point,mfb)
*� screen
4� mfb � �shadow_drawbar
>�switch_update_bank
H�drawpoint(point)
R�switch_display_bank
\�grabbox(pointbox(),"temp")
f�switch_update_bank
p"�restorebox(pointbox(),"temp")
z�switch_update_bank
��
�
���drawpoint(point)
�.� piece,pieces,piececol,offset,s$,r,screen
�� Draw point
�>� point <13 � offset = -pointheight � offset = pointheight
�>�startpoint(point,x,y):�green: ȓ Ȑ x,y,pointwidth,offset
�� point > 12 �
�Mpointbox(1)=x:pointbox(2)=y:pointbox(3)=x+pointwidth:pointbox(4)=y+offset
��
�Mpointbox(1)=x:pointbox(2)=y+offset:pointbox(3)=x+pointwidth:pointbox(4)=y
��
�A� point � 2 = 1 � pointcolour = lightgrey � pointcolour = red
	� pointcolour
	� x,y: � x+pointwidth,y
	S� point < 13 � � 81,-pointwidth/2,-pointheight � � 81,-pointwidth/2,pointheight
	$� Draw pieces on point
	.pieces = board?point
	8� pieces >0 �
	BL� pieces >128 � piececol = black: pieces = pieces � 128 � piececol=white
	Lr=piecesize/2
	Vx+= pointwidth/2-r: piece=0
	`0� piececol = white � s$="white" � s$="black"
	j�: piece+=1
	t#offset = (piece-0.50)*piecesize
	~?� point < 13 � y = ytop - offset-r � y = ybottom + offset-r
	�0� GCOL piececol: CIRCLE FILL x,y,piecesize/2
	�B� IF piececol = white THEN GCOL black: CIRCLE  x,y,piecesize/2
	�� x,y: �plot_sprite(s$,8)
	� � piece = pieces � piece = 6
	�6� pieces >6 � �numberpile(pieces,x+r,y+r,piececol)
	��
	�a� GCOL black: RECTANGLE  bordersize,bordersize,boardsize-2*bordersize, boardsize-2*bordersize
	��draw_inner_rects
	��
	�
	���startpoint(point,� x,� y)
	�/� finds top left hand co-ordinates of point
:� point <13 � y = ytop � y = ybottom: point = 25-point

-x = boardsize-bordersize-point*pointwidth
� point > 6 � x-= barwidth
�
(
2��initpieces
<� point,pieces
F� testboard 24
P� point = 1 � 24
Z&� pieces: initboard?point = pieces
d� point
nE� 2,0,0,0,0,128+5,0,128+3,0,0,0,5,128+5,0,0,0,3,0,5,0,0,0,0,128+2
x� point = 1 � 24
�&� pieces: testboard?point = pieces
�� point
�E� 128+3,3,0,0,0,128+2,0,128+3,0,0,0,0,0,0,0,0,0,0,0,2,0,128+3,0,4
�barwhite=0:barblack=0
��
�
�!��numberpile(no,x,y,piececol)
�� nocol,xoff,yoff
�0yoff = 12: � no > 9 � xoff = -16 � xoff = -8
�6� piececol = black � nocol = white � nocol = black
�� 5: � nocol
�� x+xoff,y+yoff:�; no
�� 4
�

)� Mouse and sprite library procedures
")� ===================================
,
6/��drawtextbox(box(),text$,boxcol%,textcol%)
@'� Draws unfilled box colour boxcol%
J7� and centres text label printed in colour textcol%
T3� boxwidth%,boxheight%,textwidth%, textx, texty
^�5: � boxcol%
h3ȓ Ȑ box(1),box(2),box(3)-box(1),box(4)-box(2)
r8� black:ȓ box(1),box(2),box(3)-box(1),box(4)-box(2)
|!textwidth%=�(text$)*1280 � 80
�boxwidth% = box(3)-box(1)
� boxheight% = box(4) - box(2)
�-textx = box(1)+(boxwidth%-textwidth%) � 2
�+texty = box(2)+(boxheight%-16) � 2 + 16
�� textcol%
�� textx,texty
�� text$
��4
��
�
� ݤmouseinbox(box(),� button)
�?� Returns TRUE if mouse clicked inside box, otherwise FALSE
�3� Also returns variable holding value of button
� x,y,t
	*FX15
ȗ x,y,button
&� button �
0
�delay(1)
:/� delay to give user time to release button
DE� x>= box(1) � x <= box(3) � y >= box(2) � y <= box(4) � = � � =�
N�
X=�
b�
l
v!��plot_sprite(sprite$,action)
�� Plots sprite using mask
�7ș "OS_SpriteOp",256+28,spritearea,sprite$,,,action
��
�
���get_sprite(sprite$,box())
�#� box(1),box(2):� box(3),box(4)
�.ș "OS_SpriteOp",256+14,spritearea,sprite$
��
�
���grabbox(box(),sprite$)
�.� grabs the screen area defined by box and
�)� saves it as a sprite called sprite$
��get_sprite(sprite$,box())

�



��restorebox(box(),sprite$)

 8� restores screen area defined by box and previously

*� saved by PROCgrabbox

4� box(1),box(2)

>�plot_sprite(sprite$,0)

H�delay(20):*FX15

R�

\

f��graphicwindow(box())

p;� creates graphic window of the area specified by box()

z$�24,box(1);box(2);box(3);box(4);

��

�

�,� End of mouse/sprite library procedures

�,� ======================================

�

�
��dice

�� startset � startset = �:�

�I� whiteturn � �rolldice(whitethrowbox()) � �rolldice(blackthrowbox())

��

�

���rolldice(throwbox())

�*� x1,y1,x2,y2,toss,ntosses,a,d,p,count

�,�drawtextbox(dicepanel(),"",ivory,ivory)
ntosses=12:count =0
� REPEAT
� toss = 1 � ntosses
$dice1=�(6):dice2=�(6)
%
.� This is the cheating bit
/� ==== == === ======== ===
8&� IF col$="white" THEN dice2=dice1
9
Bx1 = throwbox(1)+20+�(180)
Ly1 = throwbox(2)+20+�(60)
Vx2 = x1+60+�(60)
`y2 = throwbox(2)+20+�(60)
j� x1,y1
t�plot_sprite(�dice1,0)
~� x2,y2
��plot_sprite(�dice2,0)
�count+=1
�� count=2 �
�count=0
�a=1:p=120+�(30):d=5+�(5)
�� 2,-a,p,d: �delay(5)
��
�1� toss < ntosses � �clearthrowbox(throwbox())
�
� toss
��switch_update_bank
�#� x1,y1: �plot_sprite(�dice1,0)
�#� x2,y2: �plot_sprite(�dice2,0)
�switch_update_bank

� UNTIL dice1=dice2
�setdice(dice1,dice2)
�
(
2��setdice(dice1,dice2)
<#� dice1 <dice2 � Ȕ dice1,dice2
F)� dice1 = dice2 � double=� � double=�
P)dice(1)=dice1:dice(2)=dice2:dice(0)=2
Zdiceavailable = 2
d0� IF double THEN dice(3)=dice1:dice(4)=dice1
n�
x
�&��rollstartdice(col$,dice1,� dice)
�� throwbox():� throwbox(4)
�L� col$="white" � throwbox()=whitethrowbox() � throwbox()=blackthrowbox()
�ntosses=8:count =0
�� toss = 1 � ntosses
�
dice=�(6)
�2� (col$="black" � dice=dice1 � toss=ntosses) �
��:dice=�(6):� dice<>dice1
��
�x1 = throwbox(1)+20+�(200)
�y1 = throwbox(2)+20+�(60)
�x2 = x1+60+�(80)
�y2 = throwbox(2)+20+�(60)
� x1,y1
�plot_sprite(�dice,0)
count+=1
"� count=2 �
,count=0
6a=1:p=120+�(30):d=5+�(5)
@� 2,-a,p,d: �delay(5)
J�
T1� toss < ntosses � �clearthrowbox(throwbox())
^� toss=ntosses �
h�switch_update_bank
r!� x1,y1:�plot_sprite(�dice,0)
|�switch_update_bank
��
�
� toss
��
�
���delay(t)
��=0:� � � > t
��
�
���clearthrowbox(throwbox())
�Z� green: ȓ Ȑ throwbox(1),throwbox(2),throwbox(3)-throwbox(1),throwbox(4)-throwbox(2)
��
�
���shadow_panel
� screen
� screen = 1 � 2
�switch_update_bank
&
�panel
0�switch_display_bank
:� screen
D�
N
X��panel
b
� midgrey
l0ȓ Ȑ boardsize+8,0,1240-boardsize,boardsize
v� 128+midgrey
�� white
�� �66,1);"W H I T E"
�"� �66,3) �centre(whiteplayer$)
�� �69,4);"�";whitemoney
�� �66,5);"Game score "
�� �70,6);whitegamescore
�� black
�� �66,10)"B L A C K"
�#� �66,12) �centre(blackplayer$)
�� �69,13) "�";blackmoney
�� �66,14);"Game score "
�� �70,15);blackgamescore
��movepanel
�drawpanels
�dicepanel
�
 
*ݤcentre(S$)
4� L%
>
L%=�S$
H$� L% <10 � S$=�(10-L%)�2," ")+S$
R=S$
\
f��dicepanel
p� dice,roll,xoff,i,n,s
z� double �
�xoff = 8:n=4
�� firstpair �
�+showdice(1)=dice(1):showdice(2)=dice(2)
�8showdice(3)=dice(1) � 128: showdice(4)=dice(2) � 128
��
�3showdice(1)=dice(1)+128:showdice(2)=dice(2)+128
�+showdice(3)=dice(1):showdice(4)=dice(2)
��
��
�+showdice(1)=dice(1):showdice(2)=dice(2)
�xoff = 40:n=2
��
�� 5
� dicerolled �
� dice = 1 � n
roll = showdice(dice)
$(� roll > 128 � � lightgrey � � black
./� dicepanel(1)+xoff+30*dice,dicepanel(2)+48
8�; roll � 128
B
� dice
L�
V,�drawtextbox(dicepanel(),"",ivory,ivory)
`�
j�4
t-� gameinprogress �shadow_box(dicepanel())
~�
�
���movepanel
�� text$
�� gameinprogress �
�9� whiteturn � text$="White Move" � text$="Black Move"
��
�text$="New Game"
��
�.�drawtextbox(movepanel(),text$,ivory,blue)
�/� gameinprogress � �shadow_box(movepanel())
��
�
��drawpanels

� panno,textcol,s
M� gameinprogress � paneltext$(4)="QUIT GAME" � paneltext$(4)="START GAME"
� panno = 1 � 4
(>� panelactive(panno) � textcol = red � textcol = lightgrey
2�panelcoords(panno,panel())
<9�drawtextbox(panel(),paneltext$(panno),white,textcol)
F� panno
P.� gameinprogress � �shadow_box(panelbox())
Z�
d
n��draw_double_panel
x
� s,d:d=2
�� s = 1 � 2
��switch_update_bank
��panelcoords(d,panel())
�7�drawtextbox(panel(),paneltext$(d),white,lightgrey)
��switch_display_bank
�� s
��
�
� ��panelcoords(panno,panel())
�� i
�� i = 1 � 4
�panel(i) = panels(i,panno)
�� i
�

��startgame
"� panno,x,y,button
,�
6panno = �getpanel
@� panno = 3 � �setoptions
J� panno = 4
T�choosestart
^+� whiteplayer$="HUMAN" � whiteopening=�
h+� blackplayer$="HUMAN" � blackopening=�
rgameinprogress=�
|�
�
���choosestart
� � dicew,diceb,message$,box()
�J� box(4):box()=cantbox():box(2)-=270:box(4)-=270:box(1)-=60:box(3)-=60
�#�rollstartdice("white",0,dice1)
�'�rollstartdice("black",dice1,dice2)
�whiteturn = (dice1>dice2)
�C� whiteturn � message$="WHITE STARTS" � message$="BLACK STARTS"
��grabbox(box(),"temp")
��displaybox(box(),message$)
��restorebox(box(),"temp")
�$�setdice(dice1,dice2):startset=�
��

ݤgetpanel
6� checks mouse presses in panel and returns number
&$� if active panel clicked else 0
09� panno, button,x,y, found,last: panno = 0: found = �
:&� gameinprogress � last=5 � last=4
D�
N
panno +=1
X� panno=5 �
bpanel()=gamebox()
l�
v�panelcoords(panno,panel())
��
�#� �mouseinbox(panel(),button) �
�3� panelactive(panno) � panno=5 � found = � � �7
��
�� found � panno = last
�� panno=5 � panno=1
�� found � = panno � = 0
�
���setoptions
�� moneyreset,ok
�moneyreset=�
��grabbox(optbox(),"temp")
��optionsbox
ok=�
�
panel()=optpanel()
 button=0
*� i = 1 � 4
4%� i>1 � panel(2)-=76:panel(4)-=76
>"� �mouseinbox(panel(),button)�
H
Ȏ i �
RS� 1: � whiteplayer$="COMPUTER" � whiteplayer$="HUMAN" � whiteplayer$="COMPUTER"
\0�drawtextbox(panel(),whiteplayer$,white,red)
fS� 2: � blackplayer$="COMPUTER" � blackplayer$="HUMAN" � blackplayer$="COMPUTER"
p0�drawtextbox(panel(),blackplayer$,white,red)
z&� 3: blackmoney=100:whitemoney=100
��� moneyreset � moneyreset=�:�drawtextbox(panel(),"RESET",white,red) � moneyreset=�:�drawtextbox(panel(),"RESET",white,lightgrey)
�E� 4: � evaldisplay$="ON" � evaldisplay$="OFF" � evaldisplay$="ON"
�0�drawtextbox(panel(),evaldisplay$,white,red)
��
��
�Eȗ ȓ optbox(1),optbox(2),optbox(3)-optbox(1),optbox(4)-optbox(2)
�� i
�V� �mouseinbox(quitpanel(),button) � sure=�surebox(""):� sure � �12:�("FX 200,0"):�
�*� �mouseinbox(okpanel(),button) � ok=�
�� ok
�button=0:*FX15
��
�ȗ x,y,button
� button
ȗ ȓ 0,0,1239,1203
�4
$ �restorebox(optbox(),"temp")
.�shadow_panel
8�
B
L��optionsbox
V� i,x,y,border:border=32
`�5
j"�showbox(optbox(),black,ivory)
tx=optbox(1)+2*border
~� black
�� i = 1 � 4
�y=optbox(4)-i*76
�� x,y:� opttext$(i)
�� i
�7�drawtextbox(quitpanel(),"QUIT PROGRAM",white,blue)
�0�drawtextbox(okpanel(),"OK",lightgrey,black)
�panel()=optpanel()
�� i = 1 � 4
�%� i>1 � panel(2)-=76:panel(4)-=76
�
Ȏ i �
�� 1: text$=whiteplayer$
�� 2: text$=blackplayer$
� 3: text$="RESET"

� 4: text$=evaldisplay$
�
)�drawtextbox(panel(),text$,white,red)
(� i
2�
<
F
P
��play
Z� x,y,button,screen
d*FX200,0
n� �
xI� � � gameinprogress=�:ȗ �:ȗ ȓ 0,0,1239,1023:�4,26:�("FX 200,1"):�
�>� whiteplayer$="COMPUTER" � blackplayer$="COMPUTER" � ȗ �
�ȕ gameinprogress
�� whiteturn �
�K� whiteplayer$ = "HUMAN" � �humanplay("white") � �computerplay("white")
�whiteturn = �
��
�K� blackplayer$ = "HUMAN" � �humanplay("black") � �computerplay("black")
�whiteturn = �
��
�� screen = 1 � 2
�C�clearthrowbox(whitethrowbox()):�clearthrowbox(blackthrowbox())
��switch_update_bank
�� screen
�showscore
N� gameinprogress � � (whiteplayer$="COMPUTER" � blackplayer$="COMPUTER") �
d� IF (whiteturn AND whiteplayer$="COMPUTER") OR (NOT whiteturn AND blackplayer$="COMPUTER") THEN
"� button=0:*FX15
,*� REPEAT:MOUSE x,y,button:UNTIL button
6� ENDIF
@�
JJ� allpast � � allpast_weight � �allpast_weightings: allpast_weight = �
T�
^ȗ �
h*FX200,0
r�
|
�
ݤallpast
�A� returns TRUE when pieces of each colour are past each other
� � and no hitting is possible
�3� point,present,allpast,found,maxblack,minwhite
�� barwhite � barblack � =�
�point=0:found=�
�ȕ � found
�point+=1
�@� board?point < 128 � board?point>0 � minwhite=point:found=�
��
�point=25:found=�
�ȕ � found
�point-=1
0� board?point > 128 � maxblack=point:found=�
�
allpast=(minwhite>maxblack)
&=allpast
0
:��showscore
D� text$,x,y,button,screen
N� evaldisplay$="ON" �
X-� whiteturn � col$="black" � col$="white"
b^current_score=�evaluateboard(col$,board,whitepieces,blackpieces,barwhite,barblack,winner$)
l!text$=col$+" "+�current_score
v� screen = 1 � 2
�/�drawtextbox(dicepanel(),text$,ivory,black)
��switch_update_bank
�� screen
��
��
��
�
�
���computerplay(col$)
�� move,moveover,p,s
�
Ȏ col$ �
�� "white":whitebearing=�
�� "black":blackbearing=�
�
� SYS "Hourglass_On"
� p = 1 � 4
 panelactive(p)=�
*� p
4�movepanel:�drawpanels
>moveover=�
H1�computer_offer(col$): � � gameinprogress � �
Rȗ �
\.�dice: dicerolled=�:firstpair=�:�dicepanel
f5� �opening_move(col$) � �find_opening_moves(col$)
p*� double � firstpair=�:diceavailable=2
z�
�!� �legalmoveavailable(col$) �
�$� � allpast � allpast = �allpast
�$move = �choosecomputermove(col$)
�#startpoint = legalmoves(1,move)
�!endpoint = legalmoves(2,move)
�!diceused = legalmoves(3,move)
� barmove = legalmoves(4,move)
� bearing = legalmoves(5,move)
�dice(diceused) +=128
�diceavailable -= 1
�-�computerdrag(col$,startpoint,endpoint,�)
�*�executemove(col$,startpoint,endpoint)
��dicepanel
�
ȗ �:�cantmove(col$,"")
moveover=�
$�
.� diceavailable=0 �
8� double �
B� firstpair �
L9diceavailable=2:firstpair=�:dice(1)-=128:dice(2)-=128
V�
`moveover=�
j�
t�
~moveover=�
��
��
�!� � gameinprogress � moveover
�dicerolled=�:�dicepanel
�� �opening_move(col$) �
�4� col$="white" � whiteopening=� � blackopening=�
��
�5� REPEAT UNTIL GET:REM **************************
��
�
�ݤopening_move(col$)
�
Ȏ col$ �
� "white": = whiteopening

� "black": = blackopening
�

(��humanplay(col$)
2ȗ �
<4�x,y,button,startpoint,endpoint,legal,moveover,s
F
Ȏ col$ �
P� "white":whitebearing=�
Z� "black":blackbearing=�
d�
n� SYS "Hourglass_On"
xmoveover=�
�,� pressed, panno: pressed = �: panno = 0
�panelactive(1) = �
�E� doubleturn$ ="either" � doubleturn$ = col$ � panelactive(2) = �
�panelactive(3) = �
�panelactive(4) = �
��movepanel:�drawpanels
�%� look for mouse presses in panel
�� SYS "Hourglass_Off"
�� � startset �
��
�panno = �getpanel
�$� panno = 2 � �offerdouble(col$)
�� panno = 4 �
5� �surebox("") � gameinprogress=�:gamecompleted=�
ȗ ȓ 0,0,1239,1023
�
""� � gameinprogress � panno = 1
,�
6� � gameinprogress � �
@Bpanelactive(1)=�:panelactive(2)=�:panelactive(4)=�:�drawpanels
J.� game may be over due to refused offer so
T� gameinprogress �
^-�dice:dicerolled=�:firstpair=�:�dicepanel
h*� double � firstpair=�:diceavailable=2
r�
|!� �legalmoveavailable(col$) �
�$� � allpast � allpast = �allpast
��
�startpoint=0:endpoint=0
�	*FX15
�ȗ x,y,button
�)� button � startpoint = �pointxy(x,y)
�$� �legalstart(startpoint,col$) �
�endpoint =�drag(col$,x,y)
�/legal= �legalmove(col$,startpoint,endpoint)
��
�legal=�
��
�� legal
 *�executemove(col$,startpoint,endpoint)
 �dicepanel
 �
 &�cantmove(col$,"")
 0moveover=�
 :�
 D� diceavailable=0 �
 N� double �
 X� firstpair �
 b9diceavailable=2:firstpair=�:dice(1)-=128:dice(2)-=128
 l�
 vmoveover=�
 ��
 ��
 �moveover=�
 ��
 ��
 �!� � gameinprogress � moveover
 ��
 �dicerolled=�:�dicepanel
 ��
 �
 �ݤshowcol(col$)
 �(� col$="white" � ="WHITE" � ="BLACK"
 �
!��offerdouble(col$)
!+� oppcol$,offset,tempbox():� tempbox(4)
!!tempbox()=surebox():offset=60
! Isurebox(2)-=240:surebox(4)-=240:surebox(1)-=offset:surebox(3)-=offset
!*6� col$="white" � oppcol$="black" � oppcol$="white"
!4!� �surebox("OFFER DOUBLE?") �
!>� �computercol(oppcol$) �
!H%doubled=�double_accepted(oppcol$)
!R�
!\(doubled = �surebox("ACCEPT DOUBLE?")
!f�
!p� doubled �
!z�accept_double(oppcol$)
!��
!�double_refused=�
!��winner(col$)
!��
!��
!�surebox()=tempbox()
!��
!�
!���computer_offer(col$)
!�ȗ �
!�5� � (doubleturn$=col$ � doubleturn$="either") � �
!�+� oppcol$,offset,tempbox():� tempbox(4)
!�!tempbox()=surebox():offset=60
"Isurebox(2)-=240:surebox(4)-=240:surebox(1)-=offset:surebox(3)-=offset
"6� col$="white" � oppcol$="black" � oppcol$="white"
",� current_score < 8 - double_threshold �
"$� offer double
".� �computercol(oppcol$) �
"82�cantmove(col$,"  "+�showcol(col$)+" DOUBLES")
"B'doubled = �double_accepted(oppcol$)
"L�
"V(doubled = �surebox("ACCEPT DOUBLE?")
"`�
"j� doubled �
"t�accept_double(oppcol$)
"~�
"�double_refused=�
"��winner(col$)
"��
"��
"�surebox()=tempbox()
"��
"�
"�ݤcomputercol(col$)
"�X=(col$="white" � whiteplayer$="COMPUTER") � (col$="black" � blackplayer$="COMPUTER")
"�
"�ݤdouble_accepted(col$)
"�#� threshold,ownpieces,opppieces
#x� col$="white" � ownpieces = whitepieces: opppieces = blackpieces � ownpieces = blackpieces: opppieces = whitepieces
#
$threshold = -double_threshold -8
#� allpast � threshold = -16
#$� opppieces < 10 � threshold = 0
#(!� current_score < threshold �
#2double_refused=�
#<2�cantmove(col$,"  "+�showcol(col$)+" REFUSES")
#F=�
#P�
#Z=�
#d�
#n
#x��accept_double(col$)
#�ș "Hourglass_On"
#�B� doublecube = 64 � doublecube = 2 � doublecube = 2*doublecube
#�@� doublecube = 64 � doubleturn$="neither" � doubleturn$=col$
#�panelactive(2)=�:doubled=�
#�I� �computercol(col$) � �cantmove(col$,"  "+�showcol(col$)+" ACCEPTS")
#��shadow_drawbar
#��draw_double_panel
#�ș "Hourglass_Off"
#��
#�
#�ݤlegalstart(point,col$)
#�� legal,bar
#�� point = 0 � = �
$� check for pieces on bar
$� �piecesonbar(col$) �
$� point = 99 � =� � = �
$"�
$,N� Otherwise point is "legal" if pieces of correct colour are present on it
$6legal=�
$@
Ȏ col$ �
$J;� "white": � board?point >0 � board?point<128 � legal=�
$T-� "black": � board?point >128 � legal = �
$^�
$h
=legal
$r
$|ݤpiecesonbar(col$)
$�� bar:bar=�
$�
Ȏ col$ �
$�� "white":
$�� barwhite >0 �
$�	bar=�
$��
$�� "black":
$�� barblack >0 �
$�	bar=�
$��
$��
$�=bar
$�
%
%ݤpointxy(x,y)
%?� returns point number corresponding to screen co-ordinates
%&&� or 99 for click on bar or else 0
%04� barleft,topboard,bottomboard,point,xp,yp,found
%:$barleft = (boardsize-barwidth)/2
%D.� x > barleft � x < barleft+barwidth � =99
%NX� y > boardsize-bordersize-pointheight � x < boardsize � topboard = � � topboard = �
%XP� y  < bordersize+pointheight � x < boardsize � bottomboard = � � bottom = �
%b%� � (topboard � bottomboard) � =0
%l
found = �
%v'� topboard � point = 0 � point = 12
%�ȕ � found � point <24
%�point+=1
%��startpoint(point,xp,yp)
%�+� x> xp � x < xp+pointwidth � found = �
%��
%�E� (topboard � point>12) � (bottomboard � point>24) � =0 � = point
%�
%�ݤdrag(col$,startx,starty)
%�6� allows player to drag circle from starting point
%�>� returns point number of position where mouse is released
%� � x,y,button,r:r=piecesize/2
%�	� 3,1
%�ȗ x,y,button
&!� button � ȏ startx,starty,r
&
ȕ button
&
ȗ � 2
& 	*FX15
&*ȗ x,y,button
&4ȏ startx,starty,r
&>� button �
&Hȏ x,y,r
&Rstartx=x:starty=y
&\�
&f�
&p
ȗ � 1
&z8� startx>boardsize � =111 � =�pointxy(startx,starty)
&�#� 111 code for bearing off move
&�
&�4��computerdrag(col$,startpoint,endpoint,hitmove)
&��� startx,starty,endx,endy,npstart,npend,offset,xstep,ystep,x,y,steps,step,r,oldx1,oldy1,oldx2,oldy2,box(),oppcol$,sprite$,oldsprite1$,oldsprite2$,k,i
&�� 24,0;0;1024;1023;
&�k=20
&�6� col$="white" � oppcol$="black" � oppcol$="white"
&�� box(4)
&�&� PROCget_sprite("temp",gamebox())
&�r=piecesize/2
&�� startpoint = 99 �
&�<� col$="white" � npstart = barwhite � npstart = barblack
&��
'$npstart = board?startpoint � 128
'�
'� hitmove �
'$8� col$="white" � npend = barwhite � npend = barblack
'.�
'8 npend = board?endpoint � 128
'B�
'L� npstart>6 � npstart=6
'V� npend <6 � npend +=1
'`� npend>6 � npend=6
'jC� npend = 2 � �pointstate(endpoint) = ("one"+oppcol$) � npend=1
't:�findpiecepoint(col$,npstart,startpoint,startx,starty)
'~2�findpiecepoint(col$,npend,endpoint,endx,endy)
'�8steps = �(36*�distance(startx,starty,endx,endy)/480)
'�xstep=(endx-startx)/steps
'�ystep=(endy-starty)/steps
'�� � hitmove �
'�� startpoint <99 �
'�'board?startpoint=board?startpoint-1
'�/� board?startpoint=128 � board?startpoint=0
'��
'�
Ȏ col$ �
'�� "white": barwhite -=1
'�� "black": barblack -=1
'��
(�
(
�
(� GCOL 3,1
(� CIRCLE startx,starty,r
((startx-=r:starty-=r
(2
*FX 112,1
(<
*FX 113,1
(F update_bank=1:display_bank=1
(P� startpoint = 99 �
(Z�shadow_drawbar
(d�
(n#�shadow_drawpoint(startpoint,�)
(x�
(�&�grabarea("temp1",startx,starty,k)
(�� startx,starty
(�� � hitmove �
(��plot_sprite(col$,8)
(�3� i = 1 � 8:�switch_display_bank:�delay(10):� i
(��
(�oldx1=startx:oldy1=starty
(��switch_update_bank
(�&�grabarea("temp2",startx,starty,k)
(�� startx,starty
(�&� � hitmove � �plot_sprite(col$,8)
(�oldx2=startx:oldy2=starty
(��switch_update_bank
)+oldsprite1$="temp1":oldsprite2$="temp2"
)�switch_display_bank
)�
)"� step = 1 � steps + 1
),� update_bank=1 �
)6sprite$=oldsprite1$
)@� oldx1-k,oldy1-k
)J�
)Tsprite$=oldsprite2$
)^� oldx2-k,oldy2-k
)h�
)r�plot_sprite(sprite$,0)
)|� step < steps + 1 �
)�startx+=xstep:starty+=ystep
)��
)�� update_bank = 1 �
)� oldx1=startx: oldy1 = starty
)��
)� oldx2=startx: oldy2 = starty
)��
)�sprite$=�update_sprite
)�&�grabarea(sprite$,startx,starty,k)
)�A� update_bank = 1 � oldsprite1$=sprite$ � oldsprite2$=sprite$
)�� startx,starty
)��plot_sprite(col$,8)
)��switch_display_bank
*�switch_update_bank
*� PROCdelay(1)
*
� step
*&�switch_display_bank
*0�
*:� 26
*D�
*N
*Xݤdistance(x1,y1,x2,y2)
*b=�((x1-x2)^2+(y1-y2)^2)
*l
*v��grabarea(sprite$,x,y,k)
*�0� x-k,y-k:� x+piecesize+k,starty+piecesize+k
*�.ș "OS_SpriteOp",256+14,spritearea,sprite$
*��
*�
*�
*�ݤupdate_sprite
*�="temp"+�update_bank
*�
*�.��findpiecepoint(col$,piece,point,� x,� y)
*�� offset
*�� point = 111 �
*�x = boardsize + 64
*�y = boardsize/2
+�
+�
+� point = 99 �
+ "offset = (piece-0.5)*piecesize
+*
Ȏ col$ �
+4� "white":
+>�startpoint(7,x,y)
+Hy =ytop-offset
+R
� "black"
+\�startpoint(18,x,y)
+fy = ybottom + offset
+p�
+zx+=pointwidth+barwidth/2
+��
+��startpoint(point,x,y)
+�x+= pointwidth/2
+�#offset = (piece-0.50)*piecesize
+�6� point < 13 � y = ytop-offset � y =ybottom+offset
+��
+��
+�
+�ݤlegalmoveavailable(col$)
+�<� Called at start of move to check that move can be made
+�B� also creates list of legal moves for use by computer version
+�'� dice,roll,from,to,using,dest,code
+�nlegal=0: bearingpossible=�
,:� �opening_move(col$) � � �set_opening_move(col$) � =�
,� check barmove
,4� �piecesonbar(col$) � barmove = � � barmove = �
,$� barmove �
,.� dice = 1 � dice(0)
,8roll=dice(dice)
,B� roll < 128 �
,LA� �destinationOK(99,roll,col$,dest) � �addlegal(99,dest,dice)
,V�
,`
� dice
,j�
,t� from = 1 � 24
,~code = board?from
,�F� (col$="white" � code>0 � code<128) � (col$="black" � code>128) �
,�� dice = 1 � dice(0)
,�roll=dice(dice)
,�� roll < 128 �
,�E� �destinationOK(from,roll,col$,dest) � �addlegal(from,dest,dice)
,��
,�
� dice
,��
,�
� from
,��
,�� PRINT TAB(0,0);nlegal
,�=nlegal
-
-
ݤset_opening_move(col$)
-;� returns TRUE if destination point clear of opposition
-4� so that computer can usually make set moves if
-(� the second to move
-2� ok,oppcol$,from,to
-<ok=�
-F6� col$="white" � oppcol$="black" � oppcol$="white"
-P%bearing=�:barmove=�:movefrombar=�
-Z"dice = dice(0)+1-diceavailable
-d@� diceavailable=2 � ok=�project_opening_move(col$,2,from,to)
-n� � ok � =�notok(col$)
-x/ok=�project_opening_move(col$,dice,from,to)
-�� � ok � =�notok(col$)
-��addlegal(from,to,dice)
-�=�
-�
-�ݤnotok(col$)
-�
Ȏ col$ �
-�� "white":whiteopening=�
-�� "black":blackopening=�
-��
-�nlegal=0
-�0� PRINT TAB(0,0);col$;" ";diceavailable,dice
-�=�
-�
.1ݤproject_opening_move(col$,dice,� from,� to)
.� ok,oppcol$,d
..� double � � firstpair � d=dice+2 � d=dice
."from = openings(d)
.,<� col$="white" � to=from+dice(dice) � to=from-dice(dice)
.66� col$="white" � oppcol$="black" � oppcol$="white"
.@4� �pointpieces(oppcol$,to,board)=0 � ok=� � ok=�
.J=ok
.T
.^��cantmove(col$,message$)
.h�7
.r�grabbox(cantbox(),"temp")
.|�cantbox(col$,message$)
.�!�restorebox(cantbox(),"temp")
.�dicerolled=�:�dicepanel
.��
.�
.�
.���addlegal(from,to,using)
.�
nlegal+=1
.�legalmoves(1,nlegal) = from
.�X� bearing � bearingpossible=�:legalmoves(2,nlegal) = 111 � legalmoves(2,nlegal) = to
.� legalmoves(3,nlegal) = using
.�"legalmoves(4,nlegal) = barmove
.�"legalmoves(5,nlegal) = bearing
.��
/
/0ݤdestinationOK(startpoint,roll,col$,� dest)
/#� state$,diff,legal,d,dicefound
/&legal=�
/0� check for moving off bar
/:� startpoint = 99 �
/Dmovefrombar=�
/N
Ȏ col$ �
/X� "white": startpoint=0
/b� "black": startpoint=25
/l�
/v�
/�movefrombar=�
/��
/�$� check for destination on board
/�C� col$ ="white" � dest = startpoint+roll � dest=startpoint-roll
/�� dest <1 � dest > 24 �
/�$� PRINT TAB(0,0);startpoint,dest
/�1bearing = �bearingcheck(startpoint,dest,col$)
/�� bearing � = � � = �
/��
/�
bearing=�
/��
/�$� check for state of destination
/�state$ = �pointstate(dest)
0O� (state$="onewhite" � col$="black") � (state$="oneblack" � col$="white") �
0barmove=�:=�
0�
0 
barmove=�
0*�
04;� state$ ="empty" � state$=col$ � �state$,5)=col$ � = �
0>=�
0H
0R#ݤbearingcheck(start,dest,col$)
0\&� possible,point,maxpoint,minpoint
0f=� (col$="white" � dest<0) � (col$="black" � dest>24) � =�
0p#� � �bearingpossible(col$) � =�
0zpossible=�
0�
Ȏ col$ �
0�� "black":
0�� dest=0 �
0�possible =�: � exact number
0��
0�maxpoint=0
0�� point=1 � 6
0�7� board?point>128 � point>maxpoint � maxpoint=point
0�� point
0�8� maxpoint <�mindice � maxpoint = start � possible=�
0��
0�� "white":
0�� dest=25 �
1possible=�
1�
1minpoint=25
1$� point=18 � 24
1.G� board?point>0 � board?point<128 � point<minpoint � minpoint=point
18� point
1B=� (25-minpoint) <�mindice � minpoint = start � possible=�
1L�
1V�
1`
=possible
1j
1t
ݤmindice
1~/� returns number of smallest dice available
1�� dice,roll,min
1�	min=6
1�� dice = 1 � dice(0)
1�roll=dice(dice)
1�� roll <128 �
1�� roll<min � min=roll
1��
1�
� dice
1�=min
1�
1�ݤbearingpossible(col$)
1�1� Checks whether all pieces within home board
2"� point,possible: possible = �
2

Ȏ col$ �
2� "white":
2� barwhite >0 �
2(possible=�
22�
2<point=0
2F�
2Ppoint+=1
2Z2� board?point>0 � board?point<128 � possible=�
2d� point=18 � � possible
2n�
2x� "black":
2�� barblack>0 �
2�possible=�
2��
2�point=6
2��
2�point+=1
2�#� board?point>128 � possible =�
2�� point=24 � � possible
2��
2��
2�
=possible
2�
2�)ݤlegalmove(col$,startpoint,endpoint)
3#� state$,diff,legal,d,dicefound
3legal=0:dicefound=0
3�
3"legal+=1
3,G� legalmoves(1,legal)=startpoint � legalmoves(2,legal) = endpoint �
36_dicefound = legalmoves(3,legal): barmove = legalmoves(4,legal): bearing=legalmoves(5,legal)
3@�
3J � dicefound � legal = nlegal
3T� dicefound �
3^dice(dicefound) +=128
3hdiceavailable -= 1
3r�
3|= dicefound
3�
3�ݤpointstate(point)
3�%� board?point � 128 =0 � ="empty"
3�"� board?point =1 � ="onewhite"
3�$� board?point =129 � ="oneblack"
3� � board?point>128 � ="black"
3�="white"
3�
3�!��executemove(col$,start,end)
3�� screen,oppcol$
3�6� col$="white" � oppcol$="black" � oppcol$="white"
3�+� bearing � �bearoffpiece(col$,start):�
3�*� movefrombar � � �computercol(col$) �
4
Ȏ col$ �
4� "white": barwhite -=1
4� "black": barblack -=1
4&�
40�shadow_drawbar
4:�
4D� � �computercol(col$) �
4Nboard?start=board?start-1
4X%� board?start=128 � board?start=0
4b�
4l�
4v� � barmove �
4�0� col$="black" � board?end=0 � board?end=128
4�board?end=board?end+1
4��
4�board?end=1
4�%� col$="black" � board?end += 128
4��
4�� screen = 1 � 2
4��switch_update_bank
4��drawpoint(start)
4��drawpoint(end)
4��switch_display_bank
4�� screen
4�� barmove �
5� 1,-10,70,5
5#�computerdrag(oppcol$,end,99,�)
5
Ȏ col$ �
5 '� "white": barblack+=1: board?end=1
5*)� "black": barwhite+=1: board?end=129
54�
5>�shadow_drawbar
5H�
5R2� IF movefrombar THEN PROCshadow_box(barbox())
5\�
5f
5p��cantbox(col$,message$)
5z� message$="" �
5�9� col$="white" � message$ ="WHITE" � message$="BLACK"
5�message$+=" CANNOT MOVE"
5��
5�ș "Hourglass_Smash"
5�#�displaybox(cantbox(),message$)
5��
5�
5�$��displaybox(cantbox(),message$)
5�� x,y,button,xm,ym
5�#�showbox(cantbox(),black,ivory)
5�button=0:*FX15
5�xm = cantbox(1)+128
5�ym = cantbox(2)+240
6
� blue
6� 5
6� xm,ym: � message$
6$	� red
6.8� cantbox(1)+128,cantbox(2)+100:� "Press any button"
68�
6Bȗ x,y,button
6L� button
6V� 4
6`ȗ ȓ 0,0,1239,1023
6j�
6t
6~%��showbox(box(),bordercol,boxcol)
6�� border:border=32
6�� bordercol
6�3ȓ Ȑ box(1),box(2),box(3)-box(1),box(4)-box(2)
6�� boxcol
6�Sȓ Ȑ box(1)+border,box(2)+border,box(3)-box(1)-2*border,box(4)-box(2)-2*border
6�3ȗ ȓ box(1),box(2),box(3)-box(1),box(4)-box(2)
6��
6�
6���windisplay(m1$,m2$,m3$)
6�(� border,x,y,ystep,centresize,button
6�1border=32:centresize=(optbox(3)-optbox(1))�16
6��grabbox(optbox(),"temp")
7"�showbox(optbox(),black,white)
7
�5
7ystep=3*border
7$x=optbox(1): y = optbox(4)-ystep
7(� black
72$� x,y:� �centrel(m1$,centresize)
7<y-=ystep: � red
7F$� x,y:� �centrel(m2$,centresize)
7Py-=ystep:� blue
7Z$� x,y:� �centrel(m3$,centresize)
7dy-=ystep: � black
7n3� x,y:� �centrel("Press any button",centresize)
7x�4
7�	*FX15
7��:ȗx,y,button:� button
7� �restorebox(optbox(),"temp")
7�ȗ ȓ 0,0,1239,1023
7��
7�
7�ݤcentrel(text$,space)
7�5� adds blanks to left of text$ to centre in space
7�	� l,a
7�l=�(text$):a=(space-l) � 2
7�=�a," ")+text$
7�
7�ݤsurebox(message$)
86� yespanel(),nopanel(),border,button,sure,decision
8
border=32
8� yespanel(4),nopanel(4)
8"oyespanel(1)=surebox(1)+70:yespanel(2)=surebox(2)+100:yespanel(3)=yespanel(1)+100:yespanel(4)=yespanel(2)+80
8,8nopanel()=yespanel():nopanel(1)+=130:nopanel(3)+=130
86�grabbox(surebox(),"temp2")
8@%�showbox(surebox(),midgrey,white)
8J,�drawtextbox(yespanel(),"YES",ivory,red)
8T*�drawtextbox(nopanel(),"NO",ivory,red)
8^
� blue:�7
8h�5
8r,� message$="" � message$="ARE YOU SURE?"
8|,� surebox(1)+80,surebox(4)-80:� message$
8�button=0:decision=�
8��
8�8� �mouseinbox(yespanel(),button) � sure=�:decision=�
8�7� �mouseinbox(nopanel(),button) � sure=�:decision=�
8�� decision
8�"�restorebox(surebox(),"temp2")
8��4:ȗ ȓ 0,0,1239,1023
8�	=sure
8�
8�
8���bearoffpiece(col$,start)
8�� winner$,s: winner$=""
8�
Ȏ col$ �
9� "white":
9� white
9whitebearing=�
9&whitegamescore +=1
90whitepieces -=1
9:%� whitepieces = 0 � winner$ =col$
9D� s = 1 � 2
9N� �70,6);whitegamescore
9X�switch_update_bank
9b� s
9l� "black":
9v� black
9�blackbearing=�
9�blackgamescore +=1
9�blackpieces -=1
9�&� blackpieces = 0 � winner$ = col$
9�� s = 1 � 2
9�� �70,15);blackgamescore
9��switch_update_bank
9�� s
9��
9�� � �computercol(col$) �
9�board?start=board?start-1
9�%� board?start=128 � board?start=0
9��shadow_drawpoint(start,�)
:�
::� When computer is bearing off, start point is redrawn
:� by PROCcomputerdrag
: $� winner$ >"" � �winner(winner$)
:*�
:4
:>��winner(col$)
:HA� message1$,message2$,message3$,winnings,bonus,winner$,loser$
:RS� doublecube = 64 � doubleturn$="either" � winnings = 1 � winnings = doublecube
:\bonus=�winbonus(col$,board)
:fwinnings = winnings*bonus
:pT� col$="white" � winner$="WHITE":loser$="BLACK" � winner$="BLACK":loser$="WHITE"
:zmessage1$=winner$+" WINS!"
:�Ȏ bonus �
:�$� 1: message2$="STANDARD PAYOUT"
:�(� 2: message2$=loser$+" IS GAMMONED"
:�,� 3: message2$=loser$+" IS BACKGAMMONED"
:��
:�(message3$=loser$+" PAYS �"+�winnings
:�.�windisplay(message1$,message2$,message3$)
:�j� col$="white" � whitemoney+=winnings:blackmoney-=winnings � blackmoney+=winnings:whitemoney-=winnings
:�8� whitemoney < 0 � blackmoney <0 � �bankrupt(loser$)
:�gameinprogress=�
:��
:�
:���bankrupt(loser$)
;� message$
;�delay(30):*FX15
;#message$=loser$+" IS BANKRUPT!"
;$�grabbox(cantbox(),"temp")
;.#�displaybox(cantbox(),message$)
;8!�restorebox(cantbox(),"temp")
;Bȗ ȓ 0,0,1239,1023
;L!whitemoney=100:blackmoney=100
;V�
;`
;jݤwinbonus(col$,board)
;t� double_refused � =1
;~9� Returns 2 for gammon, 3 for backgammon, otherwise 1
;�� bonus,point
;�
Ȏ col$ �
;�
� "white"
;�� blackpieces < 15 �
;�bonus=1
;��
;�bonus=2
;�� point = 19 � 24
;�1� �pointpieces("black",point,board) � bonus=3
;�� point
;��
;�
� "black"
<� whitepieces <15 �
<
bonus =1
<�
<bonus=2
<(� point = 1 � 6
<21� �pointpieces("white",point,board) � bonus=3
<<� point
<F�
<P�
<Z
=bonus
<d
<n� Computer strategy
<x� =================
<�
<�ݤchoosecomputermove(col$)
<�� legal,value,max,nmax,move
<�� nlegal=1 � =1
<�>� � bearingpossible � (allpast � �opponentbearing(col$)) �
<�=�mostdistantmove(col$)
<��
<�� bearingpossible �
<�4� �nohomeblots(col$) � =�choosebearingmove(col$)
<��
<�� move>0 � =move
<�9� Evaluate possible moves and keep list of those with
<�4� equal maximum score. Then choose one at random
=max = �evaluatemove(1,col$)
=%nmax = 1: bestmoves(1) = 1:move=1
=#� PRINT TAB(0,1);"            "
="@� PRINT TAB(0,1);col$;" ";1;" ";legalmoves(1,1);" ";max;"  "
=,� legal = 2 � nlegal
=6#value=�evaluatemove(legal,col$)
=@1� FOR i=1 TO 24:bestboard?i = newboard?i:NEXT
=J� value > max �
=T2max=value:nmax=1:bestmoves(1)=legal:move=legal
=^�
=h� value = max �
=r$nmax+=1: bestmoves(nmax) = legal
=|�
=��
=�'� PRINT TAB(0,legal);"            "
=�N� PRINT TAB(0,legal);col$;" ";legal;" ";legalmoves(1,legal);" ";value;"  "
=�� legal
=�'� PRINT TAB(0,legal);"            "
=� � PRINT TAB(0,legal)nmax,max
=�I� IF nmax = 1 THEN move =bestmoves(1) ELSE move =bestmoves(RND(nmax))
=�� PRINT TAB(0,0);SPC50;
=�U� PRINT TAB(0,0);"colour ";col$;" nlegal ";nlegal;" bestmove ";move;" value ";max
=�	=move
=�
=�ݤplayerbearing(col$)
=�E= ((col$="white" � whitebearing) � (col$="black" � blackbearing))
>
>ݤopponentbearing(col$)
>K� (col$="white" � blackpieces<7) � (col$="black" � whitepieces<7) � = �
>&B=(col$="white" � blackbearing) � (col$="black" � whitebearing)
>0
>:ݤmostdistantmove(col$)
>D8� returns legal move of piece most distant from home
>N � move,best,furthest,current
>X(best = 1: furthest = legalmoves(1,1)
>b� move = 2 � nlegal
>l current = legalmoves(1,move)
>v
Ȏ col$ �
>�B� "white": � current < furthest � current = furthest:best=move
>�B� "black": � current > furthest � current = furthest:best=move
>��
>�
� move
>�	=best
>�
>�ݤnohomeblots(col$)
>�A� returns TRUE if no blots in home board that can be attacked
>�'� start,end,point,blotscore,present
>�@� (col$="white" � barblack) � (col$="black" � barwhite) � =�
>�blotscore=0
>�4� col$="white" � start=19:end=24 � start=1:end=6
>�� point=start � end
?,present = �pointpieces(col$,point,board)
?X� present=1 � blotscore -= �blotscore(col$,point,col$,barwhite,barblack,board,1,0,0)
?� point
? /� PRINT TAB(0,0);"     ";TAB(0,0);blotscore
?*=(blotscore=0)
?4
?>ݤchoosebearingmove(col$)
?HE� chooses bearing move that is furthest from the end of the board
?R%� move,from,bestmove,bestmovefrom
?\bestmove=0
?f� move = 1 � nlegal
?p� legalmoves(5,move) �
?zfrom = legalmoves(1,move)
?�� bestmove=0 �
?�#bestmove=move:bestmovefrom=from
?��
?�
Ȏ col$ �
?�K� "white":� from<bestmovefrom � bestmove=move:bestmovefrom=bestmovefrom
?�K� "black":� from>bestmovefrom � bestmove=move:bestmovefrom=bestmovefrom
?��
?��
?��
?�
� move
?�-� PRINT TAB(0,1);"    ";TAB(0,1);bestmove
?�
=bestmove
?�
@ݤevaluatemove(move,col$)
@�projectmove(move,col$)
@c=�evaluateboard(col$,newboard,newwhitepieces,newblackpieces,newbarwhite,newbarblack,newwinner$)
@$
@.��projectmove(move,col$)
@8� point
@B5� point=1 � 24:newboard?point=board?point:� point
@Lstart = legalmoves(1,move)
@Vend = legalmoves(2,move)
@`!diceused = legalmoves(3,move)
@j barmove = legalmoves(4,move)
@t bearing = legalmoves(5,move)
@~movefrombar = (start=99)
@� newwhitepieces = whitepieces
@� newblackpieces = blackpieces
@�newbarwhite = barwhite
@�newbarblack = barblack
@�newwinner$=""
@�-� bearing � �projectbearing(col$,start):�
@�� movefrombar �
@�
Ȏ col$ �
@�� "white": newbarwhite -=1
@�� "black": newbarblack -=1
@��
@��
A#newboard?start=newboard?start-1
A
+� newboard?start=128 � newboard?start=0
A�
A� barmove �
A(
Ȏ col$ �
A2.� "white": newbarblack +=1: newboard?end=1
A<0� "black": newbarwhite +=1: newboard?end=129
AF�
AP�
AZ6� col$="black" � newboard?end=0 � newboard?end=128
Adnewboard?end=newboard?end+1
An�
Ax�
A�
A� ��projectbearing(col$,start)
A�newwinner$=""
A�
Ȏ col$ �
A�� "white":
A�� white
A�newwhitepieces -=1
A�+� newwhitepieces = 0 � newwinner$ =col$
A�� "black":
A�� black
A�newblackpieces -=1
A�,� newblackpieces = 0 � newwinner$ = col$
A��
B#newboard?start=newboard?start-1
B+� newboard?start=128 � newboard?start=0
B�
B"
B,Nݤevaluateboard(col$,board,whitepieces,blackpieces,barwhite,barblack,win$)
B6� col$ = win$ � =playerwins
B@,� score,wp,bp,whc,woc,bhc,boc: score = 0
BJ-�count_board(board,wp,bp,whc,woc,bhc,boc)
BT
Ȏ col$ �
B^� "white":
Bh�score = �boardscore("white",board,col$,barwhite,barblack,wp,whc,woc,bhc,boc,whiteblots)-�boardscore("black",board,col$,barwhite,barblack,bp,bhc,boc,whc,woc,blackblots)
Br score += barwhite*pieceonbar
B| score -= barblack*pieceonbar
B�+score += (15-whitepieces)*pieceoffboard
B�+score -= (15-blackpieces)*pieceoffboard
B�
� "black"
B��score = �boardscore("black",board,col$,barwhite,barblack,bp,bhc,boc,whc,woc,blackblots)-�boardscore("white",board,col$,barwhite,barblack,wp,whc,woc,bhc,boc,whiteblots)
B� score -= barwhite*pieceonbar
B� score += barblack*pieceonbar
B�+score -= (15-whitepieces)*pieceoffboard
B�+score += (15-blackpieces)*pieceoffboard
B�0� VDU7:PRINT TAB(0,1);"     ";TAB(0,1);score
B�� REPEAT UNTIL GET
B��
B�
=score
B�
C`��count_board(board,� whitepoints,� blackpoints,� white_hc,� white_oc,� black_hc,� black_oc)
C%� point,whitepresent,blackpresent
CKwhitepoints=0:blackpoints=0:white_hc=0:white_oc=0:black_hc=0:black_oc=0
C&� point = 1 � 24
C04whitepresent = �pointpieces("white",point,board)
C:)whiteblots?point = (whitepresent = 1)
CD*white_cover?point = (whitepresent > 1)
CN4blackpresent = �pointpieces("black",point,board)
CX)blackblots?point = (blackpresent = 1)
Cb*black_cover?point = (blackpresent > 1)
Cl� whitepresent > 0 �
Cv`� point<19 � whitepoints += whitepresent*point � whitepoints +=whitepresent*pieceinhomeboard
C�� whitepresent >1 �
C�9� point > 18 � white_hc+=1 � � point>12 � white_oc+=1
C��
C��
C�� blackpresent > 0 �
C�d� point>6 � blackpoints += blackpresent*(25-point) � blackpoints +=blackpresent*pieceinhomeboard
C�� blackpresent >1 �
C�8� point < 7 � black_hc+=1 � � point<13 � black_oc+=1
C��
C��
C�� point
C��
C�
Diݤboardscore(col$,board,movecol$,barwhite,barblack,board_points,own_hc,own_oc,opp_hc,opp_oc,ownblots)
D@� point,present,score,blotscore,ntrapping,ntrapped,trapscore
D2blotscore=0:ntrapped=0:ntrapping=0:trapscore=0
D Iscore=board_points+own_hc*doubleinhomebonus+own_oc*doubleinouterbonus
D*� point = 1 � 24
D4w� ownblots?point � blotscore += �blotscore(col$,point,movecol$,barwhite,barblack,board,diceavailable,opp_hc,opp_oc)
D>
Ȏ col$ �
DH� "white":
DR� white_cover?point �
D\� point>18 �
Df5trapscore+=�trapbonus(col$,point,board,ntrapping)
Dp�
DzC� point >12 � trapscore+=�trapbonus(col$,point,board,ntrapping)
D��
D��
D�
� "black"
D�� black_cover?point �
D�� point <7 �
D�5trapscore+=�trapbonus(col$,point,board,ntrapping)
D��
D�C� point <13 � trapscore+=�trapbonus(col$,point,board,ntrapping)
D��
D��
D��
D�6� PRINT TAB(0,point);point,present,score,blotscore
D�� point
E,� ntrapping >4 � trapscore = 2*trapscore
Escore+=trapscore
E(� IF col$="white" THEN x=0 ELSE x=40
E$� PRINT TAB(x,0)SPC60;
E.;� PRINT TAB(x,0);col$;" ";score;" ";trapscore,ntrapping
E8=�(score+blotscore)
EB
EL3ݤtrapbonus(col$,doublepoint,board,� ntrapping)
EV9� awards points for enemy pieces inside doubled point
E`� in home and outer boards
Ej� point,oppcol$,bonus,tb,pp
EtC� �playerbearing(col$) � tp = bearingtrapbonus � tp = trapbonus
E~bonus=0
E�6� col$="white" � oppcol$="black" � oppcol$="white"
E�
Ȏ col$ �
E�� "white":
E�bonus += barblack*tp
E�� point = doublepoint � 24
E�0bonus+= �pointpieces(oppcol$,point,board)*tp
E�� point
E�� "black":
E�bonus += barwhite*tp
E�� point = 1 � doublepoint
E�/bonus+=�pointpieces(oppcol$,point,board)*tp
E�� point
F�
F
K� PRINT TAB(0,0);SPC30;TAB(0,0);col$,doublepoint,bonus:REPEAT UNTIL GET
F� bonus>0 � ntrapping +=1
F
=bonus
F(
F2
F<Wݤblotscore(col$,blotpoint,movecol$,barwhite,barblack,board,diceleft,opp_hc,opp_oc)
FF8� penalty for blot depends on how advanced the point
FP3� and how many opponent within six points ahead
FZ4� and covering of opponents home and outerboards
Fd0� blotscore,coverable,penalty,ahead,oppcover
Fn� allpast � =0
Fx>� col$ <> movecol$ � diceleft <2 � penalty = � � penalty=�
F�E� blots always scored as penalties when evaluating opponents move
F�!� or when playing second dice
F�� � penalty �
F�M� � �coverable_blot(col$,blotpoint,board,barblack,barwhite) � penalty = �
F��
F�?� also treated as penalties if playing the first dice and a
F�&� second one cannot cover the blot
F�� � penalty �
F�
Ȏ col$ �
F�=� "white": blotscore = blotposweight*((blotpoint-1)� 6)+1
F�@� "black": blotscore = blotposweight*((25-blotpoint-1)� 6)+1
F��
F��
G� penalise blots
G oppcover = 2*opp_hc + opp_oc
GSahead = �aheadofblot(col$,blotpoint,board,barblack,barwhite,oppcover,blotscore)
G"�
G,R� VDU7:PRINT TAB(0,0);SPC30;TAB(0,0);col$,blotpoint,blotscore:REPEAT UNTIL GET
G6=blotscore
G@
GJNݤaheadofblot(col$,blotpoint,board,barblack,barwhite,oppcover,� blotscore)
GT0� ahead, aheadpoint,point,blotneg,coverscore
G^F� (col$="white" � blotpoint>12) � (col$="black" � blotpoint <13) �
Ghcoverscore=oppcover � 4
Gr�
G|coverscore=0
G��
G�
Ȏ col$ �
G�� "white":
G�,� blotpoint > 18 � barblack>0 � ahead+=2
G�@� piece on bar counted double to deter hitting in home board
G�=aheadpoint=blotpoint+6:� aheadpoint >24 � aheadpoint = 24
G�$� point = blotpoint � aheadpoint
G�4� �pointpieces("black",point,board)>0 � ahead+=1
G�� point
G�6� ahead = 0 � blotneg =1 � blotneg = blotnegweight
G�>blotscore=(ahead+coverscore)*blotneg*((blotpoint-1) � 6)+1
G�� "black":
G�*� blotpoint <7 � barwhite>0 � ahead+=2
H;aheadpoint=blotpoint-6:� aheadpoint <1 � aheadpoint = 1
H$� point = aheadpoint � blotpoint
H4� �pointpieces("white",point,board)>0 � ahead+=1
H&� point
H06� ahead = 0 � blotneg =1 � blotneg = blotnegweight
H:Ablotscore=(ahead+coverscore)*blotneg*((25-blotpoint-1) � 6)+1
HD�
HNblotscore = -blotscore
HX
=ahead
Hb
Hl<ݤcoverable_blot(col$,blotpoint,board,barblack,barwhite)
Hv?� dicefree,startpoint,roll,present,ok,endpoint,state$,dummy
H�,� diceused = 1 � dicefree=2 � dicefree=1
H�roll=dice(dicefree)
H�L� col$="white" � startpoint = blotpoint-roll � startpoint=blotpoint+roll
H�&� startpoint <0 � startpoint >24 �
H�ok=�
H��
H�1present = �pointpieces(col$,startpoint,board)
H�-� present >0 � present <> 2 � ok=� � ok=�
H�:� if covering point has two pieces then covering would
H�� create a blot!
H��
H�B� If blot cannot be covered then check if it could be move out
H�=� of danger by second dice. The destination point must be
I0� in the same state as in newboard and board
I� � ok �
Ij� col$="white" � endpoint = blotpoint+roll:oppcol$="black" � endpoint = blotpoint-roll:oppcol$="black"
I  � endpoint<0 � endpoint>24 �
I*
ok = �
I4�
I> state$=�pointstate(endpoint)
IH� �state$,5)=oppcol$ � =�
IRh� state$="empty" � state$=col$ � ok = � �aheadofblot(col$,blotpoint,board,barblack,barwhite,0,dummy)
I\�
If�
Ip=ok
Iz
I�#ݤpointpieces(col$,point,board)
I�� pieces
I�pieces = board?point
I�� pieces = 0 � =0
I�
Ȏ col$ �
I�� "white":
I�!� pieces >128 � =0 � = pieces
I�� "black":
I�'� pieces <129 � =0 � = pieces � 128
I��
I�
I�
I���init_weightings
J3� signed for player of current colour, opponent
J(� pieces scored as negation of these
J'� alter these to tweak the strategy
J$playerwins = 999
J.pieceinhomeboard = 19
J85pieceinawayboard = -2: � ie opponent's home board
JBpieceoffboard = 30
JLpieceonbar = -5
JVdoubleinhomebonus=3
J`doubleinouterbonus=2
Jj@trapbonus = 1        :� bonus for piece inside doubled point
Jt<bearingtrapbonus = 2.5 :� as above when also bearing off
J~double_threshold = 30
J�C� since all pieces score for how advanced they are on the board
J�C� hitting and advanced piece automatically incurs a substantial
J�
� benefit
J�blotnegweight = 2
J�blotposweight = 2
J��
J�
J���allpast_weightings
J�2� weightings reset when pieces pass each other
J�pieceinhomeboard = 30
J�pieceoffboard = 50
J��
K
K
��find_opening_moves(col$)
K� moves,n,i,j,dice1,dice2
Kdice1=dice(1):dice2=dice(2)
K(moves=0
K2�:moves+=1
K<C� dice1 = opening_moves(1,moves) � dice2=opening_moves(2,moves)
KF� double �
KP
� i=1 � 4
KZ
Ȏ i �
Kd� 1,2: j=3
Kn� 3,4: j=4
Kx�
K�;openings(i)=�opening_point(opening_moves(j,moves),col$)
K�"� PRINT TAB(0,i);i,openings(i)
K�� i
K��
K�
� i=1 � 2
K�=openings(i)=�opening_point(opening_moves(i+2,moves),col$)
K�"� PRINT TAB(0,i);i,openings(i)
K�� i
K��
K��
K�
K�ݤopening_point(point,col$)
K�� col$="black" �
L=(25-point)
L�
L
=point
L"�
L,
L6��init_opening_moves
L@� move,i
LJ
� �pZL
LT%� opening_moves(4,21),openings(4)
L^� move=1 � 21
Lh
� i=1 � 4
Lr� opening_moves(i,move)
L|� i
L�
� move
L��
L�� 3,1,17,19
L�� 6,1,12,17
L�� 4,2,17,19
L�� 5,3,17,19
L�
� 6,5,1,7
L�
� 6,4,1,7
L�
� 6,3,1,7
L�� 6,2,12,18
L�� 5,1,12,19
L�� 4,1,12,19
L�� 2,1,12,19
M� 5,4,12,12
M� 5,2,12,12
M� 4,3,12,12
M&� 3,2,12,12
M0� 6,6,1,12
M:� 5,5,12,17
MD� 4,4,1,12
MN� 3,3,17,19
MX� 2,2,12,19
Mb� 1,1,17,19
Ml
Mv
M�� End of computer strategy
M�� ========================
M�
M�
M���switch_display_bank
M�6� display_bank=1 � display_bank=2 � display_bank=1
M�Ȗ
M�� "FX 113,"+�display_bank
M��
M�
M���switch_update_bank
M�3� update_bank=1 � update_bank=2 � update_bank=1
M�Ȗ
N� "FX 112,"+�update_bank
N�
N
N ��shadow_box(box())
N*)� Copy screen area into shadow screen
N4�grabbox(box(),"temp")
N>�switch_update_bank
NH�restorebox(box(),"temp")
NR�switch_update_bank
N\�
Nf
�
00000000  0d 00 0a 1d f4 3e 20 3c  42 61 63 6b 67 24 44 69  |.....> <Backg$Di|
00000010  72 3e 2e 42 61 63 6b 67  61 6d 6d 6f 6e 0d 00 14  |r>.Backgammon...|
00000020  23 f4 20 4a 6f 6e 61 74  68 61 6e 20 45 76 61 6e  |#. Jonathan Evan|
00000030  73 2c 20 44 65 63 65 6d  62 65 72 20 31 39 38 39  |s, December 1989|
00000040  0d 00 19 25 f4 20 28 63  29 20 41 72 63 68 69 6d  |...%. (c) Archim|
00000050  65 64 65 73 20 57 6f 72  6c 64 20 41 70 72 69 6c  |edes World April|
00000060  20 31 39 39 32 0d 00 1e  04 0d 00 28 0c 2a 46 58  | 1992......(.*FX|
00000070  32 30 30 2c 31 0d 00 32  09 f2 69 6e 69 74 0d 00  |200,1..2..init..|
00000080  3c 05 f5 0d 00 46 0d f2  69 6e 69 74 67 61 6d 65  |<....F..initgame|
00000090  0d 00 50 0b f2 73 63 72  65 65 6e 0d 00 5a 0e f2  |..P..screen..Z..|
000000a0  73 74 61 72 74 67 61 6d  65 0d 00 64 09 f2 70 6c  |startgame..d..pl|
000000b0  61 79 0d 00 6e 07 fd 20  a3 0d 00 78 05 e0 0d 00  |ay..n.. ...x....|
000000c0  82 04 0d 00 8c 0c dd f2  73 63 72 65 65 6e 0d 00  |........screen..|
000000d0  96 0c ea 20 73 63 72 65  65 6e 0d 00 a0 20 75 70  |... screen... up|
000000e0  64 61 74 65 5f 62 61 6e  6b 3d 32 3a 64 69 73 70  |date_bank=2:disp|
000000f0  6c 61 79 5f 62 61 6e 6b  3d 32 0d 00 aa 0c 2a 46  |lay_bank=2....*F|
00000100  58 31 31 33 2c 32 0d 00  b4 0c 2a 46 58 31 31 32  |X113,2....*FX112|
00000110  2c 32 0d 00 be 15 c8 99  20 22 48 6f 75 72 67 6c  |,2...... "Hourgl|
00000120  61 73 73 5f 4f 6e 22 0d  00 c8 11 fb 20 31 32 38  |ass_On"..... 128|
00000130  2b 62 6c 61 63 6b 3a db  0d 00 d2 14 e3 20 73 63  |+black:...... sc|
00000140  72 65 65 6e 20 3d 20 31  20 b8 20 32 0d 00 dc 17  |reen = 1 . 2....|
00000150  f2 73 77 69 74 63 68 5f  75 70 64 61 74 65 5f 62  |.switch_update_b|
00000160  61 6e 6b 0d 00 e6 0a f2  62 6f 61 72 64 0d 00 f0  |ank.....board...|
00000170  0a f2 70 61 6e 65 6c 0d  00 fa 18 f2 73 77 69 74  |..panel.....swit|
00000180  63 68 5f 64 69 73 70 6c  61 79 5f 62 61 6e 6b 0d  |ch_display_bank.|
00000190  01 04 08 c8 97 20 ee 0d  01 0e 0c ed 20 73 63 72  |..... ...... scr|
000001a0  65 65 6e 0d 01 18 16 c8  99 20 22 48 6f 75 72 67  |een...... "Hourg|
000001b0  6c 61 73 73 5f 4f 66 66  22 0d 01 22 05 e1 0d 01  |lass_Off".."....|
000001c0  2c 04 0d 01 36 0a dd f2  69 6e 69 74 0d 01 40 0b  |,...6...init..@.|
000001d0  58 3d b3 28 2d 91 29 0d  01 4a 18 eb 20 31 34 30  |X=.(-.)..J.. 140|
000001e0  3a 20 ef 20 32 33 2c 30  2c 31 30 2c 33 32 7c 0d  |: . 23,0,10,32|.|
000001f0  01 54 50 62 6c 61 63 6b  6d 6f 6e 65 79 3d 31 30  |.TPblackmoney=10|
00000200  30 30 3a 77 68 69 74 65  6d 6f 6e 65 79 3d 31 30  |00:whitemoney=10|
00000210  30 30 3a 62 6c 61 63 6b  70 6c 61 79 65 72 24 3d  |00:blackplayer$=|
00000220  22 43 4f 4d 50 55 54 45  52 22 3a 77 68 69 74 65  |"COMPUTER":white|
00000230  70 6c 61 79 65 72 24 3d  22 48 55 4d 41 4e 22 0d  |player$="HUMAN".|
00000240  01 5e 44 6d 69 64 67 72  65 79 20 3d 20 39 3a 20  |.^Dmidgrey = 9: |
00000250  6c 69 67 68 74 67 72 65  79 20 3d 20 31 30 3a 20  |lightgrey = 10: |
00000260  64 61 72 6b 67 72 65 79  20 3d 20 31 31 3a 20 62  |darkgrey = 11: b|
00000270  6c 61 63 6b 20 3d 20 30  3a 20 77 68 69 74 65 20  |lack = 0: white |
00000280  3d 20 37 0d 01 68 37 67  72 65 65 6e 20 3d 20 32  |= 7..h7green = 2|
00000290  3a 20 62 72 6f 77 6e 20  3d 20 36 3a 20 72 65 64  |: brown = 6: red|
000002a0  20 3d 20 31 3a 20 62 6c  75 65 20 3d 20 34 3a 20  | = 1: blue = 4: |
000002b0  69 76 6f 72 79 20 3d 20  31 34 0d 01 72 4a fb 20  |ivory = 14..rJ. |
000002c0  6d 69 64 67 72 65 79 2c  20 31 32 38 2c 31 32 38  |midgrey, 128,128|
000002d0  2c 31 32 38 3a 20 fb 20  64 61 72 6b 67 72 65 79  |,128: . darkgrey|
000002e0  2c 20 36 34 2c 36 34 2c  36 34 3a 20 fb 20 6c 69  |, 64,64,64: . li|
000002f0  67 68 74 67 72 65 79 2c  20 31 39 36 2c 31 39 36  |ghtgrey, 196,196|
00000300  2c 31 39 36 0d 01 7c 3c  fb 20 67 72 65 65 6e 2c  |,196..|<. green,|
00000310  20 33 32 2c 31 33 32 2c  33 32 3a 20 fb 20 62 72  | 32,132,32: . br|
00000320  6f 77 6e 2c 20 31 34 38  2c 35 30 2c 35 32 3a 20  |own, 148,50,52: |
00000330  fb 20 72 65 64 2c 32 30  30 2c 31 36 2c 30 31 36  |. red,200,16,016|
00000340  0d 01 86 2f fb 20 31 35  2c 30 2c 30 2c 30 3a fb  |.../. 15,0,0,0:.|
00000350  20 31 34 2c 32 34 30 2c  32 34 30 2c 31 37 36 3a  | 14,240,240,176:|
00000360  20 f4 20 64 69 63 65 20  63 6f 6c 6f 75 72 73 0d  | . dice colours.|
00000370  01 90 64 de 20 62 6f 61  72 64 20 32 34 2c 20 69  |..d. board 24, i|
00000380  6e 69 74 62 6f 61 72 64  20 32 34 2c 20 62 65 73  |nitboard 24, bes|
00000390  74 62 6f 61 72 64 20 32  34 2c 77 68 69 74 65 62  |tboard 24,whiteb|
000003a0  6c 6f 74 73 20 32 34 2c  62 6c 61 63 6b 62 6c 6f  |lots 24,blackblo|
000003b0  74 73 20 32 34 2c 77 68  69 74 65 5f 63 6f 76 65  |ts 24,white_cove|
000003c0  72 20 32 34 2c 62 6c 61  63 6b 5f 63 6f 76 65 72  |r 24,black_cover|
000003d0  20 32 34 0d 01 9a c1 62  6f 61 72 64 73 69 7a 65  | 24....boardsize|
000003e0  20 3d 20 31 30 32 34 3a  20 62 6f 72 64 65 72 73  | = 1024: borders|
000003f0  69 7a 65 20 3d 20 34 38  3a 20 62 61 72 77 69 64  |ize = 48: barwid|
00000400  74 68 20 3d 20 37 32 3a  20 70 6f 69 6e 74 77 69  |th = 72: pointwi|
00000410  64 74 68 20 3d 20 28 62  6f 61 72 64 73 69 7a 65  |dth = (boardsize|
00000420  2d 32 2a 62 6f 72 64 65  72 73 69 7a 65 2d 62 61  |-2*bordersize-ba|
00000430  72 77 69 64 74 68 29 2f  31 32 3a 20 70 6f 69 6e  |rwidth)/12: poin|
00000440  74 68 65 69 67 68 74 20  3d 20 33 38 30 3a 20 79  |theight = 380: y|
00000450  74 6f 70 20 3d 20 62 6f  61 72 64 73 69 7a 65 2d  |top = boardsize-|
00000460  62 6f 72 64 65 72 73 69  7a 65 2d 32 3a 20 79 62  |bordersize-2: yb|
00000470  6f 74 74 6f 6d 20 3d 20  62 6f 72 64 65 72 73 69  |ottom = bordersi|
00000480  7a 65 2b 36 3a 20 70 69  65 63 65 73 69 7a 65 20  |ze+6: piecesize |
00000490  3d 20 36 30 0d 01 a4 50  de 20 77 68 69 74 65 74  |= 60...P. whitet|
000004a0  68 72 6f 77 62 6f 78 28  34 29 2c 62 6c 61 63 6b  |hrowbox(4),black|
000004b0  74 68 72 6f 77 62 6f 78  28 34 29 2c 67 61 6d 65  |throwbox(4),game|
000004c0  62 6f 78 28 34 29 2c 64  69 63 65 28 32 29 2c 73  |box(4),dice(2),s|
000004d0  68 6f 77 64 69 63 65 28  34 29 2c 62 61 72 62 6f  |howdice(4),barbo|
000004e0  78 28 34 29 0d 01 ae 6b  62 61 72 62 6f 78 28 31  |x(4)...kbarbox(1|
000004f0  29 3d 28 62 6f 61 72 64  73 69 7a 65 2d 62 61 72  |)=(boardsize-bar|
00000500  77 69 64 74 68 29 2f 32  3a 62 61 72 62 6f 78 28  |width)/2:barbox(|
00000510  32 29 3d 30 3a 62 61 72  62 6f 78 28 33 29 3d 62  |2)=0:barbox(3)=b|
00000520  61 72 62 6f 78 28 31 29  2b 62 61 72 77 69 64 74  |arbox(1)+barwidt|
00000530  68 3a 62 61 72 62 6f 78  28 34 29 3d 62 61 72 62  |h:barbox(4)=barb|
00000540  6f 78 28 34 29 2b 62 6f  61 72 64 73 69 7a 65 0d  |ox(4)+boardsize.|
00000550  01 b8 ad 62 6c 61 63 6b  74 68 72 6f 77 62 6f 78  |...blackthrowbox|
00000560  28 31 29 3d 62 6f 72 64  65 72 73 69 7a 65 2b 31  |(1)=bordersize+1|
00000570  36 3a 62 6c 61 63 6b 74  68 72 6f 77 62 6f 78 28  |6:blackthrowbox(|
00000580  32 29 3d 62 6f 72 64 65  72 73 69 7a 65 2b 70 6f  |2)=bordersize+po|
00000590  69 6e 74 68 65 69 67 68  74 2b 31 36 3a 62 6c 61  |intheight+16:bla|
000005a0  63 6b 74 68 72 6f 77 62  6f 78 28 33 29 3d 28 62  |ckthrowbox(3)=(b|
000005b0  6f 61 72 64 73 69 7a 65  2d 62 61 72 77 69 64 74  |oardsize-barwidt|
000005c0  68 29 2f 32 2d 31 36 3a  62 6c 61 63 6b 74 68 72  |h)/2-16:blackthr|
000005d0  6f 77 62 6f 78 28 34 29  3d 62 6f 61 72 64 73 69  |owbox(4)=boardsi|
000005e0  7a 65 2d 62 6f 72 64 65  72 73 69 7a 65 2d 70 6f  |ze-bordersize-po|
000005f0  69 6e 74 68 65 69 67 68  74 2d 31 36 0d 01 c2 99  |intheight-16....|
00000600  77 68 69 74 65 74 68 72  6f 77 62 6f 78 28 31 29  |whitethrowbox(1)|
00000610  3d 28 62 6f 61 72 64 73  69 7a 65 2b 62 61 72 77  |=(boardsize+barw|
00000620  69 64 74 68 29 2f 32 2b  34 3a 77 68 69 74 65 74  |idth)/2+4:whitet|
00000630  68 72 6f 77 62 6f 78 28  32 29 3d 62 6c 61 63 6b  |hrowbox(2)=black|
00000640  74 68 72 6f 77 62 6f 78  28 32 29 3a 77 68 69 74  |throwbox(2):whit|
00000650  65 74 68 72 6f 77 62 6f  78 28 33 29 3d 62 6f 61  |ethrowbox(3)=boa|
00000660  72 64 73 69 7a 65 2d 62  6f 72 64 65 72 73 69 7a  |rdsize-bordersiz|
00000670  65 2d 34 3a 77 68 69 74  65 74 68 72 6f 77 62 6f  |e-4:whitethrowbo|
00000680  78 28 34 29 3d 62 6c 61  63 6b 74 68 72 6f 77 62  |x(4)=blackthrowb|
00000690  6f 78 28 34 29 0d 01 cc  47 67 61 6d 65 62 6f 78  |ox(4)...Ggamebox|
000006a0  28 31 29 3d 30 3a 67 61  6d 65 62 6f 78 28 32 29  |(1)=0:gamebox(2)|
000006b0  3d 30 3a 67 61 6d 65 62  6f 78 28 33 29 3d 62 6f  |=0:gamebox(3)=bo|
000006c0  61 72 64 73 69 7a 65 3a  67 61 6d 65 62 6f 78 28  |ardsize:gamebox(|
000006d0  34 29 3d 62 6f 61 72 64  73 69 7a 65 0d 01 d6 2a  |4)=boardsize...*|
000006e0  65 76 61 6c 64 69 73 70  6c 61 79 24 3d 22 4f 4e  |evaldisplay$="ON|
000006f0  22 3a 64 6f 75 62 6c 65  3d a3 3a 66 69 72 73 74  |":double=.:first|
00000700  70 61 69 72 3d a3 0d 01  e0 1f de 20 6c 65 67 61  |pair=...... lega|
00000710  6c 6d 6f 76 65 73 28 35  2c 35 30 29 3a 6e 6c 65  |lmoves(5,50):nle|
00000720  67 61 6c 3d 30 0d 01 ea  28 de 20 6f 70 74 74 65  |gal=0...(. optte|
00000730  78 74 24 28 35 29 2c 70  6f 69 6e 74 62 6f 78 28  |xt$(5),pointbox(|
00000740  34 29 2c 73 75 72 65 62  6f 78 28 34 29 0d 01 f4  |4),surebox(4)...|
00000750  2a 73 75 72 65 62 6f 78  28 31 29 3d 31 32 34 30  |*surebox(1)=1240|
00000760  2f 33 2d 33 32 3a 73 75  72 65 62 6f 78 28 32 29  |/3-32:surebox(2)|
00000770  3d 31 30 32 34 2f 33 0d  01 fe 33 73 75 72 65 62  |=1024/3...3sureb|
00000780  6f 78 28 33 29 3d 32 2a  73 75 72 65 62 6f 78 28  |ox(3)=2*surebox(|
00000790  31 29 3a 73 75 72 65 62  6f 78 28 34 29 3d 32 2a  |1):surebox(4)=2*|
000007a0  73 75 72 65 62 6f 78 28  32 29 0d 02 08 21 e3 20  |surebox(2)...!. |
000007b0  69 20 3d 20 31 20 b8 20  35 3a f3 20 6f 70 74 74  |i = 1 . 5:. optt|
000007c0  65 78 74 24 28 69 29 3a  ed 20 69 0d 02 12 2c dc  |ext$(i):. i...,.|
000007d0  20 22 57 48 49 54 45 22  2c 22 42 4c 41 43 4b 22  | "WHITE","BLACK"|
000007e0  2c 22 4d 4f 4e 45 59 22  2c 22 56 41 4c 55 45 22  |,"MONEY","VALUE"|
000007f0  2c 22 51 55 49 54 22 0d  02 1c 73 de 20 6f 70 74  |,"QUIT"...s. opt|
00000800  62 6f 78 28 34 29 2c 63  61 6e 74 62 6f 78 28 34  |box(4),cantbox(4|
00000810  29 3a 20 6f 70 74 62 6f  78 28 31 29 3d 31 32 34  |): optbox(1)=124|
00000820  30 2f 34 3a 6f 70 74 62  6f 78 28 32 29 3d 31 30  |0/4:optbox(2)=10|
00000830  32 34 2f 34 3a 6f 70 74  62 6f 78 28 33 29 3d 6f  |24/4:optbox(3)=o|
00000840  70 74 62 6f 78 28 31 29  2b 31 30 32 34 2f 32 3a  |ptbox(1)+1024/2:|
00000850  6f 70 74 62 6f 78 28 34  29 3d 6f 70 74 62 6f 78  |optbox(4)=optbox|
00000860  28 32 29 2b 31 30 32 34  2f 32 0d 02 26 34 63 61  |(2)+1024/2..&4ca|
00000870  6e 74 62 6f 78 28 29 3d  6f 70 74 62 6f 78 28 29  |ntbox()=optbox()|
00000880  3a 63 61 6e 74 62 6f 78  28 32 29 2b 3d 38 30 3a  |:cantbox(2)+=80:|
00000890  63 61 6e 74 62 6f 78 28  34 29 2d 3d 38 30 0d 02  |cantbox(4)-=80..|
000008a0  30 20 de 20 20 62 65 73  74 6d 6f 76 65 73 28 34  |0 .  bestmoves(4|
000008b0  30 29 2c 6e 65 77 62 6f  61 72 64 20 32 34 0d 02  |0),newboard 24..|
000008c0  3a 0f f2 69 6e 69 74 70  69 65 63 65 73 0d 02 44  |:..initpieces..D|
000008d0  0f f2 69 6e 69 74 70 61  6e 65 6c 73 0d 02 4e 14  |..initpanels..N.|
000008e0  f2 69 6e 69 74 5f 77 65  69 67 68 74 69 6e 67 73  |.init_weightings|
000008f0  0d 02 58 17 f2 69 6e 69  74 5f 6f 70 65 6e 69 6e  |..X..init_openin|
00000900  67 5f 6d 6f 76 65 73 0d  02 62 11 f2 69 6e 69 74  |g_moves..b..init|
00000910  5f 73 70 72 69 74 65 73  0d 02 6c 08 c8 a0 20 32  |_sprites..l... 2|
00000920  0d 02 76 15 2a 43 48 41  4e 4e 45 4c 56 4f 49 43  |..v.*CHANNELVOIC|
00000930  45 20 31 20 31 0d 02 80  15 2a 43 48 41 4e 4e 45  |E 1 1....*CHANNE|
00000940  4c 56 4f 49 43 45 20 32  20 36 0d 02 8a 16 2a 3c  |LVOICE 2 6....*<|
00000950  42 61 63 6b 67 24 44 69  72 3e 2e 48 41 4e 44 33  |Backg$Dir>.HAND3|
00000960  0d 02 94 0a c8 97 20 ee  20 31 0d 02 9e 05 e1 0d  |...... . 1......|
00000970  02 a8 04 0d 02 b2 12 dd  f2 69 6e 69 74 5f 73 70  |.........init_sp|
00000980  72 69 74 65 73 0d 02 bc  1a 73 70 72 69 74 65 73  |rites....sprites|
00000990  69 7a 65 25 20 3d 20 31  30 30 2a 31 30 32 34 0d  |ize% = 100*1024.|
000009a0  02 c6 1c de 20 73 70 72  69 74 65 61 72 65 61 20  |.... spritearea |
000009b0  73 70 72 69 74 65 73 69  7a 65 25 0d 02 d0 1d 21  |spritesize%....!|
000009c0  73 70 72 69 74 65 61 72  65 61 20 3d 20 73 70 72  |spritearea = spr|
000009d0  69 74 65 73 69 7a 65 25  0d 02 da 12 73 70 72 69  |itesize%....spri|
000009e0  74 65 61 72 65 61 21 34  3d 30 0d 02 e4 13 73 70  |tearea!4=0....sp|
000009f0  72 69 74 65 61 72 65 61  21 38 3d 31 36 0d 02 ee  |ritearea!8=16...|
00000a00  14 73 70 72 69 74 65 61  72 65 61 21 31 36 3d 31  |.spritearea!16=1|
00000a10  36 0d 02 f8 3c c8 99 20  22 4f 53 5f 53 70 72 69  |6...<.. "OS_Spri|
00000a20  74 65 4f 70 22 2c 32 35  36 2b 31 30 2c 73 70 72  |teOp",256+10,spr|
00000a30  69 74 65 61 72 65 61 2c  22 3c 42 61 63 6b 67 24  |itearea,"<Backg$|
00000a40  44 69 72 3e 2e 73 70 72  69 74 65 73 22 0d 03 02  |Dir>.sprites"...|
00000a50  05 e1 0d 03 0c 04 0d 03  16 0e dd f2 69 6e 69 74  |............init|
00000a60  67 61 6d 65 0d 03 20 43  77 68 69 74 65 74 75 72  |game.. Cwhitetur|
00000a70  6e 3d b9 3a 67 61 6d 65  69 6e 70 72 6f 67 72 65  |n=.:gameinprogre|
00000a80  73 73 3d a3 3a 20 77 68  69 74 65 67 61 6d 65 73  |ss=.: whitegames|
00000a90  63 6f 72 65 3d 30 3a 62  6c 61 63 6b 67 61 6d 65  |core=0:blackgame|
00000aa0  73 63 6f 72 65 3d 30 0d  03 2a 28 62 61 72 62 6c  |score=0..*(barbl|
00000ab0  61 63 6b 3d 30 3a 62 61  72 77 68 69 74 65 20 3d  |ack=0:barwhite =|
00000ac0  20 30 3a 64 69 63 65 72  6f 6c 6c 65 64 3d a3 0d  | 0:dicerolled=..|
00000ad0  03 34 16 f2 69 6e 69 74  70 61 6e 65 6c 61 63 74  |.4..initpanelact|
00000ae0  69 76 69 74 79 0d 03 3e  34 64 6f 75 62 6c 65 63  |ivity..>4doublec|
00000af0  75 62 65 20 3d 20 36 34  3a 64 6f 75 62 6c 65 74  |ube = 64:doublet|
00000b00  75 72 6e 24 20 3d 20 22  65 69 74 68 65 72 22 3a  |urn$ = "either":|
00000b10  64 6f 75 62 6c 65 64 3d  a3 0d 03 48 2c 62 6c 61  |doubled=...H,bla|
00000b20  63 6b 70 69 65 63 65 73  3d 31 35 3a 77 68 69 74  |ckpieces=15:whit|
00000b30  65 70 69 65 63 65 73 3d  31 35 3a 77 69 6e 6e 65  |epieces=15:winne|
00000b40  72 24 3d 22 22 0d 03 52  33 62 6c 61 63 6b 6f 70  |r$=""..R3blackop|
00000b50  65 6e 69 6e 67 3d b9 3a  20 77 68 69 74 65 6f 70  |ening=.: whiteop|
00000b60  65 6e 69 6e 67 3d b9 3a  20 63 75 72 72 65 6e 74  |ening=.: current|
00000b70  5f 73 63 6f 72 65 3d 30  0d 03 5c 33 61 6c 6c 70  |_score=0..\3allp|
00000b80  61 73 74 3d a3 3a 20 61  6c 6c 70 61 73 74 5f 77  |ast=.: allpast_w|
00000b90  65 69 67 68 74 3d a3 3a  20 64 6f 75 62 6c 65 5f  |eight=.: double_|
00000ba0  72 65 66 75 73 65 64 20  3d 20 a3 0d 03 66 28 64  |refused = ...f(d|
00000bb0  69 73 70 6c 61 79 5f 62  61 6e 6b 3d 32 3a 75 70  |isplay_bank=2:up|
00000bc0  64 61 74 65 5f 62 61 6e  6b 3d 32 3a 2a 53 48 41  |date_bank=2:*SHA|
00000bd0  44 4f 57 0d 03 70 21 77  68 69 74 65 62 65 61 72  |DOW..p!whitebear|
00000be0  69 6e 67 3d a3 3a 62 6c  61 63 6b 62 65 61 72 69  |ing=.:blackbeari|
00000bf0  6e 67 3d a3 0d 03 7a 05  e1 0d 03 84 04 0d 03 8e  |ng=...z.........|
00000c00  10 dd f2 69 6e 69 74 70  61 6e 65 6c 73 0d 03 98  |...initpanels...|
00000c10  0b ea 20 70 61 6e 6e 6f  0d 03 a2 2b f4 20 69 6e  |.. panno...+. in|
00000c20  69 74 69 61 6c 69 73 65  20 70 61 6e 65 6c 73 20  |itialise panels |
00000c30  69 6e 20 72 69 67 68 74  20 68 61 6e 64 20 73 74  |in right hand st|
00000c40  72 69 70 0d 03 ac 81 de  20 70 61 6e 65 6c 74 65  |rip..... panelte|
00000c50  78 74 24 28 34 29 2c 70  61 6e 65 6c 28 34 29 2c  |xt$(4),panel(4),|
00000c60  70 61 6e 65 6c 73 28 34  2c 34 29 2c 70 61 6e 65  |panels(4,4),pane|
00000c70  6c 61 63 74 69 76 65 28  35 29 2c 6d 6f 76 65 70  |lactive(5),movep|
00000c80  61 6e 65 6c 28 34 29 2c  64 69 63 65 70 61 6e 65  |anel(4),dicepane|
00000c90  6c 28 34 29 2c 6f 70 74  70 61 6e 65 6c 28 34 29  |l(4),optpanel(4)|
00000ca0  2c 71 75 69 74 70 61 6e  65 6c 28 34 29 2c 6f 6b  |,quitpanel(4),ok|
00000cb0  70 61 6e 65 6c 28 34 29  2c 70 61 6e 65 6c 62 6f  |panel(4),panelbo|
00000cc0  78 28 34 29 0d 03 b6 6e  6f 70 74 70 61 6e 65 6c  |x(4)...noptpanel|
00000cd0  28 31 29 3d 6f 70 74 62  6f 78 28 31 29 2b 32 30  |(1)=optbox(1)+20|
00000ce0  30 3a 6f 70 74 70 61 6e  65 6c 28 32 29 3d 6f 70  |0:optpanel(2)=op|
00000cf0  74 62 6f 78 28 34 29 2d  31 31 32 3a 6f 70 74 70  |tbox(4)-112:optp|
00000d00  61 6e 65 6c 28 33 29 3d  6f 70 74 70 61 6e 65 6c  |anel(3)=optpanel|
00000d10  28 31 29 2b 32 34 30 3a  6f 70 74 70 61 6e 65 6c  |(1)+240:optpanel|
00000d20  28 34 29 3d 6f 70 74 70  61 6e 65 6c 28 32 29 2b  |(4)=optpanel(2)+|
00000d30  35 30 0d 03 c0 72 71 75  69 74 70 61 6e 65 6c 28  |50...rquitpanel(|
00000d40  31 29 3d 6f 70 74 62 6f  78 28 31 29 2b 36 30 3a  |1)=optbox(1)+60:|
00000d50  71 75 69 74 70 61 6e 65  6c 28 32 29 3d 6f 70 74  |quitpanel(2)=opt|
00000d60  62 6f 78 28 32 29 2b 35  30 3a 71 75 69 74 70 61  |box(2)+50:quitpa|
00000d70  6e 65 6c 28 33 29 3d 71  75 69 74 70 61 6e 65 6c  |nel(3)=quitpanel|
00000d80  28 31 29 2b 33 30 30 3a  71 75 69 74 70 61 6e 65  |(1)+300:quitpane|
00000d90  6c 28 34 29 3d 71 75 69  74 70 61 6e 65 6c 28 32  |l(4)=quitpanel(2|
00000da0  29 2b 38 30 0d 03 ca 68  6f 6b 70 61 6e 65 6c 28  |)+80...hokpanel(|
00000db0  31 29 3d 71 75 69 74 70  61 6e 65 6c 28 31 29 2b  |1)=quitpanel(1)+|
00000dc0  33 32 30 3a 6f 6b 70 61  6e 65 6c 28 32 29 3d 71  |320:okpanel(2)=q|
00000dd0  75 69 74 70 61 6e 65 6c  28 32 29 3a 6f 6b 70 61  |uitpanel(2):okpa|
00000de0  6e 65 6c 28 33 29 3d 6f  6b 70 61 6e 65 6c 28 31  |nel(3)=okpanel(1|
00000df0  29 2b 38 30 3a 6f 6b 70  61 6e 65 6c 28 34 29 3d  |)+80:okpanel(4)=|
00000e00  71 75 69 74 70 61 6e 65  6c 28 34 29 0d 03 d4 78  |quitpanel(4)...x|
00000e10  70 61 6e 65 6c 74 65 78  74 24 28 31 29 3d 22 52  |paneltext$(1)="R|
00000e20  4f 4c 4c 20 44 49 43 45  22 3a 20 70 61 6e 65 6c  |OLL DICE": panel|
00000e30  74 65 78 74 24 28 32 29  3d 22 4f 46 46 45 52 20  |text$(2)="OFFER |
00000e40  44 4f 55 42 4c 45 22 3a  20 70 61 6e 65 6c 74 65  |DOUBLE": panelte|
00000e50  78 74 24 28 33 29 20 3d  20 22 53 45 54 20 4f 50  |xt$(3) = "SET OP|
00000e60  54 49 4f 4e 53 22 3a 20  70 61 6e 65 6c 74 65 78  |TIONS": paneltex|
00000e70  74 24 28 34 29 20 3d 20  22 53 54 41 52 54 20 47  |t$(4) = "START G|
00000e80  41 4d 45 22 0d 03 de 4c  70 61 6e 65 6c 28 31 29  |AME"...Lpanel(1)|
00000e90  20 3d 20 62 6f 61 72 64  73 69 7a 65 2b 31 36 3a  | = boardsize+16:|
00000ea0  70 61 6e 65 6c 28 33 29  3d 70 61 6e 65 6c 28 31  |panel(3)=panel(1|
00000eb0  29 2b 32 30 30 3a 70 61  6e 65 6c 28 32 29 20 3d  |)+200:panel(2) =|
00000ec0  33 32 30 3a 70 61 6e 65  6c 28 34 29 3d 34 30 30  |320:panel(4)=400|
00000ed0  0d 03 e8 3b 64 69 63 65  70 61 6e 65 6c 28 29 3d  |...;dicepanel()=|
00000ee0  70 61 6e 65 6c 28 29 3a  64 69 63 65 70 61 6e 65  |panel():dicepane|
00000ef0  6c 28 32 29 2b 3d 31 30  30 3a 64 69 63 65 70 61  |l(2)+=100:dicepa|
00000f00  6e 65 6c 28 34 29 2b 3d  31 30 30 0d 03 f2 51 6d  |nel(4)+=100...Qm|
00000f10  6f 76 65 70 61 6e 65 6c  28 31 29 3d 70 61 6e 65  |ovepanel(1)=pane|
00000f20  6c 28 31 29 3a 6d 6f 76  65 70 61 6e 65 6c 28 33  |l(1):movepanel(3|
00000f30  29 3d 70 61 6e 65 6c 28  33 29 3a 6d 6f 76 65 70  |)=panel(3):movep|
00000f40  61 6e 65 6c 28 32 29 3d  37 33 30 3a 6d 6f 76 65  |anel(2)=730:move|
00000f50  70 61 6e 65 6c 28 34 29  3d 37 38 30 0d 03 fc 13  |panel(4)=780....|
00000f60  e3 20 70 61 6e 6e 6f 20  3d 20 31 20 b8 20 34 0d  |. panno = 1 . 4.|
00000f70  04 06 1e 70 61 6e 65 6c  73 28 31 2c 70 61 6e 6e  |...panels(1,pann|
00000f80  6f 29 20 3d 20 70 61 6e  65 6c 28 31 29 0d 04 10  |o) = panel(1)...|
00000f90  2c 70 61 6e 65 6c 73 28  32 2c 70 61 6e 6e 6f 29  |,panels(2,panno)|
00000fa0  20 3d 20 70 61 6e 65 6c  28 32 29 2d 31 30 30 2a  | = panel(2)-100*|
00000fb0  28 70 61 6e 6e 6f 2d 31  29 0d 04 1a 1e 70 61 6e  |(panno-1)....pan|
00000fc0  65 6c 73 28 33 2c 70 61  6e 6e 6f 29 20 3d 20 70  |els(3,panno) = p|
00000fd0  61 6e 65 6c 28 33 29 0d  04 24 2c 70 61 6e 65 6c  |anel(3)..$,panel|
00000fe0  73 28 34 2c 70 61 6e 6e  6f 29 20 3d 20 70 61 6e  |s(4,panno) = pan|
00000ff0  65 6c 28 34 29 2d 31 30  30 2a 28 70 61 6e 6e 6f  |el(4)-100*(panno|
00001000  2d 31 29 0d 04 2e 0b ed  20 70 61 6e 6e 6f 0d 04  |-1)..... panno..|
00001010  38 63 70 61 6e 65 6c 62  6f 78 28 31 29 3d 70 61  |8cpanelbox(1)=pa|
00001020  6e 65 6c 73 28 31 2c 34  29 3a 70 61 6e 65 6c 62  |nels(1,4):panelb|
00001030  6f 78 28 32 29 3d 70 61  6e 65 6c 73 28 32 2c 34  |ox(2)=panels(2,4|
00001040  29 3a 70 61 6e 65 6c 62  6f 78 28 33 29 3d 70 61  |):panelbox(3)=pa|
00001050  6e 65 6c 73 28 33 2c 31  29 3a 70 61 6e 65 6c 62  |nels(3,1):panelb|
00001060  6f 78 28 34 29 3d 70 61  6e 65 6c 73 28 34 2c 31  |ox(4)=panels(4,1|
00001070  29 0d 04 42 05 e1 0d 04  4c 04 0d 04 56 04 0d 04  |)..B....L...V...|
00001080  60 17 dd f2 69 6e 69 74  70 61 6e 65 6c 61 63 74  |`...initpanelact|
00001090  69 76 69 74 79 0d 04 6a  2d f4 20 73 65 74 73 20  |ivity..j-. sets |
000010a0  75 70 20 69 6e 69 74 69  61 6c 20 73 74 61 74 65  |up initial state|
000010b0  20 6f 66 20 70 61 6e 65  6c 20 61 63 74 69 76 69  | of panel activi|
000010c0  74 79 0d 04 74 50 70 61  6e 65 6c 61 63 74 69 76  |ty..tPpanelactiv|
000010d0  65 28 31 29 3d a3 3a 20  70 61 6e 65 6c 61 63 74  |e(1)=.: panelact|
000010e0  69 76 65 28 32 29 20 3d  20 a3 3a 20 70 61 6e 65  |ive(2) = .: pane|
000010f0  6c 61 63 74 69 76 65 28  33 29 20 3d 20 b9 3a 20  |lactive(3) = .: |
00001100  70 61 6e 65 6c 61 63 74  69 76 65 28 34 29 20 3d  |panelactive(4) =|
00001110  20 b9 0d 04 7e 05 e1 0d  04 88 04 0d 04 92 04 0d  | ...~...........|
00001120  04 9c 0b dd f2 62 6f 61  72 64 0d 04 a6 26 f4 20  |.....board...&. |
00001130  64 72 61 77 73 20 62 6f  61 72 64 20 61 74 20 73  |draws board at s|
00001140  74 61 72 74 20 6f 66 20  6e 65 77 20 67 61 6d 65  |tart of new game|
00001150  0d 04 b0 11 fb 20 31 32  38 2b 62 6c 61 63 6b 3a  |..... 128+black:|
00001160  db 0d 04 ba 07 ea 20 69  0d 04 c4 2b e3 20 69 20  |...... i...+. i |
00001170  3d 20 31 20 b8 20 32 34  3a 20 62 6f 61 72 64 3f  |= 1 . 24: board?|
00001180  69 20 3d 20 69 6e 69 74  62 6f 61 72 64 3f 69 3a  |i = initboard?i:|
00001190  ed 20 69 0d 04 ce 76 f4  20 46 4f 52 20 69 20 3d  |. i...v. FOR i =|
000011a0  20 31 20 54 4f 20 32 34  3a 20 62 6f 61 72 64 3f  | 1 TO 24: board?|
000011b0  69 20 3d 20 74 65 73 74  62 6f 61 72 64 3f 69 3a  |i = testboard?i:|
000011c0  4e 45 58 54 20 69 3a 62  6c 61 63 6b 70 69 65 63  |NEXT i:blackpiec|
000011d0  65 73 3d 31 31 3a 77 68  69 74 65 70 69 65 63 65  |es=11:whitepiece|
000011e0  73 3d 39 3a 62 6c 61 63  6b 6f 70 65 6e 69 6e 67  |s=9:blackopening|
000011f0  3d 46 41 4c 53 45 3a 77  68 69 74 65 6f 70 65 6e  |=FALSE:whiteopen|
00001200  69 6e 67 3d 46 41 4c 53  45 0d 04 d8 3b e6 20 6d  |ing=FALSE...;. m|
00001210  69 64 67 72 65 79 3a 20  c8 93 20 c8 90 20 62 6f  |idgrey: .. .. bo|
00001220  61 72 64 73 69 7a 65 2b  38 2c 30 2c 31 32 34 30  |ardsize+8,0,1240|
00001230  2d 62 6f 61 72 64 73 69  7a 65 2c 62 6f 61 72 64  |-boardsize,board|
00001240  73 69 7a 65 0d 04 e2 2a  e6 20 62 72 6f 77 6e 3a  |size...*. brown:|
00001250  20 c8 93 20 c8 90 20 30  2c 30 2c 62 6f 61 72 64  | .. .. 0,0,board|
00001260  73 69 7a 65 2c 62 6f 61  72 64 73 69 7a 65 0d 04  |size,boardsize..|
00001270  ec 57 e6 20 67 72 65 65  6e 3a 20 c8 93 20 c8 90  |.W. green: .. ..|
00001280  20 62 6f 72 64 65 72 73  69 7a 65 2c 62 6f 72 64  | bordersize,bord|
00001290  65 72 73 69 7a 65 2c 62  6f 61 72 64 73 69 7a 65  |ersize,boardsize|
000012a0  2d 32 2a 62 6f 72 64 65  72 73 69 7a 65 2c 20 62  |-2*bordersize, b|
000012b0  6f 61 72 64 73 69 7a 65  2d 32 2a 62 6f 72 64 65  |oardsize-2*borde|
000012c0  72 73 69 7a 65 0d 04 f6  55 e6 20 62 6c 61 63 6b  |rsize...U. black|
000012d0  3a 20 c8 93 20 20 62 6f  72 64 65 72 73 69 7a 65  |: ..  bordersize|
000012e0  2c 62 6f 72 64 65 72 73  69 7a 65 2c 62 6f 61 72  |,bordersize,boar|
000012f0  64 73 69 7a 65 2d 32 2a  62 6f 72 64 65 72 73 69  |dsize-2*bordersi|
00001300  7a 65 2c 20 62 6f 61 72  64 73 69 7a 65 2d 32 2a  |ze, boardsize-2*|
00001310  62 6f 72 64 65 72 73 69  7a 65 0d 05 00 21 ec 20  |bordersize...!. |
00001320  62 6f 72 64 65 72 73 69  7a 65 2c 62 6f 72 64 65  |bordersize,borde|
00001330  72 73 69 7a 65 3a df 20  30 2c 30 0d 05 0a 33 ec  |rsize:. 0,0...3.|
00001340  20 62 6f 72 64 65 72 73  69 7a 65 2c 62 6f 61 72  | bordersize,boar|
00001350  64 73 69 7a 65 2d 62 6f  72 64 65 72 73 69 7a 65  |dsize-bordersize|
00001360  3a df 20 30 2c 62 6f 61  72 64 73 69 7a 65 0d 05  |:. 0,boardsize..|
00001370  14 33 ec 20 62 6f 61 72  64 73 69 7a 65 2d 62 6f  |.3. boardsize-bo|
00001380  72 64 65 72 73 69 7a 65  2c 62 6f 72 64 65 72 73  |rdersize,borders|
00001390  69 7a 65 3a df 20 62 6f  61 72 64 73 69 7a 65 2c  |ize:. boardsize,|
000013a0  30 0d 05 1e 46 ec 20 62  6f 61 72 64 73 69 7a 65  |0...F. boardsize|
000013b0  2d 62 6f 72 64 65 72 73  69 7a 65 2c 62 6f 61 72  |-bordersize,boar|
000013c0  64 73 69 7a 65 2d 62 6f  72 64 65 72 73 69 7a 65  |dsize-bordersize|
000013d0  3a 20 df 20 62 6f 61 72  64 73 69 7a 65 2c 62 6f  |: . boardsize,bo|
000013e0  61 72 64 73 69 7a 65 0d  05 28 0f f2 64 72 61 77  |ardsize..(..draw|
000013f0  70 6f 69 6e 74 73 0d 05  32 0c f2 64 72 61 77 62  |points..2..drawb|
00001400  61 72 0d 05 3c 05 e1 0d  05 46 04 0d 05 50 04 0d  |ar..<....F...P..|
00001410  05 5a 16 dd f2 64 72 61  77 5f 69 6e 6e 65 72 5f  |.Z...draw_inner_|
00001420  72 65 63 74 73 0d 05 64  3c f4 20 62 6c 61 63 6b  |rects..d<. black|
00001430  20 6f 75 74 6c 69 6e 65  20 72 65 63 74 61 6e 67  | outline rectang|
00001440  6c 65 73 20 74 6f 20 72  65 70 6c 61 63 65 20 70  |les to replace p|
00001450  6f 73 73 69 62 6c 65 20  6f 62 73 63 75 72 69 6e  |ossible obscurin|
00001460  67 0d 05 6e 1c f4 20 62  79 20 72 65 64 72 61 77  |g..n.. by redraw|
00001470  69 6e 67 20 6f 66 20 70  6f 69 6e 74 73 0d 05 78  |ing of points..x|
00001480  1b ea 20 77 69 64 74 68  2c 68 65 69 67 68 74 2c  |.. width,height,|
00001490  62 61 72 72 69 67 68 74  0d 05 82 0b e6 20 62 6c  |barright..... bl|
000014a0  61 63 6b 0d 05 8c 2f 77  69 64 74 68 20 3d 20 28  |ack.../width = (|
000014b0  62 6f 61 72 64 73 69 7a  65 2d 62 61 72 77 69 64  |boardsize-barwid|
000014c0  74 68 29 2f 32 20 2d 20  62 6f 72 64 65 72 73 69  |th)/2 - bordersi|
000014d0  7a 65 0d 05 96 28 62 61  72 72 69 67 68 74 20 3d  |ze...(barright =|
000014e0  20 77 69 64 74 68 2b 62  6f 72 64 65 72 73 69 7a  | width+bordersiz|
000014f0  65 2b 62 61 72 77 69 64  74 68 0d 05 a0 21 68 65  |e+barwidth...!he|
00001500  69 67 68 74 3d 62 6f 61  72 64 73 69 7a 65 2d 32  |ight=boardsize-2|
00001510  2a 62 6f 72 64 65 72 73  69 7a 65 0d 05 aa 06 c8  |*bordersize.....|
00001520  96 0d 05 b4 29 c8 93 20  62 6f 72 64 65 72 73 69  |....).. bordersi|
00001530  7a 65 2c 62 6f 72 64 65  72 73 69 7a 65 2c 77 69  |ze,bordersize,wi|
00001540  64 74 68 2c 68 65 69 67  68 74 0d 05 be 06 c8 96  |dth,height......|
00001550  0d 05 c8 27 c8 93 20 62  61 72 72 69 67 68 74 2c  |...'.. barright,|
00001560  62 6f 72 64 65 72 73 69  7a 65 2c 77 69 64 74 68  |bordersize,width|
00001570  2c 68 65 69 67 68 74 0d  05 d2 05 e1 0d 05 dc 04  |,height.........|
00001580  0d 05 e6 14 dd f2 73 68  61 64 6f 77 5f 64 72 61  |......shadow_dra|
00001590  77 62 61 72 0d 05 f0 18  f2 73 77 69 74 63 68 5f  |wbar.....switch_|
000015a0  64 69 73 70 6c 61 79 5f  62 61 6e 6b 0d 05 fa 0c  |display_bank....|
000015b0  f2 64 72 61 77 62 61 72  0d 06 04 18 f2 73 77 69  |.drawbar.....swi|
000015c0  74 63 68 5f 64 69 73 70  6c 61 79 5f 62 61 6e 6b  |tch_display_bank|
000015d0  0d 06 0e 19 f2 73 68 61  64 6f 77 5f 62 6f 78 28  |.....shadow_box(|
000015e0  62 61 72 62 6f 78 28 29  29 0d 06 18 05 e1 0d 06  |barbox()).......|
000015f0  22 04 0d 06 2c 0d dd f2  64 72 61 77 62 61 72 0d  |"...,...drawbar.|
00001600  06 36 1b ea 20 62 61 72  6c 65 66 74 2c 78 2c 79  |.6.. barleft,x,y|
00001610  2c 78 6f 66 66 2c 79 6f  66 66 0d 06 40 24 62 61  |,xoff,yoff..@$ba|
00001620  72 6c 65 66 74 20 3d 20  28 62 6f 61 72 64 73 69  |rleft = (boardsi|
00001630  7a 65 2d 62 61 72 77 69  64 74 68 29 2f 32 0d 06  |ze-barwidth)/2..|
00001640  4a 2f e6 20 62 72 6f 77  6e 3a 20 c8 93 20 c8 90  |J/. brown: .. ..|
00001650  20 62 61 72 6c 65 66 74  2c 30 2c 62 61 72 77 69  | barleft,0,barwi|
00001660  64 74 68 2c 62 6f 61 72  64 73 69 7a 65 0d 06 54  |dth,boardsize..T|
00001670  50 e6 20 62 6c 61 63 6b  3a c8 93 20 28 62 6f 61  |P. black:.. (boa|
00001680  72 64 73 69 7a 65 2d 62  61 72 77 69 64 74 68 29  |rdsize-barwidth)|
00001690  2f 32 2c 62 6f 72 64 65  72 73 69 7a 65 2c 62 61  |/2,bordersize,ba|
000016a0  72 77 69 64 74 68 2c 62  6f 61 72 64 73 69 7a 65  |rwidth,boardsize|
000016b0  2d 32 2a 62 6f 72 64 65  72 73 69 7a 65 0d 06 5e  |-2*bordersize..^|
000016c0  31 e7 20 62 61 72 62 6c  61 63 6b 3e 30 20 8c 20  |1. barblack>0 . |
000016d0  f2 70 69 65 63 65 73 6f  6e 62 61 72 28 62 61 72  |.piecesonbar(bar|
000016e0  62 6c 61 63 6b 2c 22 62  6c 61 63 6b 22 29 0d 06  |black,"black")..|
000016f0  68 31 e7 20 62 61 72 77  68 69 74 65 3e 30 20 8c  |h1. barwhite>0 .|
00001700  20 f2 70 69 65 63 65 73  6f 6e 62 61 72 28 62 61  | .piecesonbar(ba|
00001710  72 77 68 69 74 65 2c 22  77 68 69 74 65 22 29 0d  |rwhite,"white").|
00001720  06 72 19 f4 20 64 72 61  77 20 64 6f 75 62 6c 65  |.r.. draw double|
00001730  69 6e 67 20 63 75 62 65  0d 06 7c 26 78 20 3d 20  |ing cube..|&x = |
00001740  62 61 72 6c 65 66 74 2b  31 30 3a 20 79 20 3d 20  |barleft+10: y = |
00001750  62 6f 61 72 64 73 69 7a  65 2f 32 2d 32 30 0d 06  |boardsize/2-20..|
00001760  86 0b e6 20 69 76 6f 72  79 0d 06 90 13 c8 93 20  |... ivory...... |
00001770  c8 90 20 78 2c 79 2c 35  34 2c 35 34 0d 06 9a 0b  |.. x,y,54,54....|
00001780  e6 20 62 6c 61 63 6b 0d  06 a4 10 c8 93 20 78 2c  |. black...... x,|
00001790  79 2c 35 34 2c 35 34 0d  06 ae 37 79 6f 66 66 20  |y,54,54...7yoff |
000017a0  3d 20 33 36 3a 20 e7 20  64 6f 75 62 6c 65 63 75  |= 36: . doublecu|
000017b0  62 65 20 3e 20 39 20 8c  20 78 6f 66 66 20 3d 20  |be > 9 . xoff = |
000017c0  31 30 20 8b 20 78 6f 66  66 20 3d 20 32 30 0d 06  |10 . xoff = 20..|
000017d0  b8 0f ef 20 35 3a 20 e6  20 62 6c 75 65 0d 06 c2  |... 5: . blue...|
000017e0  21 ec 20 78 2b 78 6f 66  66 2c 79 2b 79 6f 66 66  |!. x+xoff,y+yoff|
000017f0  3a f1 3b 20 64 6f 75 62  6c 65 63 75 62 65 0d 06  |:.; doublecube..|
00001800  cc 07 ef 20 34 0d 06 d6  35 f4 20 49 46 20 67 61  |... 4...5. IF ga|
00001810  6d 65 69 6e 70 72 6f 67  72 65 73 73 20 54 48 45  |meinprogress THE|
00001820  4e 20 50 52 4f 43 73 68  61 64 6f 77 5f 62 6f 78  |N PROCshadow_box|
00001830  28 62 61 72 62 6f 78 28  29 29 0d 06 e0 05 e1 0d  |(barbox())......|
00001840  06 ea 04 0d 06 f4 20 dd  f2 70 69 65 63 65 73 6f  |...... ..pieceso|
00001850  6e 62 61 72 28 6e 6f 70  69 65 63 65 73 2c 63 6f  |nbar(nopieces,co|
00001860  6c 24 29 0d 06 fe 0f ea  20 70 69 65 63 65 2c 78  |l$)..... piece,x|
00001870  2c 79 0d 07 08 0d c8 8e  20 63 6f 6c 24 20 ca 0d  |,y...... col$ ..|
00001880  07 12 0e c9 20 22 62 6c  61 63 6b 22 3a 0d 07 1c  |.... "black":...|
00001890  17 f2 73 74 61 72 74 70  6f 69 6e 74 28 31 38 2c  |..startpoint(18,|
000018a0  78 2c 79 29 0d 07 26 28  78 2b 3d 70 6f 69 6e 74  |x,y)..&(x+=point|
000018b0  77 69 64 74 68 2b 62 61  72 77 69 64 74 68 2f 32  |width+barwidth/2|
000018c0  2d 70 69 65 63 65 73 69  7a 65 2f 32 0d 07 30 0e  |-piecesize/2..0.|
000018d0  c9 20 22 77 68 69 74 65  22 3a 0d 07 3a 16 f2 73  |. "white":..:..s|
000018e0  74 61 72 74 70 6f 69 6e  74 28 37 2c 78 2c 79 29  |tartpoint(7,x,y)|
000018f0  0d 07 44 28 78 2b 3d 70  6f 69 6e 74 77 69 64 74  |..D(x+=pointwidt|
00001900  68 2b 62 61 72 77 69 64  74 68 2f 32 2d 70 69 65  |h+barwidth/2-pie|
00001910  63 65 73 69 7a 65 2f 32  0d 07 4e 05 cb 0d 07 58  |cesize/2..N....X|
00001920  1a e3 20 70 69 65 63 65  20 3d 20 31 20 b8 20 6e  |.. piece = 1 . n|
00001930  6f 70 69 65 63 65 73 0d  07 62 23 6f 66 66 73 65  |opieces..b#offse|
00001940  74 20 3d 20 28 70 69 65  63 65 2d 30 2e 35 30 29  |t = (piece-0.50)|
00001950  2a 70 69 65 63 65 73 69  7a 65 0d 07 6c 0d c8 8e  |*piecesize..l...|
00001960  20 63 6f 6c 24 20 ca 0d  07 76 0d c9 20 22 62 6c  | col$ ...v.. "bl|
00001970  61 63 6b 22 0d 07 80 23  79 20 3d 20 79 62 6f 74  |ack"...#y = ybot|
00001980  74 6f 6d 20 2b 6f 66 66  73 65 74 2d 70 69 65 63  |tom +offset-piec|
00001990  65 73 69 7a 65 2f 32 0d  07 8a 1e ec 20 78 2c 79  |esize/2..... x,y|
000019a0  3a f2 70 6c 6f 74 5f 73  70 72 69 74 65 28 63 6f  |:.plot_sprite(co|
000019b0  6c 24 2c 38 29 0d 07 94  0d c9 20 22 77 68 69 74  |l$,8)..... "whit|
000019c0  65 22 0d 07 9e 20 79 20  3d 20 79 74 6f 70 20 2d  |e"... y = ytop -|
000019d0  6f 66 66 73 65 74 2d 70  69 65 63 65 73 69 7a 65  |offset-piecesize|
000019e0  2f 32 0d 07 a8 1d ec 78  2c 79 3a f2 70 6c 6f 74  |/2.....x,y:.plot|
000019f0  5f 73 70 72 69 74 65 28  63 6f 6c 24 2c 38 29 0d  |_sprite(col$,8).|
00001a00  07 b2 05 cb 0d 07 bc 0b  ed 20 70 69 65 63 65 0d  |......... piece.|
00001a10  07 c6 05 e1 0d 07 d0 04  0d 07 da 10 dd f2 64 72  |..............dr|
00001a20  61 77 70 6f 69 6e 74 73  0d 07 e4 22 ea 20 70 6f  |awpoints...". po|
00001a30  69 6e 74 2c 70 6f 69 6e  74 63 6f 6c 6f 75 72 2c  |int,pointcolour,|
00001a40  73 74 61 72 74 70 6f 69  6e 74 0d 07 ee 14 e3 20  |startpoint..... |
00001a50  70 6f 69 6e 74 20 3d 20  31 20 b8 20 32 34 0d 07  |point = 1 . 24..|
00001a60  f8 15 f2 64 72 61 77 70  6f 69 6e 74 28 70 6f 69  |...drawpoint(poi|
00001a70  6e 74 29 0d 08 02 0b ed  20 70 6f 69 6e 74 0d 08  |nt)..... point..|
00001a80  0c 05 e1 0d 08 16 04 0d  08 20 21 dd f2 73 68 61  |......... !..sha|
00001a90  64 6f 77 5f 64 72 61 77  70 6f 69 6e 74 28 70 6f  |dow_drawpoint(po|
00001aa0  69 6e 74 2c 6d 66 62 29  0d 08 2a 0c ea 20 73 63  |int,mfb)..*.. sc|
00001ab0  72 65 65 6e 0d 08 34 1b  e7 20 6d 66 62 20 8c 20  |reen..4.. mfb . |
00001ac0  f2 73 68 61 64 6f 77 5f  64 72 61 77 62 61 72 0d  |.shadow_drawbar.|
00001ad0  08 3e 17 f2 73 77 69 74  63 68 5f 75 70 64 61 74  |.>..switch_updat|
00001ae0  65 5f 62 61 6e 6b 0d 08  48 15 f2 64 72 61 77 70  |e_bank..H..drawp|
00001af0  6f 69 6e 74 28 70 6f 69  6e 74 29 0d 08 52 18 f2  |oint(point)..R..|
00001b00  73 77 69 74 63 68 5f 64  69 73 70 6c 61 79 5f 62  |switch_display_b|
00001b10  61 6e 6b 0d 08 5c 1f f2  67 72 61 62 62 6f 78 28  |ank..\..grabbox(|
00001b20  70 6f 69 6e 74 62 6f 78  28 29 2c 22 74 65 6d 70  |pointbox(),"temp|
00001b30  22 29 0d 08 66 17 f2 73  77 69 74 63 68 5f 75 70  |")..f..switch_up|
00001b40  64 61 74 65 5f 62 61 6e  6b 0d 08 70 22 f2 72 65  |date_bank..p".re|
00001b50  73 74 6f 72 65 62 6f 78  28 70 6f 69 6e 74 62 6f  |storebox(pointbo|
00001b60  78 28 29 2c 22 74 65 6d  70 22 29 0d 08 7a 17 f2  |x(),"temp")..z..|
00001b70  73 77 69 74 63 68 5f 75  70 64 61 74 65 5f 62 61  |switch_update_ba|
00001b80  6e 6b 0d 08 84 05 e1 0d  08 8e 04 0d 08 98 16 dd  |nk..............|
00001b90  f2 64 72 61 77 70 6f 69  6e 74 28 70 6f 69 6e 74  |.drawpoint(point|
00001ba0  29 0d 08 a2 2e ea 20 70  69 65 63 65 2c 70 69 65  |)..... piece,pie|
00001bb0  63 65 73 2c 70 69 65 63  65 63 6f 6c 2c 6f 66 66  |ces,piececol,off|
00001bc0  73 65 74 2c 73 24 2c 72  2c 73 63 72 65 65 6e 0d  |set,s$,r,screen.|
00001bd0  08 ac 10 f4 20 44 72 61  77 20 70 6f 69 6e 74 0d  |.... Draw point.|
00001be0  08 b6 3e e7 20 70 6f 69  6e 74 20 3c 31 33 20 8c  |..>. point <13 .|
00001bf0  20 6f 66 66 73 65 74 20  3d 20 2d 70 6f 69 6e 74  | offset = -point|
00001c00  68 65 69 67 68 74 20 8b  20 6f 66 66 73 65 74 20  |height . offset |
00001c10  3d 20 70 6f 69 6e 74 68  65 69 67 68 74 0d 08 c0  |= pointheight...|
00001c20  3e f2 73 74 61 72 74 70  6f 69 6e 74 28 70 6f 69  |>.startpoint(poi|
00001c30  6e 74 2c 78 2c 79 29 3a  e6 67 72 65 65 6e 3a 20  |nt,x,y):.green: |
00001c40  c8 93 20 c8 90 20 78 2c  79 2c 70 6f 69 6e 74 77  |.. .. x,y,pointw|
00001c50  69 64 74 68 2c 6f 66 66  73 65 74 0d 08 ca 12 e7  |idth,offset.....|
00001c60  20 70 6f 69 6e 74 20 3e  20 31 32 20 8c 0d 08 d4  | point > 12 ....|
00001c70  4d 70 6f 69 6e 74 62 6f  78 28 31 29 3d 78 3a 70  |Mpointbox(1)=x:p|
00001c80  6f 69 6e 74 62 6f 78 28  32 29 3d 79 3a 70 6f 69  |ointbox(2)=y:poi|
00001c90  6e 74 62 6f 78 28 33 29  3d 78 2b 70 6f 69 6e 74  |ntbox(3)=x+point|
00001ca0  77 69 64 74 68 3a 70 6f  69 6e 74 62 6f 78 28 34  |width:pointbox(4|
00001cb0  29 3d 79 2b 6f 66 66 73  65 74 0d 08 de 05 cc 0d  |)=y+offset......|
00001cc0  08 e8 4d 70 6f 69 6e 74  62 6f 78 28 31 29 3d 78  |..Mpointbox(1)=x|
00001cd0  3a 70 6f 69 6e 74 62 6f  78 28 32 29 3d 79 2b 6f  |:pointbox(2)=y+o|
00001ce0  66 66 73 65 74 3a 70 6f  69 6e 74 62 6f 78 28 33  |ffset:pointbox(3|
00001cf0  29 3d 78 2b 70 6f 69 6e  74 77 69 64 74 68 3a 70  |)=x+pointwidth:p|
00001d00  6f 69 6e 74 62 6f 78 28  34 29 3d 79 0d 08 f2 05  |ointbox(4)=y....|
00001d10  cd 0d 08 fc 41 e7 20 70  6f 69 6e 74 20 83 20 32  |....A. point . 2|
00001d20  20 3d 20 31 20 8c 20 70  6f 69 6e 74 63 6f 6c 6f  | = 1 . pointcolo|
00001d30  75 72 20 3d 20 6c 69 67  68 74 67 72 65 79 20 8b  |ur = lightgrey .|
00001d40  20 70 6f 69 6e 74 63 6f  6c 6f 75 72 20 3d 20 72  | pointcolour = r|
00001d50  65 64 0d 09 06 11 e6 20  70 6f 69 6e 74 63 6f 6c  |ed..... pointcol|
00001d60  6f 75 72 0d 09 10 1b ec  20 78 2c 79 3a 20 ec 20  |our..... x,y: . |
00001d70  78 2b 70 6f 69 6e 74 77  69 64 74 68 2c 79 0d 09  |x+pointwidth,y..|
00001d80  1a 53 e7 20 70 6f 69 6e  74 20 3c 20 31 33 20 8c  |.S. point < 13 .|
00001d90  20 f0 20 38 31 2c 2d 70  6f 69 6e 74 77 69 64 74  | . 81,-pointwidt|
00001da0  68 2f 32 2c 2d 70 6f 69  6e 74 68 65 69 67 68 74  |h/2,-pointheight|
00001db0  20 8b 20 f0 20 38 31 2c  2d 70 6f 69 6e 74 77 69  | . . 81,-pointwi|
00001dc0  64 74 68 2f 32 2c 70 6f  69 6e 74 68 65 69 67 68  |dth/2,pointheigh|
00001dd0  74 0d 09 24 1a f4 20 44  72 61 77 20 70 69 65 63  |t..$.. Draw piec|
00001de0  65 73 20 6f 6e 20 70 6f  69 6e 74 0d 09 2e 18 70  |es on point....p|
00001df0  69 65 63 65 73 20 3d 20  62 6f 61 72 64 3f 70 6f  |ieces = board?po|
00001e00  69 6e 74 0d 09 38 11 e7  20 70 69 65 63 65 73 20  |int..8.. pieces |
00001e10  3e 30 20 8c 0d 09 42 4c  e7 20 70 69 65 63 65 73  |>0 ...BL. pieces|
00001e20  20 3e 31 32 38 20 8c 20  70 69 65 63 65 63 6f 6c  | >128 . piececol|
00001e30  20 3d 20 62 6c 61 63 6b  3a 20 70 69 65 63 65 73  | = black: pieces|
00001e40  20 3d 20 70 69 65 63 65  73 20 83 20 31 32 38 20  | = pieces . 128 |
00001e50  8b 20 70 69 65 63 65 63  6f 6c 3d 77 68 69 74 65  |. piececol=white|
00001e60  0d 09 4c 11 72 3d 70 69  65 63 65 73 69 7a 65 2f  |..L.r=piecesize/|
00001e70  32 0d 09 56 1f 78 2b 3d  20 70 6f 69 6e 74 77 69  |2..V.x+= pointwi|
00001e80  64 74 68 2f 32 2d 72 3a  20 70 69 65 63 65 3d 30  |dth/2-r: piece=0|
00001e90  0d 09 60 30 e7 20 70 69  65 63 65 63 6f 6c 20 3d  |..`0. piececol =|
00001ea0  20 77 68 69 74 65 20 8c  20 73 24 3d 22 77 68 69  | white . s$="whi|
00001eb0  74 65 22 20 8b 20 73 24  3d 22 62 6c 61 63 6b 22  |te" . s$="black"|
00001ec0  0d 09 6a 0f f5 3a 20 70  69 65 63 65 2b 3d 31 0d  |..j..: piece+=1.|
00001ed0  09 74 23 6f 66 66 73 65  74 20 3d 20 28 70 69 65  |.t#offset = (pie|
00001ee0  63 65 2d 30 2e 35 30 29  2a 70 69 65 63 65 73 69  |ce-0.50)*piecesi|
00001ef0  7a 65 0d 09 7e 3f e7 20  70 6f 69 6e 74 20 3c 20  |ze..~?. point < |
00001f00  31 33 20 8c 20 79 20 3d  20 79 74 6f 70 20 2d 20  |13 . y = ytop - |
00001f10  6f 66 66 73 65 74 2d 72  20 8b 20 79 20 3d 20 79  |offset-r . y = y|
00001f20  62 6f 74 74 6f 6d 20 2b  20 6f 66 66 73 65 74 2d  |bottom + offset-|
00001f30  72 0d 09 88 30 f4 20 47  43 4f 4c 20 70 69 65 63  |r...0. GCOL piec|
00001f40  65 63 6f 6c 3a 20 43 49  52 43 4c 45 20 46 49 4c  |ecol: CIRCLE FIL|
00001f50  4c 20 78 2c 79 2c 70 69  65 63 65 73 69 7a 65 2f  |L x,y,piecesize/|
00001f60  32 0d 09 92 42 f4 20 49  46 20 70 69 65 63 65 63  |2...B. IF piecec|
00001f70  6f 6c 20 3d 20 77 68 69  74 65 20 54 48 45 4e 20  |ol = white THEN |
00001f80  47 43 4f 4c 20 62 6c 61  63 6b 3a 20 43 49 52 43  |GCOL black: CIRC|
00001f90  4c 45 20 20 78 2c 79 2c  70 69 65 63 65 73 69 7a  |LE  x,y,piecesiz|
00001fa0  65 2f 32 0d 09 9c 1d ec  20 78 2c 79 3a 20 f2 70  |e/2..... x,y: .p|
00001fb0  6c 6f 74 5f 73 70 72 69  74 65 28 73 24 2c 38 29  |lot_sprite(s$,8)|
00001fc0  0d 09 a6 20 fd 20 70 69  65 63 65 20 3d 20 70 69  |... . piece = pi|
00001fd0  65 63 65 73 20 84 20 70  69 65 63 65 20 3d 20 36  |eces . piece = 6|
00001fe0  0d 09 b0 36 e7 20 70 69  65 63 65 73 20 3e 36 20  |...6. pieces >6 |
00001ff0  8c 20 f2 6e 75 6d 62 65  72 70 69 6c 65 28 70 69  |. .numberpile(pi|
00002000  65 63 65 73 2c 78 2b 72  2c 79 2b 72 2c 70 69 65  |eces,x+r,y+r,pie|
00002010  63 65 63 6f 6c 29 0d 09  ba 05 cd 0d 09 c4 61 f4  |cecol)........a.|
00002020  20 47 43 4f 4c 20 62 6c  61 63 6b 3a 20 52 45 43  | GCOL black: REC|
00002030  54 41 4e 47 4c 45 20 20  62 6f 72 64 65 72 73 69  |TANGLE  bordersi|
00002040  7a 65 2c 62 6f 72 64 65  72 73 69 7a 65 2c 62 6f  |ze,bordersize,bo|
00002050  61 72 64 73 69 7a 65 2d  32 2a 62 6f 72 64 65 72  |ardsize-2*border|
00002060  73 69 7a 65 2c 20 62 6f  61 72 64 73 69 7a 65 2d  |size, boardsize-|
00002070  32 2a 62 6f 72 64 65 72  73 69 7a 65 0d 09 ce 15  |2*bordersize....|
00002080  f2 64 72 61 77 5f 69 6e  6e 65 72 5f 72 65 63 74  |.draw_inner_rect|
00002090  73 0d 09 d8 05 e1 0d 09  e2 04 0d 09 ec 1f dd f2  |s...............|
000020a0  73 74 61 72 74 70 6f 69  6e 74 28 70 6f 69 6e 74  |startpoint(point|
000020b0  2c f8 20 78 2c f8 20 79  29 0d 09 f6 2f f4 20 66  |,. x,. y).../. f|
000020c0  69 6e 64 73 20 74 6f 70  20 6c 65 66 74 20 68 61  |inds top left ha|
000020d0  6e 64 20 63 6f 2d 6f 72  64 69 6e 61 74 65 73 20  |nd co-ordinates |
000020e0  6f 66 20 70 6f 69 6e 74  0d 0a 00 3a e7 20 70 6f  |of point...:. po|
000020f0  69 6e 74 20 3c 31 33 20  8c 20 79 20 3d 20 79 74  |int <13 . y = yt|
00002100  6f 70 20 8b 20 79 20 3d  20 79 62 6f 74 74 6f 6d  |op . y = ybottom|
00002110  3a 20 70 6f 69 6e 74 20  3d 20 32 35 2d 70 6f 69  |: point = 25-poi|
00002120  6e 74 0d 0a 0a 2d 78 20  3d 20 62 6f 61 72 64 73  |nt...-x = boards|
00002130  69 7a 65 2d 62 6f 72 64  65 72 73 69 7a 65 2d 70  |ize-bordersize-p|
00002140  6f 69 6e 74 2a 70 6f 69  6e 74 77 69 64 74 68 0d  |oint*pointwidth.|
00002150  0a 14 1e e7 20 70 6f 69  6e 74 20 3e 20 36 20 8c  |.... point > 6 .|
00002160  20 78 2d 3d 20 62 61 72  77 69 64 74 68 0d 0a 1e  | x-= barwidth...|
00002170  05 e1 0d 0a 28 04 0d 0a  32 10 dd f2 69 6e 69 74  |....(...2...init|
00002180  70 69 65 63 65 73 0d 0a  3c 12 ea 20 70 6f 69 6e  |pieces..<.. poin|
00002190  74 2c 70 69 65 63 65 73  0d 0a 46 12 de 20 74 65  |t,pieces..F.. te|
000021a0  73 74 62 6f 61 72 64 20  32 34 0d 0a 50 14 e3 20  |stboard 24..P.. |
000021b0  70 6f 69 6e 74 20 3d 20  31 20 b8 20 32 34 0d 0a  |point = 1 . 24..|
000021c0  5a 26 f3 20 70 69 65 63  65 73 3a 20 69 6e 69 74  |Z&. pieces: init|
000021d0  62 6f 61 72 64 3f 70 6f  69 6e 74 20 3d 20 70 69  |board?point = pi|
000021e0  65 63 65 73 0d 0a 64 0b  ed 20 70 6f 69 6e 74 0d  |eces..d.. point.|
000021f0  0a 6e 45 dc 20 32 2c 30  2c 30 2c 30 2c 30 2c 31  |.nE. 2,0,0,0,0,1|
00002200  32 38 2b 35 2c 30 2c 31  32 38 2b 33 2c 30 2c 30  |28+5,0,128+3,0,0|
00002210  2c 30 2c 35 2c 31 32 38  2b 35 2c 30 2c 30 2c 30  |,0,5,128+5,0,0,0|
00002220  2c 33 2c 30 2c 35 2c 30  2c 30 2c 30 2c 30 2c 31  |,3,0,5,0,0,0,0,1|
00002230  32 38 2b 32 0d 0a 78 14  e3 20 70 6f 69 6e 74 20  |28+2..x.. point |
00002240  3d 20 31 20 b8 20 32 34  0d 0a 82 26 f3 20 70 69  |= 1 . 24...&. pi|
00002250  65 63 65 73 3a 20 74 65  73 74 62 6f 61 72 64 3f  |eces: testboard?|
00002260  70 6f 69 6e 74 20 3d 20  70 69 65 63 65 73 0d 0a  |point = pieces..|
00002270  8c 0b ed 20 70 6f 69 6e  74 0d 0a 96 45 dc 20 31  |... point...E. 1|
00002280  32 38 2b 33 2c 33 2c 30  2c 30 2c 30 2c 31 32 38  |28+3,3,0,0,0,128|
00002290  2b 32 2c 30 2c 31 32 38  2b 33 2c 30 2c 30 2c 30  |+2,0,128+3,0,0,0|
000022a0  2c 30 2c 30 2c 30 2c 30  2c 30 2c 30 2c 30 2c 30  |,0,0,0,0,0,0,0,0|
000022b0  2c 32 2c 30 2c 31 32 38  2b 33 2c 30 2c 34 0d 0a  |,2,0,128+3,0,4..|
000022c0  a0 19 62 61 72 77 68 69  74 65 3d 30 3a 62 61 72  |..barwhite=0:bar|
000022d0  62 6c 61 63 6b 3d 30 0d  0a aa 05 e1 0d 0a b4 04  |black=0.........|
000022e0  0d 0a be 21 dd f2 6e 75  6d 62 65 72 70 69 6c 65  |...!..numberpile|
000022f0  28 6e 6f 2c 78 2c 79 2c  70 69 65 63 65 63 6f 6c  |(no,x,y,piececol|
00002300  29 0d 0a c8 15 ea 20 6e  6f 63 6f 6c 2c 78 6f 66  |)..... nocol,xof|
00002310  66 2c 79 6f 66 66 0d 0a  d2 30 79 6f 66 66 20 3d  |f,yoff...0yoff =|
00002320  20 31 32 3a 20 e7 20 6e  6f 20 3e 20 39 20 8c 20  | 12: . no > 9 . |
00002330  78 6f 66 66 20 3d 20 2d  31 36 20 8b 20 78 6f 66  |xoff = -16 . xof|
00002340  66 20 3d 20 2d 38 0d 0a  dc 36 e7 20 70 69 65 63  |f = -8...6. piec|
00002350  65 63 6f 6c 20 3d 20 62  6c 61 63 6b 20 8c 20 6e  |ecol = black . n|
00002360  6f 63 6f 6c 20 3d 20 77  68 69 74 65 20 8b 20 6e  |ocol = white . n|
00002370  6f 63 6f 6c 20 3d 20 62  6c 61 63 6b 0d 0a e6 10  |ocol = black....|
00002380  ef 20 35 3a 20 e6 20 6e  6f 63 6f 6c 0d 0a f0 19  |. 5: . nocol....|
00002390  ec 20 78 2b 78 6f 66 66  2c 79 2b 79 6f 66 66 3a  |. x+xoff,y+yoff:|
000023a0  f1 3b 20 6e 6f 0d 0a fa  07 ef 20 34 0d 0b 04 05  |.; no..... 4....|
000023b0  e1 0d 0b 0e 04 0d 0b 18  29 f4 20 4d 6f 75 73 65  |........). Mouse|
000023c0  20 61 6e 64 20 73 70 72  69 74 65 20 6c 69 62 72  | and sprite libr|
000023d0  61 72 79 20 70 72 6f 63  65 64 75 72 65 73 0d 0b  |ary procedures..|
000023e0  22 29 f4 20 3d 3d 3d 3d  3d 3d 3d 3d 3d 3d 3d 3d  |"). ============|
000023f0  3d 3d 3d 3d 3d 3d 3d 3d  3d 3d 3d 3d 3d 3d 3d 3d  |================|
00002400  3d 3d 3d 3d 3d 3d 3d 0d  0b 2c 04 0d 0b 36 2f dd  |=======..,...6/.|
00002410  f2 64 72 61 77 74 65 78  74 62 6f 78 28 62 6f 78  |.drawtextbox(box|
00002420  28 29 2c 74 65 78 74 24  2c 62 6f 78 63 6f 6c 25  |(),text$,boxcol%|
00002430  2c 74 65 78 74 63 6f 6c  25 29 0d 0b 40 27 f4 20  |,textcol%)..@'. |
00002440  44 72 61 77 73 20 75 6e  66 69 6c 6c 65 64 20 62  |Draws unfilled b|
00002450  6f 78 20 63 6f 6c 6f 75  72 20 62 6f 78 63 6f 6c  |ox colour boxcol|
00002460  25 0d 0b 4a 37 f4 20 61  6e 64 20 63 65 6e 74 72  |%..J7. and centr|
00002470  65 73 20 74 65 78 74 20  6c 61 62 65 6c 20 70 72  |es text label pr|
00002480  69 6e 74 65 64 20 69 6e  20 63 6f 6c 6f 75 72 20  |inted in colour |
00002490  74 65 78 74 63 6f 6c 25  0d 0b 54 33 ea 20 62 6f  |textcol%..T3. bo|
000024a0  78 77 69 64 74 68 25 2c  62 6f 78 68 65 69 67 68  |xwidth%,boxheigh|
000024b0  74 25 2c 74 65 78 74 77  69 64 74 68 25 2c 20 74  |t%,textwidth%, t|
000024c0  65 78 74 78 2c 20 74 65  78 74 79 0d 0b 5e 11 ef  |extx, texty..^..|
000024d0  35 3a 20 e6 20 62 6f 78  63 6f 6c 25 0d 0b 68 33  |5: . boxcol%..h3|
000024e0  c8 93 20 c8 90 20 62 6f  78 28 31 29 2c 62 6f 78  |.. .. box(1),box|
000024f0  28 32 29 2c 62 6f 78 28  33 29 2d 62 6f 78 28 31  |(2),box(3)-box(1|
00002500  29 2c 62 6f 78 28 34 29  2d 62 6f 78 28 32 29 0d  |),box(4)-box(2).|
00002510  0b 72 38 e6 20 62 6c 61  63 6b 3a c8 93 20 62 6f  |.r8. black:.. bo|
00002520  78 28 31 29 2c 62 6f 78  28 32 29 2c 62 6f 78 28  |x(1),box(2),box(|
00002530  33 29 2d 62 6f 78 28 31  29 2c 62 6f 78 28 34 29  |3)-box(1),box(4)|
00002540  2d 62 6f 78 28 32 29 0d  0b 7c 21 74 65 78 74 77  |-box(2)..|!textw|
00002550  69 64 74 68 25 3d a9 28  74 65 78 74 24 29 2a 31  |idth%=.(text$)*1|
00002560  32 38 30 20 81 20 38 30  0d 0b 86 1d 62 6f 78 77  |280 . 80....boxw|
00002570  69 64 74 68 25 20 3d 20  62 6f 78 28 33 29 2d 62  |idth% = box(3)-b|
00002580  6f 78 28 31 29 0d 0b 90  20 62 6f 78 68 65 69 67  |ox(1)... boxheig|
00002590  68 74 25 20 3d 20 62 6f  78 28 34 29 20 2d 20 62  |ht% = box(4) - b|
000025a0  6f 78 28 32 29 0d 0b 9a  2d 74 65 78 74 78 20 3d  |ox(2)...-textx =|
000025b0  20 62 6f 78 28 31 29 2b  28 62 6f 78 77 69 64 74  | box(1)+(boxwidt|
000025c0  68 25 2d 74 65 78 74 77  69 64 74 68 25 29 20 81  |h%-textwidth%) .|
000025d0  20 32 0d 0b a4 2b 74 65  78 74 79 20 3d 20 62 6f  | 2...+texty = bo|
000025e0  78 28 32 29 2b 28 62 6f  78 68 65 69 67 68 74 25  |x(2)+(boxheight%|
000025f0  2d 31 36 29 20 81 20 32  20 2b 20 31 36 0d 0b ae  |-16) . 2 + 16...|
00002600  0e e6 20 74 65 78 74 63  6f 6c 25 0d 0b b8 11 ec  |.. textcol%.....|
00002610  20 74 65 78 74 78 2c 74  65 78 74 79 0d 0b c2 0b  | textx,texty....|
00002620  f1 20 74 65 78 74 24 0d  0b cc 06 ef 34 0d 0b d6  |. text$.....4...|
00002630  05 e1 0d 0b e0 04 0d 0b  ea 20 dd a4 6d 6f 75 73  |......... ..mous|
00002640  65 69 6e 62 6f 78 28 62  6f 78 28 29 2c f8 20 62  |einbox(box(),. b|
00002650  75 74 74 6f 6e 29 0d 0b  f4 3f f4 20 52 65 74 75  |utton)...?. Retu|
00002660  72 6e 73 20 54 52 55 45  20 69 66 20 6d 6f 75 73  |rns TRUE if mous|
00002670  65 20 63 6c 69 63 6b 65  64 20 69 6e 73 69 64 65  |e clicked inside|
00002680  20 62 6f 78 2c 20 6f 74  68 65 72 77 69 73 65 20  | box, otherwise |
00002690  46 41 4c 53 45 0d 0b fe  33 f4 20 41 6c 73 6f 20  |FALSE...3. Also |
000026a0  72 65 74 75 72 6e 73 20  76 61 72 69 61 62 6c 65  |returns variable|
000026b0  20 68 6f 6c 64 69 6e 67  20 76 61 6c 75 65 20 6f  | holding value o|
000026c0  66 20 62 75 74 74 6f 6e  0d 0c 08 0b ea 20 78 2c  |f button..... x,|
000026d0  79 2c 74 0d 0c 12 09 2a  46 58 31 35 0d 0c 1c 11  |y,t....*FX15....|
000026e0  c8 97 20 78 2c 79 2c 62  75 74 74 6f 6e 0d 0c 26  |.. x,y,button..&|
000026f0  0e e7 20 62 75 74 74 6f  6e 20 8c 0d 0c 30 0d f2  |.. button ...0..|
00002700  64 65 6c 61 79 28 31 29  0d 0c 3a 2f f4 20 64 65  |delay(1)..:/. de|
00002710  6c 61 79 20 74 6f 20 67  69 76 65 20 75 73 65 72  |lay to give user|
00002720  20 74 69 6d 65 20 74 6f  20 72 65 6c 65 61 73 65  | time to release|
00002730  20 62 75 74 74 6f 6e 0d  0c 44 45 e7 20 78 3e 3d  | button..DE. x>=|
00002740  20 62 6f 78 28 31 29 20  80 20 78 20 3c 3d 20 62  | box(1) . x <= b|
00002750  6f 78 28 33 29 20 80 20  79 20 3e 3d 20 62 6f 78  |ox(3) . y >= box|
00002760  28 32 29 20 80 20 79 20  3c 3d 20 62 6f 78 28 34  |(2) . y <= box(4|
00002770  29 20 8c 20 3d 20 b9 20  8b 20 3d a3 0d 0c 4e 05  |) . = . . =...N.|
00002780  cc 0d 0c 58 06 3d a3 0d  0c 62 05 cd 0d 0c 6c 04  |...X.=...b....l.|
00002790  0d 0c 76 21 dd f2 70 6c  6f 74 5f 73 70 72 69 74  |..v!..plot_sprit|
000027a0  65 28 73 70 72 69 74 65  24 2c 61 63 74 69 6f 6e  |e(sprite$,action|
000027b0  29 0d 0c 80 1d f4 20 50  6c 6f 74 73 20 73 70 72  |)..... Plots spr|
000027c0  69 74 65 20 75 73 69 6e  67 20 6d 61 73 6b 0d 0c  |ite using mask..|
000027d0  8a 37 c8 99 20 22 4f 53  5f 53 70 72 69 74 65 4f  |.7.. "OS_SpriteO|
000027e0  70 22 2c 32 35 36 2b 32  38 2c 73 70 72 69 74 65  |p",256+28,sprite|
000027f0  61 72 65 61 2c 73 70 72  69 74 65 24 2c 2c 2c 61  |area,sprite$,,,a|
00002800  63 74 69 6f 6e 0d 0c 94  05 e1 0d 0c 9e 04 0d 0c  |ction...........|
00002810  a8 1f dd f2 67 65 74 5f  73 70 72 69 74 65 28 73  |....get_sprite(s|
00002820  70 72 69 74 65 24 2c 62  6f 78 28 29 29 0d 0c b2  |prite$,box())...|
00002830  23 ec 20 62 6f 78 28 31  29 2c 62 6f 78 28 32 29  |#. box(1),box(2)|
00002840  3a ec 20 62 6f 78 28 33  29 2c 62 6f 78 28 34 29  |:. box(3),box(4)|
00002850  0d 0c bc 2e c8 99 20 22  4f 53 5f 53 70 72 69 74  |...... "OS_Sprit|
00002860  65 4f 70 22 2c 32 35 36  2b 31 34 2c 73 70 72 69  |eOp",256+14,spri|
00002870  74 65 61 72 65 61 2c 73  70 72 69 74 65 24 0d 0c  |tearea,sprite$..|
00002880  c6 05 e1 0d 0c d0 04 0d  0c da 1c dd f2 67 72 61  |.............gra|
00002890  62 62 6f 78 28 62 6f 78  28 29 2c 73 70 72 69 74  |bbox(box(),sprit|
000028a0  65 24 29 0d 0c e4 2e f4  20 67 72 61 62 73 20 74  |e$)..... grabs t|
000028b0  68 65 20 73 63 72 65 65  6e 20 61 72 65 61 20 64  |he screen area d|
000028c0  65 66 69 6e 65 64 20 62  79 20 62 6f 78 20 61 6e  |efined by box an|
000028d0  64 0d 0c ee 29 f4 20 73  61 76 65 73 20 69 74 20  |d...). saves it |
000028e0  61 73 20 61 20 73 70 72  69 74 65 20 63 61 6c 6c  |as a sprite call|
000028f0  65 64 20 73 70 72 69 74  65 24 0d 0c f8 1e f2 67  |ed sprite$.....g|
00002900  65 74 5f 73 70 72 69 74  65 28 73 70 72 69 74 65  |et_sprite(sprite|
00002910  24 2c 62 6f 78 28 29 29  0d 0d 02 05 e1 0d 0d 0c  |$,box())........|
00002920  04 0d 0d 16 1f dd f2 72  65 73 74 6f 72 65 62 6f  |.......restorebo|
00002930  78 28 62 6f 78 28 29 2c  73 70 72 69 74 65 24 29  |x(box(),sprite$)|
00002940  0d 0d 20 38 f4 20 72 65  73 74 6f 72 65 73 20 73  |.. 8. restores s|
00002950  63 72 65 65 6e 20 61 72  65 61 20 64 65 66 69 6e  |creen area defin|
00002960  65 64 20 62 79 20 62 6f  78 20 61 6e 64 20 70 72  |ed by box and pr|
00002970  65 76 69 6f 75 73 6c 79  0d 0d 2a 1a f4 20 73 61  |eviously..*.. sa|
00002980  76 65 64 20 62 79 20 50  52 4f 43 67 72 61 62 62  |ved by PROCgrabb|
00002990  6f 78 0d 0d 34 13 ec 20  62 6f 78 28 31 29 2c 62  |ox..4.. box(1),b|
000029a0  6f 78 28 32 29 0d 0d 3e  1b f2 70 6c 6f 74 5f 73  |ox(2)..>..plot_s|
000029b0  70 72 69 74 65 28 73 70  72 69 74 65 24 2c 30 29  |prite(sprite$,0)|
000029c0  0d 0d 48 14 f2 64 65 6c  61 79 28 32 30 29 3a 2a  |..H..delay(20):*|
000029d0  46 58 31 35 0d 0d 52 05  e1 0d 0d 5c 04 0d 0d 66  |FX15..R....\...f|
000029e0  1a dd f2 67 72 61 70 68  69 63 77 69 6e 64 6f 77  |...graphicwindow|
000029f0  28 62 6f 78 28 29 29 0d  0d 70 3b f4 20 63 72 65  |(box())..p;. cre|
00002a00  61 74 65 73 20 67 72 61  70 68 69 63 20 77 69 6e  |ates graphic win|
00002a10  64 6f 77 20 6f 66 20 74  68 65 20 61 72 65 61 20  |dow of the area |
00002a20  73 70 65 63 69 66 69 65  64 20 62 79 20 62 6f 78  |specified by box|
00002a30  28 29 0d 0d 7a 24 ef 32  34 2c 62 6f 78 28 31 29  |()..z$.24,box(1)|
00002a40  3b 62 6f 78 28 32 29 3b  62 6f 78 28 33 29 3b 62  |;box(2);box(3);b|
00002a50  6f 78 28 34 29 3b 0d 0d  84 05 e1 0d 0d 8e 04 0d  |ox(4);..........|
00002a60  0d 98 2c f4 20 45 6e 64  20 6f 66 20 6d 6f 75 73  |..,. End of mous|
00002a70  65 2f 73 70 72 69 74 65  20 6c 69 62 72 61 72 79  |e/sprite library|
00002a80  20 70 72 6f 63 65 64 75  72 65 73 0d 0d a2 2c f4  | procedures...,.|
00002a90  20 3d 3d 3d 3d 3d 3d 3d  3d 3d 3d 3d 3d 3d 3d 3d  | ===============|
00002aa0  3d 3d 3d 3d 3d 3d 3d 3d  3d 3d 3d 3d 3d 3d 3d 3d  |================|
00002ab0  3d 3d 3d 3d 3d 3d 3d 0d  0d ac 04 0d 0d b6 0a dd  |=======.........|
00002ac0  f2 64 69 63 65 0d 0d c0  1f e7 20 73 74 61 72 74  |.dice..... start|
00002ad0  73 65 74 20 8c 20 73 74  61 72 74 73 65 74 20 3d  |set . startset =|
00002ae0  20 a3 3a e1 0d 0d ca 49  e7 20 77 68 69 74 65 74  | .:....I. whitet|
00002af0  75 72 6e 20 8c 20 f2 72  6f 6c 6c 64 69 63 65 28  |urn . .rolldice(|
00002b00  77 68 69 74 65 74 68 72  6f 77 62 6f 78 28 29 29  |whitethrowbox())|
00002b10  20 8b 20 f2 72 6f 6c 6c  64 69 63 65 28 62 6c 61  | . .rolldice(bla|
00002b20  63 6b 74 68 72 6f 77 62  6f 78 28 29 29 0d 0d d4  |ckthrowbox())...|
00002b30  05 e1 0d 0d de 04 0d 0d  e8 1a dd f2 72 6f 6c 6c  |............roll|
00002b40  64 69 63 65 28 74 68 72  6f 77 62 6f 78 28 29 29  |dice(throwbox())|
00002b50  0d 0d f2 2a ea 20 78 31  2c 79 31 2c 78 32 2c 79  |...*. x1,y1,x2,y|
00002b60  32 2c 74 6f 73 73 2c 6e  74 6f 73 73 65 73 2c 61  |2,toss,ntosses,a|
00002b70  2c 64 2c 70 2c 63 6f 75  6e 74 0d 0d fc 2c f2 64  |,d,p,count...,.d|
00002b80  72 61 77 74 65 78 74 62  6f 78 28 64 69 63 65 70  |rawtextbox(dicep|
00002b90  61 6e 65 6c 28 29 2c 22  22 2c 69 76 6f 72 79 2c  |anel(),"",ivory,|
00002ba0  69 76 6f 72 79 29 0d 0e  06 17 6e 74 6f 73 73 65  |ivory)....ntosse|
00002bb0  73 3d 31 32 3a 63 6f 75  6e 74 20 3d 30 0d 0e 10  |s=12:count =0...|
00002bc0  0c f4 20 52 45 50 45 41  54 0d 0e 1a 18 e3 20 74  |.. REPEAT..... t|
00002bd0  6f 73 73 20 3d 20 31 20  b8 20 6e 74 6f 73 73 65  |oss = 1 . ntosse|
00002be0  73 0d 0e 24 19 64 69 63  65 31 3d b3 28 36 29 3a  |s..$.dice1=.(6):|
00002bf0  64 69 63 65 32 3d b3 28  36 29 0d 0e 25 04 0d 0e  |dice2=.(6)..%...|
00002c00  2e 1e f4 20 54 68 69 73  20 69 73 20 74 68 65 20  |... This is the |
00002c10  63 68 65 61 74 69 6e 67  20 62 69 74 0d 0e 2f 1e  |cheating bit../.|
00002c20  f4 20 3d 3d 3d 3d 20 3d  3d 20 3d 3d 3d 20 3d 3d  |. ==== == === ==|
00002c30  3d 3d 3d 3d 3d 3d 20 3d  3d 3d 0d 0e 38 26 f4 20  |====== ===..8&. |
00002c40  49 46 20 63 6f 6c 24 3d  22 77 68 69 74 65 22 20  |IF col$="white" |
00002c50  54 48 45 4e 20 64 69 63  65 32 3d 64 69 63 65 31  |THEN dice2=dice1|
00002c60  0d 0e 39 04 0d 0e 42 1e  78 31 20 3d 20 74 68 72  |..9...B.x1 = thr|
00002c70  6f 77 62 6f 78 28 31 29  2b 32 30 2b b3 28 31 38  |owbox(1)+20+.(18|
00002c80  30 29 0d 0e 4c 1d 79 31  20 3d 20 74 68 72 6f 77  |0)..L.y1 = throw|
00002c90  62 6f 78 28 32 29 2b 32  30 2b b3 28 36 30 29 0d  |box(2)+20+.(60).|
00002ca0  0e 56 14 78 32 20 3d 20  78 31 2b 36 30 2b b3 28  |.V.x2 = x1+60+.(|
00002cb0  36 30 29 0d 0e 60 1d 79  32 20 3d 20 74 68 72 6f  |60)..`.y2 = thro|
00002cc0  77 62 6f 78 28 32 29 2b  32 30 2b b3 28 36 30 29  |wbox(2)+20+.(60)|
00002cd0  0d 0e 6a 0b ec 20 78 31  2c 79 31 0d 0e 74 1a f2  |..j.. x1,y1..t..|
00002ce0  70 6c 6f 74 5f 73 70 72  69 74 65 28 c3 64 69 63  |plot_sprite(.dic|
00002cf0  65 31 2c 30 29 0d 0e 7e  0b ec 20 78 32 2c 79 32  |e1,0)..~.. x2,y2|
00002d00  0d 0e 88 1a f2 70 6c 6f  74 5f 73 70 72 69 74 65  |.....plot_sprite|
00002d10  28 c3 64 69 63 65 32 2c  30 29 0d 0e 92 0c 63 6f  |(.dice2,0)....co|
00002d20  75 6e 74 2b 3d 31 0d 0e  9c 0f e7 20 63 6f 75 6e  |unt+=1..... coun|
00002d30  74 3d 32 20 8c 0d 0e a6  0b 63 6f 75 6e 74 3d 30  |t=2 .....count=0|
00002d40  0d 0e b0 1c 61 3d 31 3a  70 3d 31 32 30 2b b3 28  |....a=1:p=120+.(|
00002d50  33 30 29 3a 64 3d 35 2b  b3 28 35 29 0d 0e ba 19  |30):d=5+.(5)....|
00002d60  d4 20 32 2c 2d 61 2c 70  2c 64 3a 20 f2 64 65 6c  |. 2,-a,p,d: .del|
00002d70  61 79 28 35 29 0d 0e c4  05 cd 0d 0e ce 31 e7 20  |ay(5)........1. |
00002d80  74 6f 73 73 20 3c 20 6e  74 6f 73 73 65 73 20 8c  |toss < ntosses .|
00002d90  20 f2 63 6c 65 61 72 74  68 72 6f 77 62 6f 78 28  | .clearthrowbox(|
00002da0  74 68 72 6f 77 62 6f 78  28 29 29 0d 0e d8 0a ed  |throwbox()).....|
00002db0  20 74 6f 73 73 0d 0e e2  17 f2 73 77 69 74 63 68  | toss.....switch|
00002dc0  5f 75 70 64 61 74 65 5f  62 61 6e 6b 0d 0e ec 23  |_update_bank...#|
00002dd0  ec 20 78 31 2c 79 31 3a  20 f2 70 6c 6f 74 5f 73  |. x1,y1: .plot_s|
00002de0  70 72 69 74 65 28 c3 64  69 63 65 31 2c 30 29 0d  |prite(.dice1,0).|
00002df0  0e f6 23 ec 20 78 32 2c  79 32 3a 20 f2 70 6c 6f  |..#. x2,y2: .plo|
00002e00  74 5f 73 70 72 69 74 65  28 c3 64 69 63 65 32 2c  |t_sprite(.dice2,|
00002e10  30 29 0d 0f 00 17 f2 73  77 69 74 63 68 5f 75 70  |0).....switch_up|
00002e20  64 61 74 65 5f 62 61 6e  6b 0d 0f 0a 17 f4 20 55  |date_bank..... U|
00002e30  4e 54 49 4c 20 64 69 63  65 31 3d 64 69 63 65 32  |NTIL dice1=dice2|
00002e40  0d 0f 14 19 f2 73 65 74  64 69 63 65 28 64 69 63  |.....setdice(dic|
00002e50  65 31 2c 64 69 63 65 32  29 0d 0f 1e 05 e1 0d 0f  |e1,dice2).......|
00002e60  28 04 0d 0f 32 1a dd f2  73 65 74 64 69 63 65 28  |(...2...setdice(|
00002e70  64 69 63 65 31 2c 64 69  63 65 32 29 0d 0f 3c 23  |dice1,dice2)..<#|
00002e80  e7 20 64 69 63 65 31 20  3c 64 69 63 65 32 20 8c  |. dice1 <dice2 .|
00002e90  20 c8 94 20 64 69 63 65  31 2c 64 69 63 65 32 0d  | .. dice1,dice2.|
00002ea0  0f 46 29 e7 20 64 69 63  65 31 20 3d 20 64 69 63  |.F). dice1 = dic|
00002eb0  65 32 20 8c 20 64 6f 75  62 6c 65 3d b9 20 8b 20  |e2 . double=. . |
00002ec0  64 6f 75 62 6c 65 3d a3  0d 0f 50 29 64 69 63 65  |double=...P)dice|
00002ed0  28 31 29 3d 64 69 63 65  31 3a 64 69 63 65 28 32  |(1)=dice1:dice(2|
00002ee0  29 3d 64 69 63 65 32 3a  64 69 63 65 28 30 29 3d  |)=dice2:dice(0)=|
00002ef0  32 0d 0f 5a 15 64 69 63  65 61 76 61 69 6c 61 62  |2..Z.diceavailab|
00002f00  6c 65 20 3d 20 32 0d 0f  64 30 f4 20 49 46 20 64  |le = 2..d0. IF d|
00002f10  6f 75 62 6c 65 20 54 48  45 4e 20 64 69 63 65 28  |ouble THEN dice(|
00002f20  33 29 3d 64 69 63 65 31  3a 64 69 63 65 28 34 29  |3)=dice1:dice(4)|
00002f30  3d 64 69 63 65 31 0d 0f  6e 05 e1 0d 0f 78 04 0d  |=dice1..n....x..|
00002f40  0f 82 26 dd f2 72 6f 6c  6c 73 74 61 72 74 64 69  |..&..rollstartdi|
00002f50  63 65 28 63 6f 6c 24 2c  64 69 63 65 31 2c f8 20  |ce(col$,dice1,. |
00002f60  64 69 63 65 29 0d 0f 8c  1e ea 20 74 68 72 6f 77  |dice)..... throw|
00002f70  62 6f 78 28 29 3a de 20  74 68 72 6f 77 62 6f 78  |box():. throwbox|
00002f80  28 34 29 0d 0f 96 4c e7  20 63 6f 6c 24 3d 22 77  |(4)...L. col$="w|
00002f90  68 69 74 65 22 20 8c 20  74 68 72 6f 77 62 6f 78  |hite" . throwbox|
00002fa0  28 29 3d 77 68 69 74 65  74 68 72 6f 77 62 6f 78  |()=whitethrowbox|
00002fb0  28 29 20 8b 20 74 68 72  6f 77 62 6f 78 28 29 3d  |() . throwbox()=|
00002fc0  62 6c 61 63 6b 74 68 72  6f 77 62 6f 78 28 29 0d  |blackthrowbox().|
00002fd0  0f a0 16 6e 74 6f 73 73  65 73 3d 38 3a 63 6f 75  |...ntosses=8:cou|
00002fe0  6e 74 20 3d 30 0d 0f aa  18 e3 20 74 6f 73 73 20  |nt =0..... toss |
00002ff0  3d 20 31 20 b8 20 6e 74  6f 73 73 65 73 0d 0f b4  |= 1 . ntosses...|
00003000  0d 64 69 63 65 3d b3 28  36 29 0d 0f be 32 e7 20  |.dice=.(6)...2. |
00003010  28 63 6f 6c 24 3d 22 62  6c 61 63 6b 22 20 80 20  |(col$="black" . |
00003020  64 69 63 65 3d 64 69 63  65 31 20 80 20 74 6f 73  |dice=dice1 . tos|
00003030  73 3d 6e 74 6f 73 73 65  73 29 20 8c 0d 0f c8 1d  |s=ntosses) .....|
00003040  f5 3a 64 69 63 65 3d b3  28 36 29 3a fd 20 64 69  |.:dice=.(6):. di|
00003050  63 65 3c 3e 64 69 63 65  31 0d 0f d2 05 cd 0d 0f  |ce<>dice1.......|
00003060  dc 1e 78 31 20 3d 20 74  68 72 6f 77 62 6f 78 28  |..x1 = throwbox(|
00003070  31 29 2b 32 30 2b b3 28  32 30 30 29 0d 0f e6 1d  |1)+20+.(200)....|
00003080  79 31 20 3d 20 74 68 72  6f 77 62 6f 78 28 32 29  |y1 = throwbox(2)|
00003090  2b 32 30 2b b3 28 36 30  29 0d 0f f0 14 78 32 20  |+20+.(60)....x2 |
000030a0  3d 20 78 31 2b 36 30 2b  b3 28 38 30 29 0d 0f fa  |= x1+60+.(80)...|
000030b0  1d 79 32 20 3d 20 74 68  72 6f 77 62 6f 78 28 32  |.y2 = throwbox(2|
000030c0  29 2b 32 30 2b b3 28 36  30 29 0d 10 04 0b ec 20  |)+20+.(60)..... |
000030d0  78 31 2c 79 31 0d 10 0e  19 f2 70 6c 6f 74 5f 73  |x1,y1.....plot_s|
000030e0  70 72 69 74 65 28 c3 64  69 63 65 2c 30 29 0d 10  |prite(.dice,0)..|
000030f0  18 0c 63 6f 75 6e 74 2b  3d 31 0d 10 22 0f e7 20  |..count+=1..".. |
00003100  63 6f 75 6e 74 3d 32 20  8c 0d 10 2c 0b 63 6f 75  |count=2 ...,.cou|
00003110  6e 74 3d 30 0d 10 36 1c  61 3d 31 3a 70 3d 31 32  |nt=0..6.a=1:p=12|
00003120  30 2b b3 28 33 30 29 3a  64 3d 35 2b b3 28 35 29  |0+.(30):d=5+.(5)|
00003130  0d 10 40 19 d4 20 32 2c  2d 61 2c 70 2c 64 3a 20  |..@.. 2,-a,p,d: |
00003140  f2 64 65 6c 61 79 28 35  29 0d 10 4a 05 cd 0d 10  |.delay(5)..J....|
00003150  54 31 e7 20 74 6f 73 73  20 3c 20 6e 74 6f 73 73  |T1. toss < ntoss|
00003160  65 73 20 8c 20 f2 63 6c  65 61 72 74 68 72 6f 77  |es . .clearthrow|
00003170  62 6f 78 28 74 68 72 6f  77 62 6f 78 28 29 29 0d  |box(throwbox()).|
00003180  10 5e 14 e7 20 74 6f 73  73 3d 6e 74 6f 73 73 65  |.^.. toss=ntosse|
00003190  73 20 8c 0d 10 68 17 f2  73 77 69 74 63 68 5f 75  |s ...h..switch_u|
000031a0  70 64 61 74 65 5f 62 61  6e 6b 0d 10 72 21 ec 20  |pdate_bank..r!. |
000031b0  78 31 2c 79 31 3a f2 70  6c 6f 74 5f 73 70 72 69  |x1,y1:.plot_spri|
000031c0  74 65 28 c3 64 69 63 65  2c 30 29 0d 10 7c 17 f2  |te(.dice,0)..|..|
000031d0  73 77 69 74 63 68 5f 75  70 64 61 74 65 5f 62 61  |switch_update_ba|
000031e0  6e 6b 0d 10 86 05 cd 0d  10 90 0a ed 20 74 6f 73  |nk.......... tos|
000031f0  73 0d 10 9a 05 e1 0d 10  a4 04 0d 10 ae 0e dd f2  |s...............|
00003200  64 65 6c 61 79 28 74 29  0d 10 b8 11 d1 3d 30 3a  |delay(t).....=0:|
00003210  f5 20 fd 20 91 20 3e 20  74 0d 10 c2 05 e1 0d 10  |. . . > t.......|
00003220  cc 04 0d 10 d6 1f dd f2  63 6c 65 61 72 74 68 72  |........clearthr|
00003230  6f 77 62 6f 78 28 74 68  72 6f 77 62 6f 78 28 29  |owbox(throwbox()|
00003240  29 0d 10 e0 5a e6 20 67  72 65 65 6e 3a 20 c8 93  |)...Z. green: ..|
00003250  20 c8 90 20 74 68 72 6f  77 62 6f 78 28 31 29 2c  | .. throwbox(1),|
00003260  74 68 72 6f 77 62 6f 78  28 32 29 2c 74 68 72 6f  |throwbox(2),thro|
00003270  77 62 6f 78 28 33 29 2d  74 68 72 6f 77 62 6f 78  |wbox(3)-throwbox|
00003280  28 31 29 2c 74 68 72 6f  77 62 6f 78 28 34 29 2d  |(1),throwbox(4)-|
00003290  74 68 72 6f 77 62 6f 78  28 32 29 0d 10 ea 05 e1  |throwbox(2).....|
000032a0  0d 10 f4 04 0d 10 fe 12  dd f2 73 68 61 64 6f 77  |..........shadow|
000032b0  5f 70 61 6e 65 6c 0d 11  08 0c ea 20 73 63 72 65  |_panel..... scre|
000032c0  65 6e 0d 11 12 14 e3 20  73 63 72 65 65 6e 20 3d  |en..... screen =|
000032d0  20 31 20 b8 20 32 0d 11  1c 17 f2 73 77 69 74 63  | 1 . 2.....switc|
000032e0  68 5f 75 70 64 61 74 65  5f 62 61 6e 6b 0d 11 26  |h_update_bank..&|
000032f0  0a f2 70 61 6e 65 6c 0d  11 30 18 f2 73 77 69 74  |..panel..0..swit|
00003300  63 68 5f 64 69 73 70 6c  61 79 5f 62 61 6e 6b 0d  |ch_display_bank.|
00003310  11 3a 0c ed 20 73 63 72  65 65 6e 0d 11 44 05 e1  |.:.. screen..D..|
00003320  0d 11 4e 04 0d 11 58 0b  dd f2 70 61 6e 65 6c 0d  |..N...X...panel.|
00003330  11 62 0d e6 20 6d 69 64  67 72 65 79 0d 11 6c 30  |.b.. midgrey..l0|
00003340  c8 93 20 c8 90 20 62 6f  61 72 64 73 69 7a 65 2b  |.. .. boardsize+|
00003350  38 2c 30 2c 31 32 34 30  2d 62 6f 61 72 64 73 69  |8,0,1240-boardsi|
00003360  7a 65 2c 62 6f 61 72 64  73 69 7a 65 0d 11 76 11  |ze,boardsize..v.|
00003370  fb 20 31 32 38 2b 6d 69  64 67 72 65 79 0d 11 80  |. 128+midgrey...|
00003380  0b fb 20 77 68 69 74 65  0d 11 8a 18 f1 20 8a 36  |.. white..... .6|
00003390  36 2c 31 29 3b 22 57 20  48 20 49 20 54 20 45 22  |6,1);"W H I T E"|
000033a0  0d 11 94 22 f1 20 8a 36  36 2c 33 29 20 a4 63 65  |...". .66,3) .ce|
000033b0  6e 74 72 65 28 77 68 69  74 65 70 6c 61 79 65 72  |ntre(whiteplayer|
000033c0  24 29 0d 11 9e 1b f1 20  8a 36 39 2c 34 29 3b 22  |$)..... .69,4);"|
000033d0  a3 22 3b 77 68 69 74 65  6d 6f 6e 65 79 0d 11 a8  |.";whitemoney...|
000033e0  1a f1 20 8a 36 36 2c 35  29 3b 22 47 61 6d 65 20  |.. .66,5);"Game |
000033f0  73 63 6f 72 65 20 22 0d  11 b2 1b f1 20 8a 37 30  |score "..... .70|
00003400  2c 36 29 3b 77 68 69 74  65 67 61 6d 65 73 63 6f  |,6);whitegamesco|
00003410  72 65 0d 11 bc 0b fb 20  62 6c 61 63 6b 0d 11 c6  |re..... black...|
00003420  18 f1 20 8a 36 36 2c 31  30 29 22 42 20 4c 20 41  |.. .66,10)"B L A|
00003430  20 43 20 4b 22 0d 11 d0  23 f1 20 8a 36 36 2c 31  | C K"...#. .66,1|
00003440  32 29 20 a4 63 65 6e 74  72 65 28 62 6c 61 63 6b  |2) .centre(black|
00003450  70 6c 61 79 65 72 24 29  0d 11 da 1c f1 20 8a 36  |player$)..... .6|
00003460  39 2c 31 33 29 20 22 a3  22 3b 62 6c 61 63 6b 6d  |9,13) ".";blackm|
00003470  6f 6e 65 79 0d 11 e4 1b  f1 20 8a 36 36 2c 31 34  |oney..... .66,14|
00003480  29 3b 22 47 61 6d 65 20  73 63 6f 72 65 20 22 0d  |);"Game score ".|
00003490  11 ee 1c f1 20 8a 37 30  2c 31 35 29 3b 62 6c 61  |.... .70,15);bla|
000034a0  63 6b 67 61 6d 65 73 63  6f 72 65 0d 11 f8 0e f2  |ckgamescore.....|
000034b0  6d 6f 76 65 70 61 6e 65  6c 0d 12 02 0f f2 64 72  |movepanel.....dr|
000034c0  61 77 70 61 6e 65 6c 73  0d 12 0c 0e f2 64 69 63  |awpanels.....dic|
000034d0  65 70 61 6e 65 6c 0d 12  16 05 e1 0d 12 20 04 0d  |epanel....... ..|
000034e0  12 2a 10 dd a4 63 65 6e  74 72 65 28 53 24 29 0d  |.*...centre(S$).|
000034f0  12 34 08 ea 20 4c 25 0d  12 3e 0a 4c 25 3d a9 53  |.4.. L%..>.L%=.S|
00003500  24 0d 12 48 24 e7 20 4c  25 20 3c 31 30 20 8c 20  |$..H$. L% <10 . |
00003510  53 24 3d c4 28 31 30 2d  4c 25 29 81 32 2c 22 20  |S$=.(10-L%).2," |
00003520  22 29 2b 53 24 0d 12 52  07 3d 53 24 0d 12 5c 04  |")+S$..R.=S$..\.|
00003530  0d 12 66 0f dd f2 64 69  63 65 70 61 6e 65 6c 0d  |..f...dicepanel.|
00003540  12 70 1a ea 20 64 69 63  65 2c 72 6f 6c 6c 2c 78  |.p.. dice,roll,x|
00003550  6f 66 66 2c 69 2c 6e 2c  73 0d 12 7a 0e e7 20 64  |off,i,n,s..z.. d|
00003560  6f 75 62 6c 65 20 8c 0d  12 84 10 78 6f 66 66 20  |ouble .....xoff |
00003570  3d 20 38 3a 6e 3d 34 0d  12 8e 11 e7 20 66 69 72  |= 8:n=4..... fir|
00003580  73 74 70 61 69 72 20 8c  0d 12 98 2b 73 68 6f 77  |stpair ....+show|
00003590  64 69 63 65 28 31 29 3d  64 69 63 65 28 31 29 3a  |dice(1)=dice(1):|
000035a0  73 68 6f 77 64 69 63 65  28 32 29 3d 64 69 63 65  |showdice(2)=dice|
000035b0  28 32 29 0d 12 a2 38 73  68 6f 77 64 69 63 65 28  |(2)...8showdice(|
000035c0  33 29 3d 64 69 63 65 28  31 29 20 83 20 31 32 38  |3)=dice(1) . 128|
000035d0  3a 20 73 68 6f 77 64 69  63 65 28 34 29 3d 64 69  |: showdice(4)=di|
000035e0  63 65 28 32 29 20 83 20  31 32 38 0d 12 ac 05 cc  |ce(2) . 128.....|
000035f0  0d 12 b6 33 73 68 6f 77  64 69 63 65 28 31 29 3d  |...3showdice(1)=|
00003600  64 69 63 65 28 31 29 2b  31 32 38 3a 73 68 6f 77  |dice(1)+128:show|
00003610  64 69 63 65 28 32 29 3d  64 69 63 65 28 32 29 2b  |dice(2)=dice(2)+|
00003620  31 32 38 0d 12 c0 2b 73  68 6f 77 64 69 63 65 28  |128...+showdice(|
00003630  33 29 3d 64 69 63 65 28  31 29 3a 73 68 6f 77 64  |3)=dice(1):showd|
00003640  69 63 65 28 34 29 3d 64  69 63 65 28 32 29 0d 12  |ice(4)=dice(2)..|
00003650  ca 05 cd 0d 12 d4 05 cc  0d 12 de 2b 73 68 6f 77  |...........+show|
00003660  64 69 63 65 28 31 29 3d  64 69 63 65 28 31 29 3a  |dice(1)=dice(1):|
00003670  73 68 6f 77 64 69 63 65  28 32 29 3d 64 69 63 65  |showdice(2)=dice|
00003680  28 32 29 0d 12 e8 11 78  6f 66 66 20 3d 20 34 30  |(2)....xoff = 40|
00003690  3a 6e 3d 32 0d 12 f2 05  cd 0d 12 fc 07 ef 20 35  |:n=2.......... 5|
000036a0  0d 13 06 12 e7 20 64 69  63 65 72 6f 6c 6c 65 64  |..... dicerolled|
000036b0  20 8c 0d 13 10 12 e3 20  64 69 63 65 20 3d 20 31  | ...... dice = 1|
000036c0  20 b8 20 6e 0d 13 1a 19  72 6f 6c 6c 20 3d 20 73  | . n....roll = s|
000036d0  68 6f 77 64 69 63 65 28  64 69 63 65 29 0d 13 24  |howdice(dice)..$|
000036e0  28 e7 20 72 6f 6c 6c 20  3e 20 31 32 38 20 8c 20  |(. roll > 128 . |
000036f0  e6 20 6c 69 67 68 74 67  72 65 79 20 8b 20 e6 20  |. lightgrey . . |
00003700  62 6c 61 63 6b 0d 13 2e  2f ec 20 64 69 63 65 70  |black.../. dicep|
00003710  61 6e 65 6c 28 31 29 2b  78 6f 66 66 2b 33 30 2a  |anel(1)+xoff+30*|
00003720  64 69 63 65 2c 64 69 63  65 70 61 6e 65 6c 28 32  |dice,dicepanel(2|
00003730  29 2b 34 38 0d 13 38 11  f1 3b 20 72 6f 6c 6c 20  |)+48..8..; roll |
00003740  83 20 31 32 38 0d 13 42  0a ed 20 64 69 63 65 0d  |. 128..B.. dice.|
00003750  13 4c 05 cc 0d 13 56 2c  f2 64 72 61 77 74 65 78  |.L....V,.drawtex|
00003760  74 62 6f 78 28 64 69 63  65 70 61 6e 65 6c 28 29  |tbox(dicepanel()|
00003770  2c 22 22 2c 69 76 6f 72  79 2c 69 76 6f 72 79 29  |,"",ivory,ivory)|
00003780  0d 13 60 05 cd 0d 13 6a  06 ef 34 0d 13 74 2d e7  |..`....j..4..t-.|
00003790  20 67 61 6d 65 69 6e 70  72 6f 67 72 65 73 73 20  | gameinprogress |
000037a0  f2 73 68 61 64 6f 77 5f  62 6f 78 28 64 69 63 65  |.shadow_box(dice|
000037b0  70 61 6e 65 6c 28 29 29  0d 13 7e 05 e1 0d 13 88  |panel())..~.....|
000037c0  04 0d 13 92 0f dd f2 6d  6f 76 65 70 61 6e 65 6c  |.......movepanel|
000037d0  0d 13 9c 0b ea 20 74 65  78 74 24 0d 13 a6 16 e7  |..... text$.....|
000037e0  20 67 61 6d 65 69 6e 70  72 6f 67 72 65 73 73 20  | gameinprogress |
000037f0  8c 0d 13 b0 39 e7 20 77  68 69 74 65 74 75 72 6e  |....9. whiteturn|
00003800  20 8c 20 74 65 78 74 24  3d 22 57 68 69 74 65 20  | . text$="White |
00003810  4d 6f 76 65 22 20 8b 20  74 65 78 74 24 3d 22 42  |Move" . text$="B|
00003820  6c 61 63 6b 20 4d 6f 76  65 22 0d 13 ba 05 cc 0d  |lack Move"......|
00003830  13 c4 14 74 65 78 74 24  3d 22 4e 65 77 20 47 61  |...text$="New Ga|
00003840  6d 65 22 0d 13 ce 05 cd  0d 13 d8 2e f2 64 72 61  |me"..........dra|
00003850  77 74 65 78 74 62 6f 78  28 6d 6f 76 65 70 61 6e  |wtextbox(movepan|
00003860  65 6c 28 29 2c 74 65 78  74 24 2c 69 76 6f 72 79  |el(),text$,ivory|
00003870  2c 62 6c 75 65 29 0d 13  e2 2f e7 20 67 61 6d 65  |,blue).../. game|
00003880  69 6e 70 72 6f 67 72 65  73 73 20 8c 20 f2 73 68  |inprogress . .sh|
00003890  61 64 6f 77 5f 62 6f 78  28 6d 6f 76 65 70 61 6e  |adow_box(movepan|
000038a0  65 6c 28 29 29 0d 13 ec  05 e1 0d 13 f6 04 0d 14  |el())...........|
000038b0  00 10 dd f2 64 72 61 77  70 61 6e 65 6c 73 0d 14  |....drawpanels..|
000038c0  0a 15 ea 20 70 61 6e 6e  6f 2c 74 65 78 74 63 6f  |... panno,textco|
000038d0  6c 2c 73 0d 14 14 4d e7  20 67 61 6d 65 69 6e 70  |l,s...M. gameinp|
000038e0  72 6f 67 72 65 73 73 20  8c 20 70 61 6e 65 6c 74  |rogress . panelt|
000038f0  65 78 74 24 28 34 29 3d  22 51 55 49 54 20 47 41  |ext$(4)="QUIT GA|
00003900  4d 45 22 20 8b 20 70 61  6e 65 6c 74 65 78 74 24  |ME" . paneltext$|
00003910  28 34 29 3d 22 53 54 41  52 54 20 47 41 4d 45 22  |(4)="START GAME"|
00003920  0d 14 1e 13 e3 20 70 61  6e 6e 6f 20 3d 20 31 20  |..... panno = 1 |
00003930  b8 20 34 0d 14 28 3e e7  20 70 61 6e 65 6c 61 63  |. 4..(>. panelac|
00003940  74 69 76 65 28 70 61 6e  6e 6f 29 20 8c 20 74 65  |tive(panno) . te|
00003950  78 74 63 6f 6c 20 3d 20  72 65 64 20 8b 20 74 65  |xtcol = red . te|
00003960  78 74 63 6f 6c 20 3d 20  6c 69 67 68 74 67 72 65  |xtcol = lightgre|
00003970  79 0d 14 32 1f f2 70 61  6e 65 6c 63 6f 6f 72 64  |y..2..panelcoord|
00003980  73 28 70 61 6e 6e 6f 2c  70 61 6e 65 6c 28 29 29  |s(panno,panel())|
00003990  0d 14 3c 39 f2 64 72 61  77 74 65 78 74 62 6f 78  |..<9.drawtextbox|
000039a0  28 70 61 6e 65 6c 28 29  2c 70 61 6e 65 6c 74 65  |(panel(),panelte|
000039b0  78 74 24 28 70 61 6e 6e  6f 29 2c 77 68 69 74 65  |xt$(panno),white|
000039c0  2c 74 65 78 74 63 6f 6c  29 0d 14 46 0b ed 20 70  |,textcol)..F.. p|
000039d0  61 6e 6e 6f 0d 14 50 2e  e7 20 67 61 6d 65 69 6e  |anno..P.. gamein|
000039e0  70 72 6f 67 72 65 73 73  20 8c 20 f2 73 68 61 64  |progress . .shad|
000039f0  6f 77 5f 62 6f 78 28 70  61 6e 65 6c 62 6f 78 28  |ow_box(panelbox(|
00003a00  29 29 0d 14 5a 05 e1 0d  14 64 04 0d 14 6e 17 dd  |))..Z....d...n..|
00003a10  f2 64 72 61 77 5f 64 6f  75 62 6c 65 5f 70 61 6e  |.draw_double_pan|
00003a20  65 6c 0d 14 78 0d ea 20  73 2c 64 3a 64 3d 32 0d  |el..x.. s,d:d=2.|
00003a30  14 82 0f e3 20 73 20 3d  20 31 20 b8 20 32 0d 14  |.... s = 1 . 2..|
00003a40  8c 17 f2 73 77 69 74 63  68 5f 75 70 64 61 74 65  |...switch_update|
00003a50  5f 62 61 6e 6b 0d 14 96  1b f2 70 61 6e 65 6c 63  |_bank.....panelc|
00003a60  6f 6f 72 64 73 28 64 2c  70 61 6e 65 6c 28 29 29  |oords(d,panel())|
00003a70  0d 14 a0 37 f2 64 72 61  77 74 65 78 74 62 6f 78  |...7.drawtextbox|
00003a80  28 70 61 6e 65 6c 28 29  2c 70 61 6e 65 6c 74 65  |(panel(),panelte|
00003a90  78 74 24 28 64 29 2c 77  68 69 74 65 2c 6c 69 67  |xt$(d),white,lig|
00003aa0  68 74 67 72 65 79 29 0d  14 aa 18 f2 73 77 69 74  |htgrey).....swit|
00003ab0  63 68 5f 64 69 73 70 6c  61 79 5f 62 61 6e 6b 0d  |ch_display_bank.|
00003ac0  14 b4 07 ed 20 73 0d 14  be 05 e1 0d 14 c8 04 0d  |.... s..........|
00003ad0  14 d2 20 dd f2 70 61 6e  65 6c 63 6f 6f 72 64 73  |.. ..panelcoords|
00003ae0  28 70 61 6e 6e 6f 2c 70  61 6e 65 6c 28 29 29 0d  |(panno,panel()).|
00003af0  14 dc 07 ea 20 69 0d 14  e6 0f e3 20 69 20 3d 20  |.... i..... i = |
00003b00  31 20 b8 20 34 0d 14 f0  1e 70 61 6e 65 6c 28 69  |1 . 4....panel(i|
00003b10  29 20 3d 20 70 61 6e 65  6c 73 28 69 2c 70 61 6e  |) = panels(i,pan|
00003b20  6e 6f 29 0d 14 fa 07 ed  20 69 0d 15 04 05 e1 0d  |no)..... i......|
00003b30  15 0e 04 0d 15 18 0f dd  f2 73 74 61 72 74 67 61  |.........startga|
00003b40  6d 65 0d 15 22 16 ea 20  70 61 6e 6e 6f 2c 78 2c  |me..".. panno,x,|
00003b50  79 2c 62 75 74 74 6f 6e  0d 15 2c 05 f5 0d 15 36  |y,button..,....6|
00003b60  15 70 61 6e 6e 6f 20 3d  20 a4 67 65 74 70 61 6e  |.panno = .getpan|
00003b70  65 6c 0d 15 40 1d e7 20  70 61 6e 6e 6f 20 3d 20  |el..@.. panno = |
00003b80  33 20 8c 20 f2 73 65 74  6f 70 74 69 6f 6e 73 0d  |3 . .setoptions.|
00003b90  15 4a 0f fd 20 70 61 6e  6e 6f 20 3d 20 34 0d 15  |.J.. panno = 4..|
00003ba0  54 10 f2 63 68 6f 6f 73  65 73 74 61 72 74 0d 15  |T..choosestart..|
00003bb0  5e 2b e7 20 77 68 69 74  65 70 6c 61 79 65 72 24  |^+. whiteplayer$|
00003bc0  3d 22 48 55 4d 41 4e 22  20 8c 20 77 68 69 74 65  |="HUMAN" . white|
00003bd0  6f 70 65 6e 69 6e 67 3d  a3 0d 15 68 2b e7 20 62  |opening=...h+. b|
00003be0  6c 61 63 6b 70 6c 61 79  65 72 24 3d 22 48 55 4d  |lackplayer$="HUM|
00003bf0  41 4e 22 20 8c 20 62 6c  61 63 6b 6f 70 65 6e 69  |AN" . blackopeni|
00003c00  6e 67 3d a3 0d 15 72 14  67 61 6d 65 69 6e 70 72  |ng=...r.gameinpr|
00003c10  6f 67 72 65 73 73 3d b9  0d 15 7c 05 e1 0d 15 86  |ogress=...|.....|
00003c20  04 0d 15 90 11 dd f2 63  68 6f 6f 73 65 73 74 61  |.......choosesta|
00003c30  72 74 0d 15 9a 20 ea 20  64 69 63 65 77 2c 64 69  |rt... . dicew,di|
00003c40  63 65 62 2c 6d 65 73 73  61 67 65 24 2c 62 6f 78  |ceb,message$,box|
00003c50  28 29 0d 15 a4 4a de 20  62 6f 78 28 34 29 3a 62  |()...J. box(4):b|
00003c60  6f 78 28 29 3d 63 61 6e  74 62 6f 78 28 29 3a 62  |ox()=cantbox():b|
00003c70  6f 78 28 32 29 2d 3d 32  37 30 3a 62 6f 78 28 34  |ox(2)-=270:box(4|
00003c80  29 2d 3d 32 37 30 3a 62  6f 78 28 31 29 2d 3d 36  |)-=270:box(1)-=6|
00003c90  30 3a 62 6f 78 28 33 29  2d 3d 36 30 0d 15 ae 23  |0:box(3)-=60...#|
00003ca0  f2 72 6f 6c 6c 73 74 61  72 74 64 69 63 65 28 22  |.rollstartdice("|
00003cb0  77 68 69 74 65 22 2c 30  2c 64 69 63 65 31 29 0d  |white",0,dice1).|
00003cc0  15 b8 27 f2 72 6f 6c 6c  73 74 61 72 74 64 69 63  |..'.rollstartdic|
00003cd0  65 28 22 62 6c 61 63 6b  22 2c 64 69 63 65 31 2c  |e("black",dice1,|
00003ce0  64 69 63 65 32 29 0d 15  c2 1d 77 68 69 74 65 74  |dice2)....whitet|
00003cf0  75 72 6e 20 3d 20 28 64  69 63 65 31 3e 64 69 63  |urn = (dice1>dic|
00003d00  65 32 29 0d 15 cc 43 e7  20 77 68 69 74 65 74 75  |e2)...C. whitetu|
00003d10  72 6e 20 8c 20 6d 65 73  73 61 67 65 24 3d 22 57  |rn . message$="W|
00003d20  48 49 54 45 20 53 54 41  52 54 53 22 20 8b 20 6d  |HITE STARTS" . m|
00003d30  65 73 73 61 67 65 24 3d  22 42 4c 41 43 4b 20 53  |essage$="BLACK S|
00003d40  54 41 52 54 53 22 0d 15  d6 1a f2 67 72 61 62 62  |TARTS".....grabb|
00003d50  6f 78 28 62 6f 78 28 29  2c 22 74 65 6d 70 22 29  |ox(box(),"temp")|
00003d60  0d 15 e0 1f f2 64 69 73  70 6c 61 79 62 6f 78 28  |.....displaybox(|
00003d70  62 6f 78 28 29 2c 6d 65  73 73 61 67 65 24 29 0d  |box(),message$).|
00003d80  15 ea 1d f2 72 65 73 74  6f 72 65 62 6f 78 28 62  |....restorebox(b|
00003d90  6f 78 28 29 2c 22 74 65  6d 70 22 29 0d 15 f4 24  |ox(),"temp")...$|
00003da0  f2 73 65 74 64 69 63 65  28 64 69 63 65 31 2c 64  |.setdice(dice1,d|
00003db0  69 63 65 32 29 3a 73 74  61 72 74 73 65 74 3d b9  |ice2):startset=.|
00003dc0  0d 15 fe 05 e1 0d 16 08  04 0d 16 12 0e dd a4 67  |...............g|
00003dd0  65 74 70 61 6e 65 6c 0d  16 1c 36 f4 20 63 68 65  |etpanel...6. che|
00003de0  63 6b 73 20 6d 6f 75 73  65 20 70 72 65 73 73 65  |cks mouse presse|
00003df0  73 20 69 6e 20 70 61 6e  65 6c 20 61 6e 64 20 72  |s in panel and r|
00003e00  65 74 75 72 6e 73 20 6e  75 6d 62 65 72 0d 16 26  |eturns number..&|
00003e10  24 f4 20 69 66 20 61 63  74 69 76 65 20 70 61 6e  |$. if active pan|
00003e20  65 6c 20 63 6c 69 63 6b  65 64 20 65 6c 73 65 20  |el clicked else |
00003e30  30 0d 16 30 39 ea 20 70  61 6e 6e 6f 2c 20 62 75  |0..09. panno, bu|
00003e40  74 74 6f 6e 2c 78 2c 79  2c 20 66 6f 75 6e 64 2c  |tton,x,y, found,|
00003e50  6c 61 73 74 3a 20 70 61  6e 6e 6f 20 3d 20 30 3a  |last: panno = 0:|
00003e60  20 66 6f 75 6e 64 20 3d  20 a3 0d 16 3a 26 e7 20  | found = ...:&. |
00003e70  67 61 6d 65 69 6e 70 72  6f 67 72 65 73 73 20 8c  |gameinprogress .|
00003e80  20 6c 61 73 74 3d 35 20  8b 20 6c 61 73 74 3d 34  | last=5 . last=4|
00003e90  0d 16 44 05 f5 0d 16 4e  0d 70 61 6e 6e 6f 20 2b  |..D....N.panno +|
00003ea0  3d 31 0d 16 58 0f e7 20  70 61 6e 6e 6f 3d 35 20  |=1..X.. panno=5 |
00003eb0  8c 0d 16 62 15 70 61 6e  65 6c 28 29 3d 67 61 6d  |...b.panel()=gam|
00003ec0  65 62 6f 78 28 29 0d 16  6c 05 cc 0d 16 76 1f f2  |ebox()..l....v..|
00003ed0  70 61 6e 65 6c 63 6f 6f  72 64 73 28 70 61 6e 6e  |panelcoords(pann|
00003ee0  6f 2c 70 61 6e 65 6c 28  29 29 0d 16 80 05 cd 0d  |o,panel())......|
00003ef0  16 8a 23 e7 20 a4 6d 6f  75 73 65 69 6e 62 6f 78  |..#. .mouseinbox|
00003f00  28 70 61 6e 65 6c 28 29  2c 62 75 74 74 6f 6e 29  |(panel(),button)|
00003f10  20 8c 0d 16 94 33 e7 20  70 61 6e 65 6c 61 63 74  | ....3. panelact|
00003f20  69 76 65 28 70 61 6e 6e  6f 29 20 84 20 70 61 6e  |ive(panno) . pan|
00003f30  6e 6f 3d 35 20 8c 20 66  6f 75 6e 64 20 3d 20 b9  |no=5 . found = .|
00003f40  20 8b 20 ef 37 0d 16 9e  05 cd 0d 16 a8 1a fd 20  | . .7.......... |
00003f50  66 6f 75 6e 64 20 84 20  70 61 6e 6e 6f 20 3d 20  |found . panno = |
00003f60  6c 61 73 74 0d 16 b2 17  e7 20 70 61 6e 6e 6f 3d  |last..... panno=|
00003f70  35 20 8c 20 70 61 6e 6e  6f 3d 31 0d 16 bc 1b e7  |5 . panno=1.....|
00003f80  20 66 6f 75 6e 64 20 8c  20 3d 20 70 61 6e 6e 6f  | found . = panno|
00003f90  20 8b 20 3d 20 30 0d 16  c6 04 0d 16 d0 10 dd f2  | . = 0..........|
00003fa0  73 65 74 6f 70 74 69 6f  6e 73 0d 16 da 13 ea 20  |setoptions..... |
00003fb0  6d 6f 6e 65 79 72 65 73  65 74 2c 6f 6b 0d 16 e4  |moneyreset,ok...|
00003fc0  10 6d 6f 6e 65 79 72 65  73 65 74 3d a3 0d 16 ee  |.moneyreset=....|
00003fd0  1d f2 67 72 61 62 62 6f  78 28 6f 70 74 62 6f 78  |..grabbox(optbox|
00003fe0  28 29 2c 22 74 65 6d 70  22 29 0d 16 f8 0f f2 6f  |(),"temp").....o|
00003ff0  70 74 69 6f 6e 73 62 6f  78 0d 17 02 08 6f 6b 3d  |ptionsbox....ok=|
00004000  a3 0d 17 0c 05 f5 0d 17  16 16 70 61 6e 65 6c 28  |..........panel(|
00004010  29 3d 6f 70 74 70 61 6e  65 6c 28 29 0d 17 20 0c  |)=optpanel().. .|
00004020  62 75 74 74 6f 6e 3d 30  0d 17 2a 0f e3 20 69 20  |button=0..*.. i |
00004030  3d 20 31 20 b8 20 34 0d  17 34 25 e7 20 69 3e 31  |= 1 . 4..4%. i>1|
00004040  20 8c 20 70 61 6e 65 6c  28 32 29 2d 3d 37 36 3a  | . panel(2)-=76:|
00004050  70 61 6e 65 6c 28 34 29  2d 3d 37 36 0d 17 3e 22  |panel(4)-=76..>"|
00004060  e7 20 a4 6d 6f 75 73 65  69 6e 62 6f 78 28 70 61  |. .mouseinbox(pa|
00004070  6e 65 6c 28 29 2c 62 75  74 74 6f 6e 29 8c 0d 17  |nel(),button)...|
00004080  48 0a c8 8e 20 69 20 ca  0d 17 52 53 c9 20 31 3a  |H... i ...RS. 1:|
00004090  20 e7 20 77 68 69 74 65  70 6c 61 79 65 72 24 3d  | . whiteplayer$=|
000040a0  22 43 4f 4d 50 55 54 45  52 22 20 8c 20 77 68 69  |"COMPUTER" . whi|
000040b0  74 65 70 6c 61 79 65 72  24 3d 22 48 55 4d 41 4e  |teplayer$="HUMAN|
000040c0  22 20 8b 20 77 68 69 74  65 70 6c 61 79 65 72 24  |" . whiteplayer$|
000040d0  3d 22 43 4f 4d 50 55 54  45 52 22 0d 17 5c 30 f2  |="COMPUTER"..\0.|
000040e0  64 72 61 77 74 65 78 74  62 6f 78 28 70 61 6e 65  |drawtextbox(pane|
000040f0  6c 28 29 2c 77 68 69 74  65 70 6c 61 79 65 72 24  |l(),whiteplayer$|
00004100  2c 77 68 69 74 65 2c 72  65 64 29 0d 17 66 53 c9  |,white,red)..fS.|
00004110  20 32 3a 20 e7 20 62 6c  61 63 6b 70 6c 61 79 65  | 2: . blackplaye|
00004120  72 24 3d 22 43 4f 4d 50  55 54 45 52 22 20 8c 20  |r$="COMPUTER" . |
00004130  62 6c 61 63 6b 70 6c 61  79 65 72 24 3d 22 48 55  |blackplayer$="HU|
00004140  4d 41 4e 22 20 8b 20 62  6c 61 63 6b 70 6c 61 79  |MAN" . blackplay|
00004150  65 72 24 3d 22 43 4f 4d  50 55 54 45 52 22 0d 17  |er$="COMPUTER"..|
00004160  70 30 f2 64 72 61 77 74  65 78 74 62 6f 78 28 70  |p0.drawtextbox(p|
00004170  61 6e 65 6c 28 29 2c 62  6c 61 63 6b 70 6c 61 79  |anel(),blackplay|
00004180  65 72 24 2c 77 68 69 74  65 2c 72 65 64 29 0d 17  |er$,white,red)..|
00004190  7a 26 c9 20 33 3a 20 62  6c 61 63 6b 6d 6f 6e 65  |z&. 3: blackmone|
000041a0  79 3d 31 30 30 3a 77 68  69 74 65 6d 6f 6e 65 79  |y=100:whitemoney|
000041b0  3d 31 30 30 0d 17 84 84  e7 20 6d 6f 6e 65 79 72  |=100..... moneyr|
000041c0  65 73 65 74 20 8c 20 6d  6f 6e 65 79 72 65 73 65  |eset . moneyrese|
000041d0  74 3d a3 3a f2 64 72 61  77 74 65 78 74 62 6f 78  |t=.:.drawtextbox|
000041e0  28 70 61 6e 65 6c 28 29  2c 22 52 45 53 45 54 22  |(panel(),"RESET"|
000041f0  2c 77 68 69 74 65 2c 72  65 64 29 20 8b 20 6d 6f  |,white,red) . mo|
00004200  6e 65 79 72 65 73 65 74  3d b9 3a f2 64 72 61 77  |neyreset=.:.draw|
00004210  74 65 78 74 62 6f 78 28  70 61 6e 65 6c 28 29 2c  |textbox(panel(),|
00004220  22 52 45 53 45 54 22 2c  77 68 69 74 65 2c 6c 69  |"RESET",white,li|
00004230  67 68 74 67 72 65 79 29  0d 17 8e 45 c9 20 34 3a  |ghtgrey)...E. 4:|
00004240  20 e7 20 65 76 61 6c 64  69 73 70 6c 61 79 24 3d  | . evaldisplay$=|
00004250  22 4f 4e 22 20 8c 20 65  76 61 6c 64 69 73 70 6c  |"ON" . evaldispl|
00004260  61 79 24 3d 22 4f 46 46  22 20 8b 20 65 76 61 6c  |ay$="OFF" . eval|
00004270  64 69 73 70 6c 61 79 24  3d 22 4f 4e 22 0d 17 98  |display$="ON"...|
00004280  30 f2 64 72 61 77 74 65  78 74 62 6f 78 28 70 61  |0.drawtextbox(pa|
00004290  6e 65 6c 28 29 2c 65 76  61 6c 64 69 73 70 6c 61  |nel(),evaldispla|
000042a0  79 24 2c 77 68 69 74 65  2c 72 65 64 29 0d 17 a2  |y$,white,red)...|
000042b0  05 cb 0d 17 ac 05 cd 0d  17 b6 45 c8 97 20 c8 93  |..........E.. ..|
000042c0  20 6f 70 74 62 6f 78 28  31 29 2c 6f 70 74 62 6f  | optbox(1),optbo|
000042d0  78 28 32 29 2c 6f 70 74  62 6f 78 28 33 29 2d 6f  |x(2),optbox(3)-o|
000042e0  70 74 62 6f 78 28 31 29  2c 6f 70 74 62 6f 78 28  |ptbox(1),optbox(|
000042f0  34 29 2d 6f 70 74 62 6f  78 28 32 29 0d 17 c0 07  |4)-optbox(2)....|
00004300  ed 20 69 0d 17 ca 56 e7  20 a4 6d 6f 75 73 65 69  |. i...V. .mousei|
00004310  6e 62 6f 78 28 71 75 69  74 70 61 6e 65 6c 28 29  |nbox(quitpanel()|
00004320  2c 62 75 74 74 6f 6e 29  20 8c 20 73 75 72 65 3d  |,button) . sure=|
00004330  a4 73 75 72 65 62 6f 78  28 22 22 29 3a e7 20 73  |.surebox(""):. s|
00004340  75 72 65 20 8c 20 eb 31  32 3a ff 28 22 46 58 20  |ure . .12:.("FX |
00004350  32 30 30 2c 30 22 29 3a  e0 0d 17 d4 2a e7 20 a4  |200,0"):....*. .|
00004360  6d 6f 75 73 65 69 6e 62  6f 78 28 6f 6b 70 61 6e  |mouseinbox(okpan|
00004370  65 6c 28 29 2c 62 75 74  74 6f 6e 29 20 8c 20 6f  |el(),button) . o|
00004380  6b 3d b9 0d 17 de 08 fd  20 6f 6b 0d 17 e8 12 62  |k=...... ok....b|
00004390  75 74 74 6f 6e 3d 30 3a  2a 46 58 31 35 0d 17 f2  |utton=0:*FX15...|
000043a0  05 f5 0d 17 fc 11 c8 97  20 78 2c 79 2c 62 75 74  |........ x,y,but|
000043b0  74 6f 6e 0d 18 06 0c fd  20 62 75 74 74 6f 6e 0d  |ton..... button.|
000043c0  18 10 17 c8 97 20 c8 93  20 30 2c 30 2c 31 32 33  |..... .. 0,0,123|
000043d0  39 2c 31 32 30 33 0d 18  1a 06 ef 34 0d 18 24 20  |9,1203.....4..$ |
000043e0  f2 72 65 73 74 6f 72 65  62 6f 78 28 6f 70 74 62  |.restorebox(optb|
000043f0  6f 78 28 29 2c 22 74 65  6d 70 22 29 0d 18 2e 11  |ox(),"temp")....|
00004400  f2 73 68 61 64 6f 77 5f  70 61 6e 65 6c 0d 18 38  |.shadow_panel..8|
00004410  05 e1 0d 18 42 04 0d 18  4c 10 dd f2 6f 70 74 69  |....B...L...opti|
00004420  6f 6e 73 62 6f 78 0d 18  56 1c ea 20 69 2c 78 2c  |onsbox..V.. i,x,|
00004430  79 2c 62 6f 72 64 65 72  3a 62 6f 72 64 65 72 3d  |y,border:border=|
00004440  33 32 0d 18 60 06 ef 35  0d 18 6a 22 f2 73 68 6f  |32..`..5..j".sho|
00004450  77 62 6f 78 28 6f 70 74  62 6f 78 28 29 2c 62 6c  |wbox(optbox(),bl|
00004460  61 63 6b 2c 69 76 6f 72  79 29 0d 18 74 18 78 3d  |ack,ivory)..t.x=|
00004470  6f 70 74 62 6f 78 28 31  29 2b 32 2a 62 6f 72 64  |optbox(1)+2*bord|
00004480  65 72 0d 18 7e 0b e6 20  62 6c 61 63 6b 0d 18 88  |er..~.. black...|
00004490  0f e3 20 69 20 3d 20 31  20 b8 20 34 0d 18 92 14  |.. i = 1 . 4....|
000044a0  79 3d 6f 70 74 62 6f 78  28 34 29 2d 69 2a 37 36  |y=optbox(4)-i*76|
000044b0  0d 18 9c 17 ec 20 78 2c  79 3a f1 20 6f 70 74 74  |..... x,y:. optt|
000044c0  65 78 74 24 28 69 29 0d  18 a6 07 ed 20 69 0d 18  |ext$(i)..... i..|
000044d0  b0 37 f2 64 72 61 77 74  65 78 74 62 6f 78 28 71  |.7.drawtextbox(q|
000044e0  75 69 74 70 61 6e 65 6c  28 29 2c 22 51 55 49 54  |uitpanel(),"QUIT|
000044f0  20 50 52 4f 47 52 41 4d  22 2c 77 68 69 74 65 2c  | PROGRAM",white,|
00004500  62 6c 75 65 29 0d 18 ba  30 f2 64 72 61 77 74 65  |blue)...0.drawte|
00004510  78 74 62 6f 78 28 6f 6b  70 61 6e 65 6c 28 29 2c  |xtbox(okpanel(),|
00004520  22 4f 4b 22 2c 6c 69 67  68 74 67 72 65 79 2c 62  |"OK",lightgrey,b|
00004530  6c 61 63 6b 29 0d 18 c4  16 70 61 6e 65 6c 28 29  |lack)....panel()|
00004540  3d 6f 70 74 70 61 6e 65  6c 28 29 0d 18 ce 0f e3  |=optpanel().....|
00004550  20 69 20 3d 20 31 20 b8  20 34 0d 18 d8 25 e7 20  | i = 1 . 4...%. |
00004560  69 3e 31 20 8c 20 70 61  6e 65 6c 28 32 29 2d 3d  |i>1 . panel(2)-=|
00004570  37 36 3a 70 61 6e 65 6c  28 34 29 2d 3d 37 36 0d  |76:panel(4)-=76.|
00004580  18 e2 0a c8 8e 20 69 20  ca 0d 18 ec 1b c9 20 31  |..... i ...... 1|
00004590  3a 20 74 65 78 74 24 3d  77 68 69 74 65 70 6c 61  |: text$=whitepla|
000045a0  79 65 72 24 0d 18 f6 1b  c9 20 32 3a 20 74 65 78  |yer$..... 2: tex|
000045b0  74 24 3d 62 6c 61 63 6b  70 6c 61 79 65 72 24 0d  |t$=blackplayer$.|
000045c0  19 00 16 c9 20 33 3a 20  74 65 78 74 24 3d 22 52  |.... 3: text$="R|
000045d0  45 53 45 54 22 0d 19 0a  1b c9 20 34 3a 20 74 65  |ESET"..... 4: te|
000045e0  78 74 24 3d 65 76 61 6c  64 69 73 70 6c 61 79 24  |xt$=evaldisplay$|
000045f0  0d 19 14 05 cb 0d 19 1e  29 f2 64 72 61 77 74 65  |........).drawte|
00004600  78 74 62 6f 78 28 70 61  6e 65 6c 28 29 2c 74 65  |xtbox(panel(),te|
00004610  78 74 24 2c 77 68 69 74  65 2c 72 65 64 29 0d 19  |xt$,white,red)..|
00004620  28 07 ed 20 69 0d 19 32  05 e1 0d 19 3c 04 0d 19  |(.. i..2....<...|
00004630  46 04 0d 19 50 0a dd f2  70 6c 61 79 0d 19 5a 17  |F...P...play..Z.|
00004640  ea 20 78 2c 79 2c 62 75  74 74 6f 6e 2c 73 63 72  |. x,y,button,scr|
00004650  65 65 6e 0d 19 64 0c 2a  46 58 32 30 30 2c 30 0d  |een..d.*FX200,0.|
00004660  19 6e 07 ea 20 85 0d 19  78 49 ee 20 85 20 ea 20  |.n.. ...xI. . . |
00004670  67 61 6d 65 69 6e 70 72  6f 67 72 65 73 73 3d a3  |gameinprogress=.|
00004680  3a c8 97 20 ee 3a c8 97  20 c8 93 20 30 2c 30 2c  |:.. .:.. .. 0,0,|
00004690  31 32 33 39 2c 31 30 32  33 3a ef 34 2c 32 36 3a  |1239,1023:.4,26:|
000046a0  ff 28 22 46 58 20 32 30  30 2c 31 22 29 3a e1 0d  |.("FX 200,1"):..|
000046b0  19 82 3e e7 20 77 68 69  74 65 70 6c 61 79 65 72  |..>. whiteplayer|
000046c0  24 3d 22 43 4f 4d 50 55  54 45 52 22 20 80 20 62  |$="COMPUTER" . b|
000046d0  6c 61 63 6b 70 6c 61 79  65 72 24 3d 22 43 4f 4d  |lackplayer$="COM|
000046e0  50 55 54 45 52 22 20 8c  20 c8 97 20 87 0d 19 8c  |PUTER" . .. ....|
000046f0  15 c8 95 20 67 61 6d 65  69 6e 70 72 6f 67 72 65  |... gameinprogre|
00004700  73 73 0d 19 96 11 e7 20  77 68 69 74 65 74 75 72  |ss..... whitetur|
00004710  6e 20 8c 0d 19 a0 4b e7  20 77 68 69 74 65 70 6c  |n ....K. whitepl|
00004720  61 79 65 72 24 20 3d 20  22 48 55 4d 41 4e 22 20  |ayer$ = "HUMAN" |
00004730  8c 20 f2 68 75 6d 61 6e  70 6c 61 79 28 22 77 68  |. .humanplay("wh|
00004740  69 74 65 22 29 20 8b 20  f2 63 6f 6d 70 75 74 65  |ite") . .compute|
00004750  72 70 6c 61 79 28 22 77  68 69 74 65 22 29 0d 19  |rplay("white")..|
00004760  aa 11 77 68 69 74 65 74  75 72 6e 20 3d 20 a3 0d  |..whiteturn = ..|
00004770  19 b4 05 cc 0d 19 be 4b  e7 20 62 6c 61 63 6b 70  |.......K. blackp|
00004780  6c 61 79 65 72 24 20 3d  20 22 48 55 4d 41 4e 22  |layer$ = "HUMAN"|
00004790  20 8c 20 f2 68 75 6d 61  6e 70 6c 61 79 28 22 62  | . .humanplay("b|
000047a0  6c 61 63 6b 22 29 20 8b  20 f2 63 6f 6d 70 75 74  |lack") . .comput|
000047b0  65 72 70 6c 61 79 28 22  62 6c 61 63 6b 22 29 0d  |erplay("black").|
000047c0  19 c8 11 77 68 69 74 65  74 75 72 6e 20 3d 20 b9  |...whiteturn = .|
000047d0  0d 19 d2 05 cd 0d 19 dc  14 e3 20 73 63 72 65 65  |.......... scree|
000047e0  6e 20 3d 20 31 20 b8 20  32 0d 19 e6 43 f2 63 6c  |n = 1 . 2...C.cl|
000047f0  65 61 72 74 68 72 6f 77  62 6f 78 28 77 68 69 74  |earthrowbox(whit|
00004800  65 74 68 72 6f 77 62 6f  78 28 29 29 3a f2 63 6c  |ethrowbox()):.cl|
00004810  65 61 72 74 68 72 6f 77  62 6f 78 28 62 6c 61 63  |earthrowbox(blac|
00004820  6b 74 68 72 6f 77 62 6f  78 28 29 29 0d 19 f0 17  |kthrowbox())....|
00004830  f2 73 77 69 74 63 68 5f  75 70 64 61 74 65 5f 62  |.switch_update_b|
00004840  61 6e 6b 0d 19 fa 0c ed  20 73 63 72 65 65 6e 0d  |ank..... screen.|
00004850  1a 04 0e f2 73 68 6f 77  73 63 6f 72 65 0d 1a 0e  |....showscore...|
00004860  4e e7 20 67 61 6d 65 69  6e 70 72 6f 67 72 65 73  |N. gameinprogres|
00004870  73 20 80 20 ac 20 28 77  68 69 74 65 70 6c 61 79  |s . . (whiteplay|
00004880  65 72 24 3d 22 43 4f 4d  50 55 54 45 52 22 20 80  |er$="COMPUTER" .|
00004890  20 62 6c 61 63 6b 70 6c  61 79 65 72 24 3d 22 43  | blackplayer$="C|
000048a0  4f 4d 50 55 54 45 52 22  29 20 8c 0d 1a 18 64 f4  |OMPUTER") ....d.|
000048b0  20 49 46 20 28 77 68 69  74 65 74 75 72 6e 20 41  | IF (whiteturn A|
000048c0  4e 44 20 77 68 69 74 65  70 6c 61 79 65 72 24 3d  |ND whiteplayer$=|
000048d0  22 43 4f 4d 50 55 54 45  52 22 29 20 4f 52 20 28  |"COMPUTER") OR (|
000048e0  4e 4f 54 20 77 68 69 74  65 74 75 72 6e 20 41 4e  |NOT whiteturn AN|
000048f0  44 20 62 6c 61 63 6b 70  6c 61 79 65 72 24 3d 22  |D blackplayer$="|
00004900  43 4f 4d 50 55 54 45 52  22 29 20 54 48 45 4e 0d  |COMPUTER") THEN.|
00004910  1a 22 14 f4 20 62 75 74  74 6f 6e 3d 30 3a 2a 46  |.".. button=0:*F|
00004920  58 31 35 0d 1a 2c 2a f4  20 52 45 50 45 41 54 3a  |X15..,*. REPEAT:|
00004930  4d 4f 55 53 45 20 78 2c  79 2c 62 75 74 74 6f 6e  |MOUSE x,y,button|
00004940  3a 55 4e 54 49 4c 20 62  75 74 74 6f 6e 0d 1a 36  |:UNTIL button..6|
00004950  0b f4 20 45 4e 44 49 46  0d 1a 40 05 cd 0d 1a 4a  |.. ENDIF..@....J|
00004960  4a e7 20 61 6c 6c 70 61  73 74 20 80 20 ac 20 61  |J. allpast . . a|
00004970  6c 6c 70 61 73 74 5f 77  65 69 67 68 74 20 8c 20  |llpast_weight . |
00004980  f2 61 6c 6c 70 61 73 74  5f 77 65 69 67 68 74 69  |.allpast_weighti|
00004990  6e 67 73 3a 20 61 6c 6c  70 61 73 74 5f 77 65 69  |ngs: allpast_wei|
000049a0  67 68 74 20 3d 20 b9 0d  1a 54 05 ce 0d 1a 5e 08  |ght = ...T....^.|
000049b0  c8 97 20 ee 0d 1a 68 0c  2a 46 58 32 30 30 2c 30  |.. ...h.*FX200,0|
000049c0  0d 1a 72 05 e1 0d 1a 7c  04 0d 1a 86 0d dd a4 61  |..r....|.......a|
000049d0  6c 6c 70 61 73 74 0d 1a  90 41 f4 20 72 65 74 75  |llpast...A. retu|
000049e0  72 6e 73 20 54 52 55 45  20 77 68 65 6e 20 70 69  |rns TRUE when pi|
000049f0  65 63 65 73 20 6f 66 20  65 61 63 68 20 63 6f 6c  |eces of each col|
00004a00  6f 75 72 20 61 72 65 20  70 61 73 74 20 65 61 63  |our are past eac|
00004a10  68 20 6f 74 68 65 72 0d  1a 9a 20 f4 20 61 6e 64  |h other... . and|
00004a20  20 6e 6f 20 68 69 74 74  69 6e 67 20 69 73 20 70  | no hitting is p|
00004a30  6f 73 73 69 62 6c 65 0d  1a a4 33 ea 20 70 6f 69  |ossible...3. poi|
00004a40  6e 74 2c 70 72 65 73 65  6e 74 2c 61 6c 6c 70 61  |nt,present,allpa|
00004a50  73 74 2c 66 6f 75 6e 64  2c 6d 61 78 62 6c 61 63  |st,found,maxblac|
00004a60  6b 2c 6d 69 6e 77 68 69  74 65 0d 1a ae 1e e7 20  |k,minwhite..... |
00004a70  62 61 72 77 68 69 74 65  20 84 20 62 61 72 62 6c  |barwhite . barbl|
00004a80  61 63 6b 20 8c 20 3d a3  0d 1a b8 13 70 6f 69 6e  |ack . =.....poin|
00004a90  74 3d 30 3a 66 6f 75 6e  64 3d a3 0d 1a c2 0e c8  |t=0:found=......|
00004aa0  95 20 ac 20 66 6f 75 6e  64 0d 1a cc 0c 70 6f 69  |. . found....poi|
00004ab0  6e 74 2b 3d 31 0d 1a d6  40 e7 20 62 6f 61 72 64  |nt+=1...@. board|
00004ac0  3f 70 6f 69 6e 74 20 3c  20 31 32 38 20 80 20 62  |?point < 128 . b|
00004ad0  6f 61 72 64 3f 70 6f 69  6e 74 3e 30 20 8c 20 6d  |oard?point>0 . m|
00004ae0  69 6e 77 68 69 74 65 3d  70 6f 69 6e 74 3a 66 6f  |inwhite=point:fo|
00004af0  75 6e 64 3d b9 0d 1a e0  05 ce 0d 1a ea 14 70 6f  |und=..........po|
00004b00  69 6e 74 3d 32 35 3a 66  6f 75 6e 64 3d a3 0d 1a  |int=25:found=...|
00004b10  f4 0e c8 95 20 ac 20 66  6f 75 6e 64 0d 1a fe 0c  |.... . found....|
00004b20  70 6f 69 6e 74 2d 3d 31  0d 1b 08 30 e7 20 62 6f  |point-=1...0. bo|
00004b30  61 72 64 3f 70 6f 69 6e  74 20 3e 20 31 32 38 20  |ard?point > 128 |
00004b40  8c 20 6d 61 78 62 6c 61  63 6b 3d 70 6f 69 6e 74  |. maxblack=point|
00004b50  3a 66 6f 75 6e 64 3d b9  0d 1b 12 05 ce 0d 1b 1c  |:found=.........|
00004b60  1f 61 6c 6c 70 61 73 74  3d 28 6d 69 6e 77 68 69  |.allpast=(minwhi|
00004b70  74 65 3e 6d 61 78 62 6c  61 63 6b 29 0d 1b 26 0c  |te>maxblack)..&.|
00004b80  3d 61 6c 6c 70 61 73 74  0d 1b 30 04 0d 1b 3a 0f  |=allpast..0...:.|
00004b90  dd f2 73 68 6f 77 73 63  6f 72 65 0d 1b 44 1d ea  |..showscore..D..|
00004ba0  20 74 65 78 74 24 2c 78  2c 79 2c 62 75 74 74 6f  | text$,x,y,butto|
00004bb0  6e 2c 73 63 72 65 65 6e  0d 1b 4e 19 e7 20 65 76  |n,screen..N.. ev|
00004bc0  61 6c 64 69 73 70 6c 61  79 24 3d 22 4f 4e 22 20  |aldisplay$="ON" |
00004bd0  8c 0d 1b 58 2d e7 20 77  68 69 74 65 74 75 72 6e  |...X-. whiteturn|
00004be0  20 8c 20 63 6f 6c 24 3d  22 62 6c 61 63 6b 22 20  | . col$="black" |
00004bf0  8b 20 63 6f 6c 24 3d 22  77 68 69 74 65 22 0d 1b  |. col$="white"..|
00004c00  62 5e 63 75 72 72 65 6e  74 5f 73 63 6f 72 65 3d  |b^current_score=|
00004c10  a4 65 76 61 6c 75 61 74  65 62 6f 61 72 64 28 63  |.evaluateboard(c|
00004c20  6f 6c 24 2c 62 6f 61 72  64 2c 77 68 69 74 65 70  |ol$,board,whitep|
00004c30  69 65 63 65 73 2c 62 6c  61 63 6b 70 69 65 63 65  |ieces,blackpiece|
00004c40  73 2c 62 61 72 77 68 69  74 65 2c 62 61 72 62 6c  |s,barwhite,barbl|
00004c50  61 63 6b 2c 77 69 6e 6e  65 72 24 29 0d 1b 6c 21  |ack,winner$)..l!|
00004c60  74 65 78 74 24 3d 63 6f  6c 24 2b 22 20 22 2b c3  |text$=col$+" "+.|
00004c70  63 75 72 72 65 6e 74 5f  73 63 6f 72 65 0d 1b 76  |current_score..v|
00004c80  14 e3 20 73 63 72 65 65  6e 20 3d 20 31 20 b8 20  |.. screen = 1 . |
00004c90  32 0d 1b 80 2f f2 64 72  61 77 74 65 78 74 62 6f  |2.../.drawtextbo|
00004ca0  78 28 64 69 63 65 70 61  6e 65 6c 28 29 2c 74 65  |x(dicepanel(),te|
00004cb0  78 74 24 2c 69 76 6f 72  79 2c 62 6c 61 63 6b 29  |xt$,ivory,black)|
00004cc0  0d 1b 8a 17 f2 73 77 69  74 63 68 5f 75 70 64 61  |.....switch_upda|
00004cd0  74 65 5f 62 61 6e 6b 0d  1b 94 0c ed 20 73 63 72  |te_bank..... scr|
00004ce0  65 65 6e 0d 1b 9e 05 cd  0d 1b a8 05 cd 0d 1b b2  |een.............|
00004cf0  05 e1 0d 1b bc 04 0d 1b  c6 04 0d 1b d0 18 dd f2  |................|
00004d00  63 6f 6d 70 75 74 65 72  70 6c 61 79 28 63 6f 6c  |computerplay(col|
00004d10  24 29 0d 1b da 17 ea 20  6d 6f 76 65 2c 6d 6f 76  |$)..... move,mov|
00004d20  65 6f 76 65 72 2c 70 2c  73 0d 1b e4 0d c8 8e 20  |eover,p,s...... |
00004d30  63 6f 6c 24 20 ca 0d 1b  ee 1c c9 20 22 77 68 69  |col$ ...... "whi|
00004d40  74 65 22 3a 77 68 69 74  65 62 65 61 72 69 6e 67  |te":whitebearing|
00004d50  3d a3 0d 1b f8 1c c9 20  22 62 6c 61 63 6b 22 3a  |=...... "black":|
00004d60  62 6c 61 63 6b 62 65 61  72 69 6e 67 3d a3 0d 1c  |blackbearing=...|
00004d70  02 05 cb 0d 1c 0c 18 f4  20 53 59 53 20 22 48 6f  |........ SYS "Ho|
00004d80  75 72 67 6c 61 73 73 5f  4f 6e 22 0d 1c 16 0f e3  |urglass_On".....|
00004d90  20 70 20 3d 20 31 20 b8  20 34 0d 1c 20 14 70 61  | p = 1 . 4.. .pa|
00004da0  6e 65 6c 61 63 74 69 76  65 28 70 29 3d a3 0d 1c  |nelactive(p)=...|
00004db0  2a 07 ed 20 70 0d 1c 34  1a f2 6d 6f 76 65 70 61  |*.. p..4..movepa|
00004dc0  6e 65 6c 3a f2 64 72 61  77 70 61 6e 65 6c 73 0d  |nel:.drawpanels.|
00004dd0  1c 3e 0e 6d 6f 76 65 6f  76 65 72 3d a3 0d 1c 48  |.>.moveover=...H|
00004de0  31 f2 63 6f 6d 70 75 74  65 72 5f 6f 66 66 65 72  |1.computer_offer|
00004df0  28 63 6f 6c 24 29 3a 20  e7 20 ac 20 67 61 6d 65  |(col$): . . game|
00004e00  69 6e 70 72 6f 67 72 65  73 73 20 8c 20 e1 0d 1c  |inprogress . ...|
00004e10  52 08 c8 97 20 87 0d 1c  5c 2e f2 64 69 63 65 3a  |R... ...\..dice:|
00004e20  20 64 69 63 65 72 6f 6c  6c 65 64 3d b9 3a 66 69  | dicerolled=.:fi|
00004e30  72 73 74 70 61 69 72 3d  b9 3a f2 64 69 63 65 70  |rstpair=.:.dicep|
00004e40  61 6e 65 6c 0d 1c 66 35  e7 20 a4 6f 70 65 6e 69  |anel..f5. .openi|
00004e50  6e 67 5f 6d 6f 76 65 28  63 6f 6c 24 29 20 8c 20  |ng_move(col$) . |
00004e60  f2 66 69 6e 64 5f 6f 70  65 6e 69 6e 67 5f 6d 6f  |.find_opening_mo|
00004e70  76 65 73 28 63 6f 6c 24  29 0d 1c 70 2a e7 20 64  |ves(col$)..p*. d|
00004e80  6f 75 62 6c 65 20 8c 20  66 69 72 73 74 70 61 69  |ouble . firstpai|
00004e90  72 3d b9 3a 64 69 63 65  61 76 61 69 6c 61 62 6c  |r=.:diceavailabl|
00004ea0  65 3d 32 0d 1c 7a 05 f5  0d 1c 84 21 e7 20 a4 6c  |e=2..z.....!. .l|
00004eb0  65 67 61 6c 6d 6f 76 65  61 76 61 69 6c 61 62 6c  |egalmoveavailabl|
00004ec0  65 28 63 6f 6c 24 29 20  8c 0d 1c 8e 24 e7 20 ac  |e(col$) ....$. .|
00004ed0  20 61 6c 6c 70 61 73 74  20 8c 20 61 6c 6c 70 61  | allpast . allpa|
00004ee0  73 74 20 3d 20 a4 61 6c  6c 70 61 73 74 0d 1c 98  |st = .allpast...|
00004ef0  24 6d 6f 76 65 20 3d 20  a4 63 68 6f 6f 73 65 63  |$move = .choosec|
00004f00  6f 6d 70 75 74 65 72 6d  6f 76 65 28 63 6f 6c 24  |omputermove(col$|
00004f10  29 0d 1c a2 23 73 74 61  72 74 70 6f 69 6e 74 20  |)...#startpoint |
00004f20  3d 20 6c 65 67 61 6c 6d  6f 76 65 73 28 31 2c 6d  |= legalmoves(1,m|
00004f30  6f 76 65 29 0d 1c ac 21  65 6e 64 70 6f 69 6e 74  |ove)...!endpoint|
00004f40  20 3d 20 6c 65 67 61 6c  6d 6f 76 65 73 28 32 2c  | = legalmoves(2,|
00004f50  6d 6f 76 65 29 0d 1c b6  21 64 69 63 65 75 73 65  |move)...!diceuse|
00004f60  64 20 3d 20 6c 65 67 61  6c 6d 6f 76 65 73 28 33  |d = legalmoves(3|
00004f70  2c 6d 6f 76 65 29 0d 1c  c0 20 62 61 72 6d 6f 76  |,move)... barmov|
00004f80  65 20 3d 20 6c 65 67 61  6c 6d 6f 76 65 73 28 34  |e = legalmoves(4|
00004f90  2c 6d 6f 76 65 29 0d 1c  ca 20 62 65 61 72 69 6e  |,move)... bearin|
00004fa0  67 20 3d 20 6c 65 67 61  6c 6d 6f 76 65 73 28 35  |g = legalmoves(5|
00004fb0  2c 6d 6f 76 65 29 0d 1c  d4 18 64 69 63 65 28 64  |,move)....dice(d|
00004fc0  69 63 65 75 73 65 64 29  20 2b 3d 31 32 38 0d 1c  |iceused) +=128..|
00004fd0  de 16 64 69 63 65 61 76  61 69 6c 61 62 6c 65 20  |..diceavailable |
00004fe0  2d 3d 20 31 0d 1c e8 2d  f2 63 6f 6d 70 75 74 65  |-= 1...-.compute|
00004ff0  72 64 72 61 67 28 63 6f  6c 24 2c 73 74 61 72 74  |rdrag(col$,start|
00005000  70 6f 69 6e 74 2c 65 6e  64 70 6f 69 6e 74 2c a3  |point,endpoint,.|
00005010  29 0d 1c f2 2a f2 65 78  65 63 75 74 65 6d 6f 76  |)...*.executemov|
00005020  65 28 63 6f 6c 24 2c 73  74 61 72 74 70 6f 69 6e  |e(col$,startpoin|
00005030  74 2c 65 6e 64 70 6f 69  6e 74 29 0d 1c fc 0e f2  |t,endpoint).....|
00005040  64 69 63 65 70 61 6e 65  6c 0d 1d 06 05 cc 0d 1d  |dicepanel.......|
00005050  10 1b c8 97 20 ee 3a f2  63 61 6e 74 6d 6f 76 65  |.... .:.cantmove|
00005060  28 63 6f 6c 24 2c 22 22  29 0d 1d 1a 0e 6d 6f 76  |(col$,"")....mov|
00005070  65 6f 76 65 72 3d b9 0d  1d 24 05 cd 0d 1d 2e 17  |eover=...$......|
00005080  e7 20 64 69 63 65 61 76  61 69 6c 61 62 6c 65 3d  |. diceavailable=|
00005090  30 20 8c 0d 1d 38 0e e7  20 64 6f 75 62 6c 65 20  |0 ...8.. double |
000050a0  8c 0d 1d 42 11 e7 20 66  69 72 73 74 70 61 69 72  |...B.. firstpair|
000050b0  20 8c 0d 1d 4c 39 64 69  63 65 61 76 61 69 6c 61  | ...L9diceavaila|
000050c0  62 6c 65 3d 32 3a 66 69  72 73 74 70 61 69 72 3d  |ble=2:firstpair=|
000050d0  a3 3a 64 69 63 65 28 31  29 2d 3d 31 32 38 3a 64  |.:dice(1)-=128:d|
000050e0  69 63 65 28 32 29 2d 3d  31 32 38 0d 1d 56 05 cc  |ice(2)-=128..V..|
000050f0  0d 1d 60 0e 6d 6f 76 65  6f 76 65 72 3d b9 0d 1d  |..`.moveover=...|
00005100  6a 05 cd 0d 1d 74 05 cc  0d 1d 7e 0e 6d 6f 76 65  |j....t....~.move|
00005110  6f 76 65 72 3d b9 0d 1d  88 05 cd 0d 1d 92 05 cd  |over=...........|
00005120  0d 1d 9c 21 fd 20 ac 20  67 61 6d 65 69 6e 70 72  |...!. . gameinpr|
00005130  6f 67 72 65 73 73 20 84  20 6d 6f 76 65 6f 76 65  |ogress . moveove|
00005140  72 0d 1d a6 1b 64 69 63  65 72 6f 6c 6c 65 64 3d  |r....dicerolled=|
00005150  a3 3a f2 64 69 63 65 70  61 6e 65 6c 0d 1d b0 1b  |.:.dicepanel....|
00005160  e7 20 a4 6f 70 65 6e 69  6e 67 5f 6d 6f 76 65 28  |. .opening_move(|
00005170  63 6f 6c 24 29 20 8c 0d  1d ba 34 e7 20 63 6f 6c  |col$) ....4. col|
00005180  24 3d 22 77 68 69 74 65  22 20 8c 20 77 68 69 74  |$="white" . whit|
00005190  65 6f 70 65 6e 69 6e 67  3d a3 20 8b 20 62 6c 61  |eopening=. . bla|
000051a0  63 6b 6f 70 65 6e 69 6e  67 3d a3 0d 1d c4 05 cd  |ckopening=......|
000051b0  0d 1d ce 35 f4 20 52 45  50 45 41 54 20 55 4e 54  |...5. REPEAT UNT|
000051c0  49 4c 20 47 45 54 3a 52  45 4d 20 2a 2a 2a 2a 2a  |IL GET:REM *****|
000051d0  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
000051e0  2a 2a 2a 2a 2a 0d 1d d8  05 e1 0d 1d e2 04 0d 1d  |*****...........|
000051f0  ec 18 dd a4 6f 70 65 6e  69 6e 67 5f 6d 6f 76 65  |....opening_move|
00005200  28 63 6f 6c 24 29 0d 1d  f6 0d c8 8e 20 63 6f 6c  |(col$)...... col|
00005210  24 20 ca 0d 1e 00 1d c9  20 22 77 68 69 74 65 22  |$ ...... "white"|
00005220  3a 20 3d 20 77 68 69 74  65 6f 70 65 6e 69 6e 67  |: = whiteopening|
00005230  0d 1e 0a 1d c9 20 22 62  6c 61 63 6b 22 3a 20 3d  |..... "black": =|
00005240  20 62 6c 61 63 6b 6f 70  65 6e 69 6e 67 0d 1e 14  | blackopening...|
00005250  05 cb 0d 1e 1e 04 0d 1e  28 15 dd f2 68 75 6d 61  |........(...huma|
00005260  6e 70 6c 61 79 28 63 6f  6c 24 29 0d 1e 32 08 c8  |nplay(col$)..2..|
00005270  97 20 ee 0d 1e 3c 34 ea  78 2c 79 2c 62 75 74 74  |. ...<4.x,y,butt|
00005280  6f 6e 2c 73 74 61 72 74  70 6f 69 6e 74 2c 65 6e  |on,startpoint,en|
00005290  64 70 6f 69 6e 74 2c 6c  65 67 61 6c 2c 6d 6f 76  |dpoint,legal,mov|
000052a0  65 6f 76 65 72 2c 73 0d  1e 46 0d c8 8e 20 63 6f  |eover,s..F... co|
000052b0  6c 24 20 ca 0d 1e 50 1c  c9 20 22 77 68 69 74 65  |l$ ...P.. "white|
000052c0  22 3a 77 68 69 74 65 62  65 61 72 69 6e 67 3d a3  |":whitebearing=.|
000052d0  0d 1e 5a 1c c9 20 22 62  6c 61 63 6b 22 3a 62 6c  |..Z.. "black":bl|
000052e0  61 63 6b 62 65 61 72 69  6e 67 3d a3 0d 1e 64 05  |ackbearing=...d.|
000052f0  cb 0d 1e 6e 18 f4 20 53  59 53 20 22 48 6f 75 72  |...n.. SYS "Hour|
00005300  67 6c 61 73 73 5f 4f 6e  22 0d 1e 78 0e 6d 6f 76  |glass_On"..x.mov|
00005310  65 6f 76 65 72 3d a3 0d  1e 82 2c ea 20 70 72 65  |eover=....,. pre|
00005320  73 73 65 64 2c 20 70 61  6e 6e 6f 3a 20 70 72 65  |ssed, panno: pre|
00005330  73 73 65 64 20 3d 20 a3  3a 20 70 61 6e 6e 6f 20  |ssed = .: panno |
00005340  3d 20 30 0d 1e 8c 16 70  61 6e 65 6c 61 63 74 69  |= 0....panelacti|
00005350  76 65 28 31 29 20 3d 20  b9 0d 1e 96 45 e7 20 64  |ve(1) = ....E. d|
00005360  6f 75 62 6c 65 74 75 72  6e 24 20 3d 22 65 69 74  |oubleturn$ ="eit|
00005370  68 65 72 22 20 84 20 64  6f 75 62 6c 65 74 75 72  |her" . doubletur|
00005380  6e 24 20 3d 20 63 6f 6c  24 20 8c 20 70 61 6e 65  |n$ = col$ . pane|
00005390  6c 61 63 74 69 76 65 28  32 29 20 3d 20 b9 0d 1e  |lactive(2) = ...|
000053a0  a0 16 70 61 6e 65 6c 61  63 74 69 76 65 28 33 29  |..panelactive(3)|
000053b0  20 3d 20 a3 0d 1e aa 16  70 61 6e 65 6c 61 63 74  | = .....panelact|
000053c0  69 76 65 28 34 29 20 3d  20 b9 0d 1e b4 1a f2 6d  |ive(4) = ......m|
000053d0  6f 76 65 70 61 6e 65 6c  3a f2 64 72 61 77 70 61  |ovepanel:.drawpa|
000053e0  6e 65 6c 73 0d 1e be 25  f4 20 6c 6f 6f 6b 20 66  |nels...%. look f|
000053f0  6f 72 20 6d 6f 75 73 65  20 70 72 65 73 73 65 73  |or mouse presses|
00005400  20 69 6e 20 70 61 6e 65  6c 0d 1e c8 19 f4 20 53  | in panel..... S|
00005410  59 53 20 22 48 6f 75 72  67 6c 61 73 73 5f 4f 66  |YS "Hourglass_Of|
00005420  66 22 0d 1e d2 12 e7 20  ac 20 73 74 61 72 74 73  |f"..... . starts|
00005430  65 74 20 8c 0d 1e dc 05  f5 0d 1e e6 15 70 61 6e  |et ..........pan|
00005440  6e 6f 20 3d 20 a4 67 65  74 70 61 6e 65 6c 0d 1e  |no = .getpanel..|
00005450  f0 24 e7 20 70 61 6e 6e  6f 20 3d 20 32 20 8c 20  |.$. panno = 2 . |
00005460  f2 6f 66 66 65 72 64 6f  75 62 6c 65 28 63 6f 6c  |.offerdouble(col|
00005470  24 29 0d 1e fa 11 e7 20  70 61 6e 6e 6f 20 3d 20  |$)..... panno = |
00005480  34 20 8c 0d 1f 04 35 e7  20 a4 73 75 72 65 62 6f  |4 ....5. .surebo|
00005490  78 28 22 22 29 20 8c 20  67 61 6d 65 69 6e 70 72  |x("") . gameinpr|
000054a0  6f 67 72 65 73 73 3d a3  3a 67 61 6d 65 63 6f 6d  |ogress=.:gamecom|
000054b0  70 6c 65 74 65 64 3d a3  0d 1f 0e 17 c8 97 20 c8  |pleted=....... .|
000054c0  93 20 30 2c 30 2c 31 32  33 39 2c 31 30 32 33 0d  |. 0,0,1239,1023.|
000054d0  1f 18 05 cd 0d 1f 22 22  fd 20 ac 20 67 61 6d 65  |......"". . game|
000054e0  69 6e 70 72 6f 67 72 65  73 73 20 84 20 70 61 6e  |inprogress . pan|
000054f0  6e 6f 20 3d 20 31 0d 1f  2c 05 cd 0d 1f 36 1a e7  |no = 1..,....6..|
00005500  20 ac 20 67 61 6d 65 69  6e 70 72 6f 67 72 65 73  | . gameinprogres|
00005510  73 20 8c 20 e1 0d 1f 40  42 70 61 6e 65 6c 61 63  |s . ...@Bpanelac|
00005520  74 69 76 65 28 31 29 3d  a3 3a 70 61 6e 65 6c 61  |tive(1)=.:panela|
00005530  63 74 69 76 65 28 32 29  3d a3 3a 70 61 6e 65 6c  |ctive(2)=.:panel|
00005540  61 63 74 69 76 65 28 34  29 3d a3 3a f2 64 72 61  |active(4)=.:.dra|
00005550  77 70 61 6e 65 6c 73 0d  1f 4a 2e f4 20 67 61 6d  |wpanels..J.. gam|
00005560  65 20 6d 61 79 20 62 65  20 6f 76 65 72 20 64 75  |e may be over du|
00005570  65 20 74 6f 20 72 65 66  75 73 65 64 20 6f 66 66  |e to refused off|
00005580  65 72 20 73 6f 0d 1f 54  16 e7 20 67 61 6d 65 69  |er so..T.. gamei|
00005590  6e 70 72 6f 67 72 65 73  73 20 8c 0d 1f 5e 2d f2  |nprogress ...^-.|
000055a0  64 69 63 65 3a 64 69 63  65 72 6f 6c 6c 65 64 3d  |dice:dicerolled=|
000055b0  b9 3a 66 69 72 73 74 70  61 69 72 3d b9 3a f2 64  |.:firstpair=.:.d|
000055c0  69 63 65 70 61 6e 65 6c  0d 1f 68 2a e7 20 64 6f  |icepanel..h*. do|
000055d0  75 62 6c 65 20 8c 20 66  69 72 73 74 70 61 69 72  |uble . firstpair|
000055e0  3d b9 3a 64 69 63 65 61  76 61 69 6c 61 62 6c 65  |=.:diceavailable|
000055f0  3d 32 0d 1f 72 05 f5 0d  1f 7c 21 e7 20 a4 6c 65  |=2..r....|!. .le|
00005600  67 61 6c 6d 6f 76 65 61  76 61 69 6c 61 62 6c 65  |galmoveavailable|
00005610  28 63 6f 6c 24 29 20 8c  0d 1f 86 24 e7 20 ac 20  |(col$) ....$. . |
00005620  61 6c 6c 70 61 73 74 20  8c 20 61 6c 6c 70 61 73  |allpast . allpas|
00005630  74 20 3d 20 a4 61 6c 6c  70 61 73 74 0d 1f 90 05  |t = .allpast....|
00005640  f5 0d 1f 9a 1b 73 74 61  72 74 70 6f 69 6e 74 3d  |.....startpoint=|
00005650  30 3a 65 6e 64 70 6f 69  6e 74 3d 30 0d 1f a4 09  |0:endpoint=0....|
00005660  2a 46 58 31 35 0d 1f ae  11 c8 97 20 78 2c 79 2c  |*FX15...... x,y,|
00005670  62 75 74 74 6f 6e 0d 1f  b8 29 e7 20 62 75 74 74  |button...). butt|
00005680  6f 6e 20 8c 20 73 74 61  72 74 70 6f 69 6e 74 20  |on . startpoint |
00005690  3d 20 a4 70 6f 69 6e 74  78 79 28 78 2c 79 29 0d  |= .pointxy(x,y).|
000056a0  1f c2 24 e7 20 a4 6c 65  67 61 6c 73 74 61 72 74  |..$. .legalstart|
000056b0  28 73 74 61 72 74 70 6f  69 6e 74 2c 63 6f 6c 24  |(startpoint,col$|
000056c0  29 20 8c 0d 1f cc 1d 65  6e 64 70 6f 69 6e 74 20  |) .....endpoint |
000056d0  3d a4 64 72 61 67 28 63  6f 6c 24 2c 78 2c 79 29  |=.drag(col$,x,y)|
000056e0  0d 1f d6 2f 6c 65 67 61  6c 3d 20 a4 6c 65 67 61  |.../legal= .lega|
000056f0  6c 6d 6f 76 65 28 63 6f  6c 24 2c 73 74 61 72 74  |lmove(col$,start|
00005700  70 6f 69 6e 74 2c 65 6e  64 70 6f 69 6e 74 29 0d  |point,endpoint).|
00005710  1f e0 05 cc 0d 1f ea 0b  6c 65 67 61 6c 3d a3 0d  |........legal=..|
00005720  1f f4 05 cd 0d 1f fe 0b  fd 20 6c 65 67 61 6c 0d  |......... legal.|
00005730  20 08 2a f2 65 78 65 63  75 74 65 6d 6f 76 65 28  | .*.executemove(|
00005740  63 6f 6c 24 2c 73 74 61  72 74 70 6f 69 6e 74 2c  |col$,startpoint,|
00005750  65 6e 64 70 6f 69 6e 74  29 0d 20 12 0e f2 64 69  |endpoint). ...di|
00005760  63 65 70 61 6e 65 6c 0d  20 1c 05 cc 0d 20 26 16  |cepanel. .... &.|
00005770  f2 63 61 6e 74 6d 6f 76  65 28 63 6f 6c 24 2c 22  |.cantmove(col$,"|
00005780  22 29 0d 20 30 0e 6d 6f  76 65 6f 76 65 72 3d b9  |"). 0.moveover=.|
00005790  0d 20 3a 05 cd 0d 20 44  17 e7 20 64 69 63 65 61  |. :... D.. dicea|
000057a0  76 61 69 6c 61 62 6c 65  3d 30 20 8c 0d 20 4e 0e  |vailable=0 .. N.|
000057b0  e7 20 64 6f 75 62 6c 65  20 8c 0d 20 58 11 e7 20  |. double .. X.. |
000057c0  66 69 72 73 74 70 61 69  72 20 8c 0d 20 62 39 64  |firstpair .. b9d|
000057d0  69 63 65 61 76 61 69 6c  61 62 6c 65 3d 32 3a 66  |iceavailable=2:f|
000057e0  69 72 73 74 70 61 69 72  3d a3 3a 64 69 63 65 28  |irstpair=.:dice(|
000057f0  31 29 2d 3d 31 32 38 3a  64 69 63 65 28 32 29 2d  |1)-=128:dice(2)-|
00005800  3d 31 32 38 0d 20 6c 05  cc 0d 20 76 0e 6d 6f 76  |=128. l... v.mov|
00005810  65 6f 76 65 72 3d b9 0d  20 80 05 cd 0d 20 8a 05  |eover=.. .... ..|
00005820  cc 0d 20 94 0e 6d 6f 76  65 6f 76 65 72 3d b9 0d  |.. ..moveover=..|
00005830  20 9e 05 cd 0d 20 a8 05  cd 0d 20 b2 21 fd 20 ac  | .... .... .!. .|
00005840  20 67 61 6d 65 69 6e 70  72 6f 67 72 65 73 73 20  | gameinprogress |
00005850  84 20 6d 6f 76 65 6f 76  65 72 0d 20 bc 05 cd 0d  |. moveover. ....|
00005860  20 c6 1b 64 69 63 65 72  6f 6c 6c 65 64 3d a3 3a  | ..dicerolled=.:|
00005870  f2 64 69 63 65 70 61 6e  65 6c 0d 20 d0 05 e1 0d  |.dicepanel. ....|
00005880  20 da 04 0d 20 e4 13 dd  a4 73 68 6f 77 63 6f 6c  | ... ....showcol|
00005890  28 63 6f 6c 24 29 0d 20  ee 28 e7 20 63 6f 6c 24  |(col$). .(. col$|
000058a0  3d 22 77 68 69 74 65 22  20 8c 20 3d 22 57 48 49  |="white" . ="WHI|
000058b0  54 45 22 20 8b 20 3d 22  42 4c 41 43 4b 22 0d 20  |TE" . ="BLACK". |
000058c0  f8 04 0d 21 02 17 dd f2  6f 66 66 65 72 64 6f 75  |...!....offerdou|
000058d0  62 6c 65 28 63 6f 6c 24  29 0d 21 0c 2b ea 20 6f  |ble(col$).!.+. o|
000058e0  70 70 63 6f 6c 24 2c 6f  66 66 73 65 74 2c 74 65  |ppcol$,offset,te|
000058f0  6d 70 62 6f 78 28 29 3a  de 20 74 65 6d 70 62 6f  |mpbox():. tempbo|
00005900  78 28 34 29 0d 21 16 21  74 65 6d 70 62 6f 78 28  |x(4).!.!tempbox(|
00005910  29 3d 73 75 72 65 62 6f  78 28 29 3a 6f 66 66 73  |)=surebox():offs|
00005920  65 74 3d 36 30 0d 21 20  49 73 75 72 65 62 6f 78  |et=60.! Isurebox|
00005930  28 32 29 2d 3d 32 34 30  3a 73 75 72 65 62 6f 78  |(2)-=240:surebox|
00005940  28 34 29 2d 3d 32 34 30  3a 73 75 72 65 62 6f 78  |(4)-=240:surebox|
00005950  28 31 29 2d 3d 6f 66 66  73 65 74 3a 73 75 72 65  |(1)-=offset:sure|
00005960  62 6f 78 28 33 29 2d 3d  6f 66 66 73 65 74 0d 21  |box(3)-=offset.!|
00005970  2a 36 e7 20 63 6f 6c 24  3d 22 77 68 69 74 65 22  |*6. col$="white"|
00005980  20 8c 20 6f 70 70 63 6f  6c 24 3d 22 62 6c 61 63  | . oppcol$="blac|
00005990  6b 22 20 8b 20 6f 70 70  63 6f 6c 24 3d 22 77 68  |k" . oppcol$="wh|
000059a0  69 74 65 22 0d 21 34 21  e7 20 a4 73 75 72 65 62  |ite".!4!. .sureb|
000059b0  6f 78 28 22 4f 46 46 45  52 20 44 4f 55 42 4c 45  |ox("OFFER DOUBLE|
000059c0  3f 22 29 20 8c 0d 21 3e  1d e7 20 a4 63 6f 6d 70  |?") ..!>.. .comp|
000059d0  75 74 65 72 63 6f 6c 28  6f 70 70 63 6f 6c 24 29  |utercol(oppcol$)|
000059e0  20 8c 0d 21 48 25 64 6f  75 62 6c 65 64 3d a4 64  | ..!H%doubled=.d|
000059f0  6f 75 62 6c 65 5f 61 63  63 65 70 74 65 64 28 6f  |ouble_accepted(o|
00005a00  70 70 63 6f 6c 24 29 0d  21 52 05 cc 0d 21 5c 28  |ppcol$).!R...!\(|
00005a10  64 6f 75 62 6c 65 64 20  3d 20 a4 73 75 72 65 62  |doubled = .sureb|
00005a20  6f 78 28 22 41 43 43 45  50 54 20 44 4f 55 42 4c  |ox("ACCEPT DOUBL|
00005a30  45 3f 22 29 0d 21 66 05  cd 0d 21 70 0f e7 20 64  |E?").!f...!p.. d|
00005a40  6f 75 62 6c 65 64 20 8c  0d 21 7a 1b f2 61 63 63  |oubled ..!z..acc|
00005a50  65 70 74 5f 64 6f 75 62  6c 65 28 6f 70 70 63 6f  |ept_double(oppco|
00005a60  6c 24 29 0d 21 84 05 cc  0d 21 8e 14 64 6f 75 62  |l$).!....!..doub|
00005a70  6c 65 5f 72 65 66 75 73  65 64 3d b9 0d 21 98 11  |le_refused=..!..|
00005a80  f2 77 69 6e 6e 65 72 28  63 6f 6c 24 29 0d 21 a2  |.winner(col$).!.|
00005a90  05 cd 0d 21 ac 05 cd 0d  21 b6 17 73 75 72 65 62  |...!....!..sureb|
00005aa0  6f 78 28 29 3d 74 65 6d  70 62 6f 78 28 29 0d 21  |ox()=tempbox().!|
00005ab0  c0 05 e1 0d 21 ca 04 0d  21 d4 1a dd f2 63 6f 6d  |....!...!....com|
00005ac0  70 75 74 65 72 5f 6f 66  66 65 72 28 63 6f 6c 24  |puter_offer(col$|
00005ad0  29 0d 21 de 08 c8 97 20  ee 0d 21 e8 35 e7 20 ac  |).!.... ..!.5. .|
00005ae0  20 28 64 6f 75 62 6c 65  74 75 72 6e 24 3d 63 6f  | (doubleturn$=co|
00005af0  6c 24 20 84 20 64 6f 75  62 6c 65 74 75 72 6e 24  |l$ . doubleturn$|
00005b00  3d 22 65 69 74 68 65 72  22 29 20 8c 20 e1 0d 21  |="either") . ..!|
00005b10  f2 2b ea 20 6f 70 70 63  6f 6c 24 2c 6f 66 66 73  |.+. oppcol$,offs|
00005b20  65 74 2c 74 65 6d 70 62  6f 78 28 29 3a de 20 74  |et,tempbox():. t|
00005b30  65 6d 70 62 6f 78 28 34  29 0d 21 fc 21 74 65 6d  |empbox(4).!.!tem|
00005b40  70 62 6f 78 28 29 3d 73  75 72 65 62 6f 78 28 29  |pbox()=surebox()|
00005b50  3a 6f 66 66 73 65 74 3d  36 30 0d 22 06 49 73 75  |:offset=60.".Isu|
00005b60  72 65 62 6f 78 28 32 29  2d 3d 32 34 30 3a 73 75  |rebox(2)-=240:su|
00005b70  72 65 62 6f 78 28 34 29  2d 3d 32 34 30 3a 73 75  |rebox(4)-=240:su|
00005b80  72 65 62 6f 78 28 31 29  2d 3d 6f 66 66 73 65 74  |rebox(1)-=offset|
00005b90  3a 73 75 72 65 62 6f 78  28 33 29 2d 3d 6f 66 66  |:surebox(3)-=off|
00005ba0  73 65 74 0d 22 10 36 e7  20 63 6f 6c 24 3d 22 77  |set.".6. col$="w|
00005bb0  68 69 74 65 22 20 8c 20  6f 70 70 63 6f 6c 24 3d  |hite" . oppcol$=|
00005bc0  22 62 6c 61 63 6b 22 20  8b 20 6f 70 70 63 6f 6c  |"black" . oppcol|
00005bd0  24 3d 22 77 68 69 74 65  22 0d 22 1a 2c e7 20 63  |$="white".".,. c|
00005be0  75 72 72 65 6e 74 5f 73  63 6f 72 65 20 3c 20 38  |urrent_score < 8|
00005bf0  20 2d 20 64 6f 75 62 6c  65 5f 74 68 72 65 73 68  | - double_thresh|
00005c00  6f 6c 64 20 8c 0d 22 24  12 f4 20 6f 66 66 65 72  |old .."$.. offer|
00005c10  20 64 6f 75 62 6c 65 0d  22 2e 1d e7 20 a4 63 6f  | double."... .co|
00005c20  6d 70 75 74 65 72 63 6f  6c 28 6f 70 70 63 6f 6c  |mputercol(oppcol|
00005c30  24 29 20 8c 0d 22 38 32  f2 63 61 6e 74 6d 6f 76  |$) .."82.cantmov|
00005c40  65 28 63 6f 6c 24 2c 22  20 20 22 2b a4 73 68 6f  |e(col$,"  "+.sho|
00005c50  77 63 6f 6c 28 63 6f 6c  24 29 2b 22 20 44 4f 55  |wcol(col$)+" DOU|
00005c60  42 4c 45 53 22 29 0d 22  42 27 64 6f 75 62 6c 65  |BLES")."B'double|
00005c70  64 20 3d 20 a4 64 6f 75  62 6c 65 5f 61 63 63 65  |d = .double_acce|
00005c80  70 74 65 64 28 6f 70 70  63 6f 6c 24 29 0d 22 4c  |pted(oppcol$)."L|
00005c90  05 cc 0d 22 56 28 64 6f  75 62 6c 65 64 20 3d 20  |..."V(doubled = |
00005ca0  a4 73 75 72 65 62 6f 78  28 22 41 43 43 45 50 54  |.surebox("ACCEPT|
00005cb0  20 44 4f 55 42 4c 45 3f  22 29 0d 22 60 05 cd 0d  | DOUBLE?")."`...|
00005cc0  22 6a 0f e7 20 64 6f 75  62 6c 65 64 20 8c 0d 22  |"j.. doubled .."|
00005cd0  74 1b f2 61 63 63 65 70  74 5f 64 6f 75 62 6c 65  |t..accept_double|
00005ce0  28 6f 70 70 63 6f 6c 24  29 0d 22 7e 05 cc 0d 22  |(oppcol$)."~..."|
00005cf0  88 14 64 6f 75 62 6c 65  5f 72 65 66 75 73 65 64  |..double_refused|
00005d00  3d b9 0d 22 92 11 f2 77  69 6e 6e 65 72 28 63 6f  |=.."...winner(co|
00005d10  6c 24 29 0d 22 9c 05 cd  0d 22 a6 05 cd 0d 22 b0  |l$)."...."....".|
00005d20  17 73 75 72 65 62 6f 78  28 29 3d 74 65 6d 70 62  |.surebox()=tempb|
00005d30  6f 78 28 29 0d 22 ba 05  e1 0d 22 c4 04 0d 22 ce  |ox()."...."...".|
00005d40  17 dd a4 63 6f 6d 70 75  74 65 72 63 6f 6c 28 63  |...computercol(c|
00005d50  6f 6c 24 29 0d 22 d8 58  3d 28 63 6f 6c 24 3d 22  |ol$).".X=(col$="|
00005d60  77 68 69 74 65 22 20 80  20 77 68 69 74 65 70 6c  |white" . whitepl|
00005d70  61 79 65 72 24 3d 22 43  4f 4d 50 55 54 45 52 22  |ayer$="COMPUTER"|
00005d80  29 20 84 20 28 63 6f 6c  24 3d 22 62 6c 61 63 6b  |) . (col$="black|
00005d90  22 20 80 20 62 6c 61 63  6b 70 6c 61 79 65 72 24  |" . blackplayer$|
00005da0  3d 22 43 4f 4d 50 55 54  45 52 22 29 0d 22 e2 04  |="COMPUTER")."..|
00005db0  0d 22 ec 1b dd a4 64 6f  75 62 6c 65 5f 61 63 63  |."....double_acc|
00005dc0  65 70 74 65 64 28 63 6f  6c 24 29 0d 22 f6 23 ea  |epted(col$).".#.|
00005dd0  20 74 68 72 65 73 68 6f  6c 64 2c 6f 77 6e 70 69  | threshold,ownpi|
00005de0  65 63 65 73 2c 6f 70 70  70 69 65 63 65 73 0d 23  |eces,opppieces.#|
00005df0  00 78 e7 20 63 6f 6c 24  3d 22 77 68 69 74 65 22  |.x. col$="white"|
00005e00  20 8c 20 6f 77 6e 70 69  65 63 65 73 20 3d 20 77  | . ownpieces = w|
00005e10  68 69 74 65 70 69 65 63  65 73 3a 20 6f 70 70 70  |hitepieces: oppp|
00005e20  69 65 63 65 73 20 3d 20  62 6c 61 63 6b 70 69 65  |ieces = blackpie|
00005e30  63 65 73 20 8b 20 6f 77  6e 70 69 65 63 65 73 20  |ces . ownpieces |
00005e40  3d 20 62 6c 61 63 6b 70  69 65 63 65 73 3a 20 6f  |= blackpieces: o|
00005e50  70 70 70 69 65 63 65 73  20 3d 20 77 68 69 74 65  |pppieces = white|
00005e60  70 69 65 63 65 73 0d 23  0a 24 74 68 72 65 73 68  |pieces.#.$thresh|
00005e70  6f 6c 64 20 3d 20 2d 64  6f 75 62 6c 65 5f 74 68  |old = -double_th|
00005e80  72 65 73 68 6f 6c 64 20  2d 38 0d 23 14 1f e7 20  |reshold -8.#... |
00005e90  61 6c 6c 70 61 73 74 20  8c 20 74 68 72 65 73 68  |allpast . thresh|
00005ea0  6f 6c 64 20 3d 20 2d 31  36 0d 23 1e 24 e7 20 6f  |old = -16.#.$. o|
00005eb0  70 70 70 69 65 63 65 73  20 3c 20 31 30 20 8c 20  |pppieces < 10 . |
00005ec0  74 68 72 65 73 68 6f 6c  64 20 3d 20 30 0d 23 28  |threshold = 0.#(|
00005ed0  21 e7 20 63 75 72 72 65  6e 74 5f 73 63 6f 72 65  |!. current_score|
00005ee0  20 3c 20 74 68 72 65 73  68 6f 6c 64 20 8c 0d 23  | < threshold ..#|
00005ef0  32 14 64 6f 75 62 6c 65  5f 72 65 66 75 73 65 64  |2.double_refused|
00005f00  3d b9 0d 23 3c 32 f2 63  61 6e 74 6d 6f 76 65 28  |=..#<2.cantmove(|
00005f10  63 6f 6c 24 2c 22 20 20  22 2b a4 73 68 6f 77 63  |col$,"  "+.showc|
00005f20  6f 6c 28 63 6f 6c 24 29  2b 22 20 52 45 46 55 53  |ol(col$)+" REFUS|
00005f30  45 53 22 29 0d 23 46 06  3d a3 0d 23 50 05 cc 0d  |ES").#F.=..#P...|
00005f40  23 5a 06 3d b9 0d 23 64  05 cd 0d 23 6e 04 0d 23  |#Z.=..#d...#n..#|
00005f50  78 19 dd f2 61 63 63 65  70 74 5f 64 6f 75 62 6c  |x...accept_doubl|
00005f60  65 28 63 6f 6c 24 29 0d  23 82 15 c8 99 20 22 48  |e(col$).#.... "H|
00005f70  6f 75 72 67 6c 61 73 73  5f 4f 6e 22 0d 23 8c 42  |ourglass_On".#.B|
00005f80  e7 20 64 6f 75 62 6c 65  63 75 62 65 20 3d 20 36  |. doublecube = 6|
00005f90  34 20 8c 20 64 6f 75 62  6c 65 63 75 62 65 20 3d  |4 . doublecube =|
00005fa0  20 32 20 8b 20 64 6f 75  62 6c 65 63 75 62 65 20  | 2 . doublecube |
00005fb0  3d 20 32 2a 64 6f 75 62  6c 65 63 75 62 65 0d 23  |= 2*doublecube.#|
00005fc0  96 40 e7 20 64 6f 75 62  6c 65 63 75 62 65 20 3d  |.@. doublecube =|
00005fd0  20 36 34 20 8c 20 64 6f  75 62 6c 65 74 75 72 6e  | 64 . doubleturn|
00005fe0  24 3d 22 6e 65 69 74 68  65 72 22 20 8b 20 64 6f  |$="neither" . do|
00005ff0  75 62 6c 65 74 75 72 6e  24 3d 63 6f 6c 24 0d 23  |ubleturn$=col$.#|
00006000  a0 1e 70 61 6e 65 6c 61  63 74 69 76 65 28 32 29  |..panelactive(2)|
00006010  3d a3 3a 64 6f 75 62 6c  65 64 3d b9 0d 23 aa 49  |=.:doubled=..#.I|
00006020  e7 20 a4 63 6f 6d 70 75  74 65 72 63 6f 6c 28 63  |. .computercol(c|
00006030  6f 6c 24 29 20 8c 20 f2  63 61 6e 74 6d 6f 76 65  |ol$) . .cantmove|
00006040  28 63 6f 6c 24 2c 22 20  20 22 2b a4 73 68 6f 77  |(col$,"  "+.show|
00006050  63 6f 6c 28 63 6f 6c 24  29 2b 22 20 41 43 43 45  |col(col$)+" ACCE|
00006060  50 54 53 22 29 0d 23 b4  13 f2 73 68 61 64 6f 77  |PTS").#...shadow|
00006070  5f 64 72 61 77 62 61 72  0d 23 be 16 f2 64 72 61  |_drawbar.#...dra|
00006080  77 5f 64 6f 75 62 6c 65  5f 70 61 6e 65 6c 0d 23  |w_double_panel.#|
00006090  c8 16 c8 99 20 22 48 6f  75 72 67 6c 61 73 73 5f  |.... "Hourglass_|
000060a0  4f 66 66 22 0d 23 d2 05  e1 0d 23 dc 04 0d 23 e6  |Off".#....#...#.|
000060b0  1c dd a4 6c 65 67 61 6c  73 74 61 72 74 28 70 6f  |...legalstart(po|
000060c0  69 6e 74 2c 63 6f 6c 24  29 0d 23 f0 0f ea 20 6c  |int,col$).#... l|
000060d0  65 67 61 6c 2c 62 61 72  0d 23 fa 15 e7 20 70 6f  |egal,bar.#... po|
000060e0  69 6e 74 20 3d 20 30 20  8c 20 3d 20 a3 0d 24 04  |int = 0 . = ..$.|
000060f0  1d f4 20 63 68 65 63 6b  20 66 6f 72 20 70 69 65  |.. check for pie|
00006100  63 65 73 20 6f 6e 20 62  61 72 0d 24 0e 1a e7 20  |ces on bar.$... |
00006110  a4 70 69 65 63 65 73 6f  6e 62 61 72 28 63 6f 6c  |.piecesonbar(col|
00006120  24 29 20 8c 0d 24 18 1b  e7 20 70 6f 69 6e 74 20  |$) ..$... point |
00006130  3d 20 39 39 20 8c 20 3d  b9 20 8b 20 3d 20 a3 0d  |= 99 . =. . = ..|
00006140  24 22 05 cd 0d 24 2c 4e  f4 20 4f 74 68 65 72 77  |$"...$,N. Otherw|
00006150  69 73 65 20 70 6f 69 6e  74 20 69 73 20 22 6c 65  |ise point is "le|
00006160  67 61 6c 22 20 69 66 20  70 69 65 63 65 73 20 6f  |gal" if pieces o|
00006170  66 20 63 6f 72 72 65 63  74 20 63 6f 6c 6f 75 72  |f correct colour|
00006180  20 61 72 65 20 70 72 65  73 65 6e 74 20 6f 6e 20  | are present on |
00006190  69 74 0d 24 36 0b 6c 65  67 61 6c 3d a3 0d 24 40  |it.$6.legal=..$@|
000061a0  0d c8 8e 20 63 6f 6c 24  20 ca 0d 24 4a 3b c9 20  |... col$ ..$J;. |
000061b0  22 77 68 69 74 65 22 3a  20 e7 20 62 6f 61 72 64  |"white": . board|
000061c0  3f 70 6f 69 6e 74 20 3e  30 20 80 20 62 6f 61 72  |?point >0 . boar|
000061d0  64 3f 70 6f 69 6e 74 3c  31 32 38 20 8c 20 6c 65  |d?point<128 . le|
000061e0  67 61 6c 3d b9 0d 24 54  2d c9 20 22 62 6c 61 63  |gal=..$T-. "blac|
000061f0  6b 22 3a 20 e7 20 62 6f  61 72 64 3f 70 6f 69 6e  |k": . board?poin|
00006200  74 20 3e 31 32 38 20 8c  20 6c 65 67 61 6c 20 3d  |t >128 . legal =|
00006210  20 b9 0d 24 5e 05 cb 0d  24 68 0a 3d 6c 65 67 61  | ..$^...$h.=lega|
00006220  6c 0d 24 72 04 0d 24 7c  17 dd a4 70 69 65 63 65  |l.$r..$|...piece|
00006230  73 6f 6e 62 61 72 28 63  6f 6c 24 29 0d 24 86 0f  |sonbar(col$).$..|
00006240  ea 20 62 61 72 3a 62 61  72 3d a3 0d 24 90 0d c8  |. bar:bar=..$...|
00006250  8e 20 63 6f 6c 24 20 ca  0d 24 9a 0e c9 20 22 77  |. col$ ..$... "w|
00006260  68 69 74 65 22 3a 0d 24  a4 13 e7 20 62 61 72 77  |hite":.$... barw|
00006270  68 69 74 65 20 3e 30 20  8c 0d 24 ae 09 62 61 72  |hite >0 ..$..bar|
00006280  3d b9 0d 24 b8 05 cd 0d  24 c2 0e c9 20 22 62 6c  |=..$....$... "bl|
00006290  61 63 6b 22 3a 0d 24 cc  13 e7 20 62 61 72 62 6c  |ack":.$... barbl|
000062a0  61 63 6b 20 3e 30 20 8c  0d 24 d6 09 62 61 72 3d  |ack >0 ..$..bar=|
000062b0  b9 0d 24 e0 05 cd 0d 24  ea 05 cb 0d 24 f4 08 3d  |..$....$....$..=|
000062c0  62 61 72 0d 24 fe 04 0d  25 08 04 0d 25 12 12 dd  |bar.$...%...%...|
000062d0  a4 70 6f 69 6e 74 78 79  28 78 2c 79 29 0d 25 1c  |.pointxy(x,y).%.|
000062e0  3f f4 20 72 65 74 75 72  6e 73 20 70 6f 69 6e 74  |?. returns point|
000062f0  20 6e 75 6d 62 65 72 20  63 6f 72 72 65 73 70 6f  | number correspo|
00006300  6e 64 69 6e 67 20 74 6f  20 73 63 72 65 65 6e 20  |nding to screen |
00006310  63 6f 2d 6f 72 64 69 6e  61 74 65 73 0d 25 26 26  |co-ordinates.%&&|
00006320  f4 20 6f 72 20 39 39 20  66 6f 72 20 63 6c 69 63  |. or 99 for clic|
00006330  6b 20 6f 6e 20 62 61 72  20 6f 72 20 65 6c 73 65  |k on bar or else|
00006340  20 30 0d 25 30 34 ea 20  62 61 72 6c 65 66 74 2c  | 0.%04. barleft,|
00006350  74 6f 70 62 6f 61 72 64  2c 62 6f 74 74 6f 6d 62  |topboard,bottomb|
00006360  6f 61 72 64 2c 70 6f 69  6e 74 2c 78 70 2c 79 70  |oard,point,xp,yp|
00006370  2c 66 6f 75 6e 64 0d 25  3a 24 62 61 72 6c 65 66  |,found.%:$barlef|
00006380  74 20 3d 20 28 62 6f 61  72 64 73 69 7a 65 2d 62  |t = (boardsize-b|
00006390  61 72 77 69 64 74 68 29  2f 32 0d 25 44 2e e7 20  |arwidth)/2.%D.. |
000063a0  78 20 3e 20 62 61 72 6c  65 66 74 20 80 20 78 20  |x > barleft . x |
000063b0  3c 20 62 61 72 6c 65 66  74 2b 62 61 72 77 69 64  |< barleft+barwid|
000063c0  74 68 20 8c 20 3d 39 39  0d 25 4e 58 e7 20 79 20  |th . =99.%NX. y |
000063d0  3e 20 62 6f 61 72 64 73  69 7a 65 2d 62 6f 72 64  |> boardsize-bord|
000063e0  65 72 73 69 7a 65 2d 70  6f 69 6e 74 68 65 69 67  |ersize-pointheig|
000063f0  68 74 20 80 20 78 20 3c  20 62 6f 61 72 64 73 69  |ht . x < boardsi|
00006400  7a 65 20 8c 20 74 6f 70  62 6f 61 72 64 20 3d 20  |ze . topboard = |
00006410  b9 20 8b 20 74 6f 70 62  6f 61 72 64 20 3d 20 a3  |. . topboard = .|
00006420  0d 25 58 50 e7 20 79 20  20 3c 20 62 6f 72 64 65  |.%XP. y  < borde|
00006430  72 73 69 7a 65 2b 70 6f  69 6e 74 68 65 69 67 68  |rsize+pointheigh|
00006440  74 20 80 20 78 20 3c 20  62 6f 61 72 64 73 69 7a  |t . x < boardsiz|
00006450  65 20 8c 20 62 6f 74 74  6f 6d 62 6f 61 72 64 20  |e . bottomboard |
00006460  3d 20 b9 20 8b 20 62 6f  74 74 6f 6d 20 3d 20 a3  |= . . bottom = .|
00006470  0d 25 62 25 e7 20 ac 20  28 74 6f 70 62 6f 61 72  |.%b%. . (topboar|
00006480  64 20 84 20 62 6f 74 74  6f 6d 62 6f 61 72 64 29  |d . bottomboard)|
00006490  20 8c 20 3d 30 0d 25 6c  0d 66 6f 75 6e 64 20 3d  | . =0.%l.found =|
000064a0  20 a3 0d 25 76 27 e7 20  74 6f 70 62 6f 61 72 64  | ..%v'. topboard|
000064b0  20 8c 20 70 6f 69 6e 74  20 3d 20 30 20 8b 20 70  | . point = 0 . p|
000064c0  6f 69 6e 74 20 3d 20 31  32 0d 25 80 1a c8 95 20  |oint = 12.%.... |
000064d0  ac 20 66 6f 75 6e 64 20  80 20 70 6f 69 6e 74 20  |. found . point |
000064e0  3c 32 34 0d 25 8a 0c 70  6f 69 6e 74 2b 3d 31 0d  |<24.%..point+=1.|
000064f0  25 94 1c f2 73 74 61 72  74 70 6f 69 6e 74 28 70  |%...startpoint(p|
00006500  6f 69 6e 74 2c 78 70 2c  79 70 29 0d 25 9e 2b e7  |oint,xp,yp).%.+.|
00006510  20 78 3e 20 78 70 20 80  20 78 20 3c 20 78 70 2b  | x> xp . x < xp+|
00006520  70 6f 69 6e 74 77 69 64  74 68 20 8c 20 66 6f 75  |pointwidth . fou|
00006530  6e 64 20 3d 20 b9 0d 25  a8 05 ce 0d 25 b2 45 e7  |nd = ..%....%.E.|
00006540  20 28 74 6f 70 62 6f 61  72 64 20 80 20 70 6f 69  | (topboard . poi|
00006550  6e 74 3e 31 32 29 20 84  20 28 62 6f 74 74 6f 6d  |nt>12) . (bottom|
00006560  62 6f 61 72 64 20 80 20  70 6f 69 6e 74 3e 32 34  |board . point>24|
00006570  29 20 8c 20 3d 30 20 8b  20 3d 20 70 6f 69 6e 74  |) . =0 . = point|
00006580  0d 25 bc 04 0d 25 c6 1e  dd a4 64 72 61 67 28 63  |.%...%....drag(c|
00006590  6f 6c 24 2c 73 74 61 72  74 78 2c 73 74 61 72 74  |ol$,startx,start|
000065a0  79 29 0d 25 d0 36 f4 20  61 6c 6c 6f 77 73 20 70  |y).%.6. allows p|
000065b0  6c 61 79 65 72 20 74 6f  20 64 72 61 67 20 63 69  |layer to drag ci|
000065c0  72 63 6c 65 20 66 72 6f  6d 20 73 74 61 72 74 69  |rcle from starti|
000065d0  6e 67 20 70 6f 69 6e 74  0d 25 da 3e f4 20 72 65  |ng point.%.>. re|
000065e0  74 75 72 6e 73 20 70 6f  69 6e 74 20 6e 75 6d 62  |turns point numb|
000065f0  65 72 20 6f 66 20 70 6f  73 69 74 69 6f 6e 20 77  |er of position w|
00006600  68 65 72 65 20 6d 6f 75  73 65 20 69 73 20 72 65  |here mouse is re|
00006610  6c 65 61 73 65 64 0d 25  e4 20 ea 20 78 2c 79 2c  |leased.%. . x,y,|
00006620  62 75 74 74 6f 6e 2c 72  3a 72 3d 70 69 65 63 65  |button,r:r=piece|
00006630  73 69 7a 65 2f 32 0d 25  ee 09 e6 20 33 2c 31 0d  |size/2.%... 3,1.|
00006640  25 f8 11 c8 97 20 78 2c  79 2c 62 75 74 74 6f 6e  |%.... x,y,button|
00006650  0d 26 02 21 e7 20 62 75  74 74 6f 6e 20 8c 20 c8  |.&.!. button . .|
00006660  8f 20 73 74 61 72 74 78  2c 73 74 61 72 74 79 2c  |. startx,starty,|
00006670  72 0d 26 0c 0d c8 95 20  62 75 74 74 6f 6e 0d 26  |r.&.... button.&|
00006680  16 0a c8 97 20 ee 20 32  0d 26 20 09 2a 46 58 31  |.... . 2.& .*FX1|
00006690  35 0d 26 2a 11 c8 97 20  78 2c 79 2c 62 75 74 74  |5.&*... x,y,butt|
000066a0  6f 6e 0d 26 34 16 c8 8f  20 73 74 61 72 74 78 2c  |on.&4... startx,|
000066b0  73 74 61 72 74 79 2c 72  0d 26 3e 0e e7 20 62 75  |starty,r.&>.. bu|
000066c0  74 74 6f 6e 20 8c 0d 26  48 0c c8 8f 20 78 2c 79  |tton ..&H... x,y|
000066d0  2c 72 0d 26 52 15 73 74  61 72 74 78 3d 78 3a 73  |,r.&R.startx=x:s|
000066e0  74 61 72 74 79 3d 79 0d  26 5c 05 cd 0d 26 66 05  |tarty=y.&\...&f.|
000066f0  ce 0d 26 70 0a c8 97 20  ee 20 31 0d 26 7a 38 e7  |..&p... . 1.&z8.|
00006700  20 73 74 61 72 74 78 3e  62 6f 61 72 64 73 69 7a  | startx>boardsiz|
00006710  65 20 8c 20 3d 31 31 31  20 8b 20 3d a4 70 6f 69  |e . =111 . =.poi|
00006720  6e 74 78 79 28 73 74 61  72 74 78 2c 73 74 61 72  |ntxy(startx,star|
00006730  74 79 29 0d 26 84 23 f4  20 31 31 31 20 63 6f 64  |ty).&.#. 111 cod|
00006740  65 20 66 6f 72 20 62 65  61 72 69 6e 67 20 6f 66  |e for bearing of|
00006750  66 20 6d 6f 76 65 0d 26  8e 04 0d 26 98 34 dd f2  |f move.&...&.4..|
00006760  63 6f 6d 70 75 74 65 72  64 72 61 67 28 63 6f 6c  |computerdrag(col|
00006770  24 2c 73 74 61 72 74 70  6f 69 6e 74 2c 65 6e 64  |$,startpoint,end|
00006780  70 6f 69 6e 74 2c 68 69  74 6d 6f 76 65 29 0d 26  |point,hitmove).&|
00006790  a2 99 ea 20 73 74 61 72  74 78 2c 73 74 61 72 74  |... startx,start|
000067a0  79 2c 65 6e 64 78 2c 65  6e 64 79 2c 6e 70 73 74  |y,endx,endy,npst|
000067b0  61 72 74 2c 6e 70 65 6e  64 2c 6f 66 66 73 65 74  |art,npend,offset|
000067c0  2c 78 73 74 65 70 2c 79  73 74 65 70 2c 78 2c 79  |,xstep,ystep,x,y|
000067d0  2c 73 74 65 70 73 2c 73  74 65 70 2c 72 2c 6f 6c  |,steps,step,r,ol|
000067e0  64 78 31 2c 6f 6c 64 79  31 2c 6f 6c 64 78 32 2c  |dx1,oldy1,oldx2,|
000067f0  6f 6c 64 79 32 2c 62 6f  78 28 29 2c 6f 70 70 63  |oldy2,box(),oppc|
00006800  6f 6c 24 2c 73 70 72 69  74 65 24 2c 6f 6c 64 73  |ol$,sprite$,olds|
00006810  70 72 69 74 65 31 24 2c  6f 6c 64 73 70 72 69 74  |prite1$,oldsprit|
00006820  65 32 24 2c 6b 2c 69 0d  26 ac 17 ef 20 32 34 2c  |e2$,k,i.&... 24,|
00006830  30 3b 30 3b 31 30 32 34  3b 31 30 32 33 3b 0d 26  |0;0;1024;1023;.&|
00006840  b6 08 6b 3d 32 30 0d 26  c0 36 e7 20 63 6f 6c 24  |..k=20.&.6. col$|
00006850  3d 22 77 68 69 74 65 22  20 8c 20 6f 70 70 63 6f  |="white" . oppco|
00006860  6c 24 3d 22 62 6c 61 63  6b 22 20 8b 20 6f 70 70  |l$="black" . opp|
00006870  63 6f 6c 24 3d 22 77 68  69 74 65 22 0d 26 ca 0c  |col$="white".&..|
00006880  de 20 62 6f 78 28 34 29  0d 26 d4 26 f4 20 50 52  |. box(4).&.&. PR|
00006890  4f 43 67 65 74 5f 73 70  72 69 74 65 28 22 74 65  |OCget_sprite("te|
000068a0  6d 70 22 2c 67 61 6d 65  62 6f 78 28 29 29 0d 26  |mp",gamebox()).&|
000068b0  de 11 72 3d 70 69 65 63  65 73 69 7a 65 2f 32 0d  |..r=piecesize/2.|
000068c0  26 e8 17 e7 20 73 74 61  72 74 70 6f 69 6e 74 20  |&... startpoint |
000068d0  3d 20 39 39 20 8c 0d 26  f2 3c e7 20 63 6f 6c 24  |= 99 ..&.<. col$|
000068e0  3d 22 77 68 69 74 65 22  20 8c 20 6e 70 73 74 61  |="white" . npsta|
000068f0  72 74 20 3d 20 62 61 72  77 68 69 74 65 20 8b 20  |rt = barwhite . |
00006900  6e 70 73 74 61 72 74 20  3d 20 62 61 72 62 6c 61  |npstart = barbla|
00006910  63 6b 0d 26 fc 05 cc 0d  27 06 24 6e 70 73 74 61  |ck.&....'.$npsta|
00006920  72 74 20 3d 20 62 6f 61  72 64 3f 73 74 61 72 74  |rt = board?start|
00006930  70 6f 69 6e 74 20 83 20  31 32 38 0d 27 10 05 cd  |point . 128.'...|
00006940  0d 27 1a 0f e7 20 68 69  74 6d 6f 76 65 20 8c 0d  |.'... hitmove ..|
00006950  27 24 38 e7 20 63 6f 6c  24 3d 22 77 68 69 74 65  |'$8. col$="white|
00006960  22 20 8c 20 6e 70 65 6e  64 20 3d 20 62 61 72 77  |" . npend = barw|
00006970  68 69 74 65 20 8b 20 6e  70 65 6e 64 20 3d 20 62  |hite . npend = b|
00006980  61 72 62 6c 61 63 6b 0d  27 2e 05 cc 0d 27 38 20  |arblack.'....'8 |
00006990  6e 70 65 6e 64 20 3d 20  62 6f 61 72 64 3f 65 6e  |npend = board?en|
000069a0  64 70 6f 69 6e 74 20 83  20 31 32 38 0d 27 42 05  |dpoint . 128.'B.|
000069b0  cd 0d 27 4c 1b e7 20 6e  70 73 74 61 72 74 3e 36  |..'L.. npstart>6|
000069c0  20 8c 20 6e 70 73 74 61  72 74 3d 36 0d 27 56 1a  | . npstart=6.'V.|
000069d0  e7 20 6e 70 65 6e 64 20  3c 36 20 8c 20 6e 70 65  |. npend <6 . npe|
000069e0  6e 64 20 2b 3d 31 0d 27  60 17 e7 20 6e 70 65 6e  |nd +=1.'`.. npen|
000069f0  64 3e 36 20 8c 20 6e 70  65 6e 64 3d 36 0d 27 6a  |d>6 . npend=6.'j|
00006a00  43 e7 20 6e 70 65 6e 64  20 3d 20 32 20 80 20 a4  |C. npend = 2 . .|
00006a10  70 6f 69 6e 74 73 74 61  74 65 28 65 6e 64 70 6f  |pointstate(endpo|
00006a20  69 6e 74 29 20 3d 20 28  22 6f 6e 65 22 2b 6f 70  |int) = ("one"+op|
00006a30  70 63 6f 6c 24 29 20 8c  20 6e 70 65 6e 64 3d 31  |pcol$) . npend=1|
00006a40  0d 27 74 3a f2 66 69 6e  64 70 69 65 63 65 70 6f  |.'t:.findpiecepo|
00006a50  69 6e 74 28 63 6f 6c 24  2c 6e 70 73 74 61 72 74  |int(col$,npstart|
00006a60  2c 73 74 61 72 74 70 6f  69 6e 74 2c 73 74 61 72  |,startpoint,star|
00006a70  74 78 2c 73 74 61 72 74  79 29 0d 27 7e 32 f2 66  |tx,starty).'~2.f|
00006a80  69 6e 64 70 69 65 63 65  70 6f 69 6e 74 28 63 6f  |indpiecepoint(co|
00006a90  6c 24 2c 6e 70 65 6e 64  2c 65 6e 64 70 6f 69 6e  |l$,npend,endpoin|
00006aa0  74 2c 65 6e 64 78 2c 65  6e 64 79 29 0d 27 88 38  |t,endx,endy).'.8|
00006ab0  73 74 65 70 73 20 3d 20  a8 28 33 36 2a a4 64 69  |steps = .(36*.di|
00006ac0  73 74 61 6e 63 65 28 73  74 61 72 74 78 2c 73 74  |stance(startx,st|
00006ad0  61 72 74 79 2c 65 6e 64  78 2c 65 6e 64 79 29 2f  |arty,endx,endy)/|
00006ae0  34 38 30 29 0d 27 92 1d  78 73 74 65 70 3d 28 65  |480).'..xstep=(e|
00006af0  6e 64 78 2d 73 74 61 72  74 78 29 2f 73 74 65 70  |ndx-startx)/step|
00006b00  73 0d 27 9c 1d 79 73 74  65 70 3d 28 65 6e 64 79  |s.'..ystep=(endy|
00006b10  2d 73 74 61 72 74 79 29  2f 73 74 65 70 73 0d 27  |-starty)/steps.'|
00006b20  a6 11 e7 20 ac 20 68 69  74 6d 6f 76 65 20 8c 0d  |... . hitmove ..|
00006b30  27 b0 16 e7 20 73 74 61  72 74 70 6f 69 6e 74 20  |'... startpoint |
00006b40  3c 39 39 20 8c 0d 27 ba  27 62 6f 61 72 64 3f 73  |<99 ..'.'board?s|
00006b50  74 61 72 74 70 6f 69 6e  74 3d 62 6f 61 72 64 3f  |tartpoint=board?|
00006b60  73 74 61 72 74 70 6f 69  6e 74 2d 31 0d 27 c4 2f  |startpoint-1.'./|
00006b70  e7 20 62 6f 61 72 64 3f  73 74 61 72 74 70 6f 69  |. board?startpoi|
00006b80  6e 74 3d 31 32 38 20 8c  20 62 6f 61 72 64 3f 73  |nt=128 . board?s|
00006b90  74 61 72 74 70 6f 69 6e  74 3d 30 0d 27 ce 05 cc  |tartpoint=0.'...|
00006ba0  0d 27 d8 0d c8 8e 20 63  6f 6c 24 20 ca 0d 27 e2  |.'.... col$ ..'.|
00006bb0  1b c9 20 22 77 68 69 74  65 22 3a 20 62 61 72 77  |.. "white": barw|
00006bc0  68 69 74 65 20 2d 3d 31  0d 27 ec 1b c9 20 22 62  |hite -=1.'... "b|
00006bd0  6c 61 63 6b 22 3a 20 62  61 72 62 6c 61 63 6b 20  |lack": barblack |
00006be0  2d 3d 31 0d 27 f6 05 cb  0d 28 00 05 cd 0d 28 0a  |-=1.'....(....(.|
00006bf0  05 cd 0d 28 14 0e f4 20  47 43 4f 4c 20 33 2c 31  |...(... GCOL 3,1|
00006c00  0d 28 1e 1c f4 20 43 49  52 43 4c 45 20 73 74 61  |.(... CIRCLE sta|
00006c10  72 74 78 2c 73 74 61 72  74 79 2c 72 0d 28 28 17  |rtx,starty,r.((.|
00006c20  73 74 61 72 74 78 2d 3d  72 3a 73 74 61 72 74 79  |startx-=r:starty|
00006c30  2d 3d 72 0d 28 32 0d 2a  46 58 20 31 31 32 2c 31  |-=r.(2.*FX 112,1|
00006c40  0d 28 3c 0d 2a 46 58 20  31 31 33 2c 31 0d 28 46  |.(<.*FX 113,1.(F|
00006c50  20 75 70 64 61 74 65 5f  62 61 6e 6b 3d 31 3a 64  | update_bank=1:d|
00006c60  69 73 70 6c 61 79 5f 62  61 6e 6b 3d 31 0d 28 50  |isplay_bank=1.(P|
00006c70  17 e7 20 73 74 61 72 74  70 6f 69 6e 74 20 3d 20  |.. startpoint = |
00006c80  39 39 20 8c 0d 28 5a 13  f2 73 68 61 64 6f 77 5f  |99 ..(Z..shadow_|
00006c90  64 72 61 77 62 61 72 0d  28 64 05 cc 0d 28 6e 23  |drawbar.(d...(n#|
00006ca0  f2 73 68 61 64 6f 77 5f  64 72 61 77 70 6f 69 6e  |.shadow_drawpoin|
00006cb0  74 28 73 74 61 72 74 70  6f 69 6e 74 2c a3 29 0d  |t(startpoint,.).|
00006cc0  28 78 05 cd 0d 28 82 26  f2 67 72 61 62 61 72 65  |(x...(.&.grabare|
00006cd0  61 28 22 74 65 6d 70 31  22 2c 73 74 61 72 74 78  |a("temp1",startx|
00006ce0  2c 73 74 61 72 74 79 2c  6b 29 0d 28 8c 13 ec 20  |,starty,k).(... |
00006cf0  73 74 61 72 74 78 2c 73  74 61 72 74 79 0d 28 96  |startx,starty.(.|
00006d00  11 e7 20 ac 20 68 69 74  6d 6f 76 65 20 8c 0d 28  |.. . hitmove ..(|
00006d10  a0 18 f2 70 6c 6f 74 5f  73 70 72 69 74 65 28 63  |...plot_sprite(c|
00006d20  6f 6c 24 2c 38 29 0d 28  aa 33 e3 20 69 20 3d 20  |ol$,8).(.3. i = |
00006d30  31 20 b8 20 38 3a f2 73  77 69 74 63 68 5f 64 69  |1 . 8:.switch_di|
00006d40  73 70 6c 61 79 5f 62 61  6e 6b 3a f2 64 65 6c 61  |splay_bank:.dela|
00006d50  79 28 31 30 29 3a ed 20  69 0d 28 b4 05 cd 0d 28  |y(10):. i.(....(|
00006d60  be 1d 6f 6c 64 78 31 3d  73 74 61 72 74 78 3a 6f  |..oldx1=startx:o|
00006d70  6c 64 79 31 3d 73 74 61  72 74 79 0d 28 c8 17 f2  |ldy1=starty.(...|
00006d80  73 77 69 74 63 68 5f 75  70 64 61 74 65 5f 62 61  |switch_update_ba|
00006d90  6e 6b 0d 28 d2 26 f2 67  72 61 62 61 72 65 61 28  |nk.(.&.grabarea(|
00006da0  22 74 65 6d 70 32 22 2c  73 74 61 72 74 78 2c 73  |"temp2",startx,s|
00006db0  74 61 72 74 79 2c 6b 29  0d 28 dc 13 ec 20 73 74  |tarty,k).(... st|
00006dc0  61 72 74 78 2c 73 74 61  72 74 79 0d 28 e6 26 e7  |artx,starty.(.&.|
00006dd0  20 ac 20 68 69 74 6d 6f  76 65 20 8c 20 f2 70 6c  | . hitmove . .pl|
00006de0  6f 74 5f 73 70 72 69 74  65 28 63 6f 6c 24 2c 38  |ot_sprite(col$,8|
00006df0  29 0d 28 f0 1d 6f 6c 64  78 32 3d 73 74 61 72 74  |).(..oldx2=start|
00006e00  78 3a 6f 6c 64 79 32 3d  73 74 61 72 74 79 0d 28  |x:oldy2=starty.(|
00006e10  fa 17 f2 73 77 69 74 63  68 5f 75 70 64 61 74 65  |...switch_update|
00006e20  5f 62 61 6e 6b 0d 29 04  2b 6f 6c 64 73 70 72 69  |_bank.).+oldspri|
00006e30  74 65 31 24 3d 22 74 65  6d 70 31 22 3a 6f 6c 64  |te1$="temp1":old|
00006e40  73 70 72 69 74 65 32 24  3d 22 74 65 6d 70 32 22  |sprite2$="temp2"|
00006e50  0d 29 0e 18 f2 73 77 69  74 63 68 5f 64 69 73 70  |.)...switch_disp|
00006e60  6c 61 79 5f 62 61 6e 6b  0d 29 18 05 f4 0d 29 22  |lay_bank.)....)"|
00006e70  1a e3 20 73 74 65 70 20  3d 20 31 20 b8 20 73 74  |.. step = 1 . st|
00006e80  65 70 73 20 2b 20 31 0d  29 2c 15 e7 20 75 70 64  |eps + 1.),.. upd|
00006e90  61 74 65 5f 62 61 6e 6b  3d 31 20 8c 0d 29 36 17  |ate_bank=1 ..)6.|
00006ea0  73 70 72 69 74 65 24 3d  6f 6c 64 73 70 72 69 74  |sprite$=oldsprit|
00006eb0  65 31 24 0d 29 40 15 ec  20 6f 6c 64 78 31 2d 6b  |e1$.)@.. oldx1-k|
00006ec0  2c 6f 6c 64 79 31 2d 6b  0d 29 4a 05 cc 0d 29 54  |,oldy1-k.)J...)T|
00006ed0  17 73 70 72 69 74 65 24  3d 6f 6c 64 73 70 72 69  |.sprite$=oldspri|
00006ee0  74 65 32 24 0d 29 5e 15  ec 20 6f 6c 64 78 32 2d  |te2$.)^.. oldx2-|
00006ef0  6b 2c 6f 6c 64 79 32 2d  6b 0d 29 68 05 cd 0d 29  |k,oldy2-k.)h...)|
00006f00  72 1b f2 70 6c 6f 74 5f  73 70 72 69 74 65 28 73  |r..plot_sprite(s|
00006f10  70 72 69 74 65 24 2c 30  29 0d 29 7c 18 e7 20 73  |prite$,0).)|.. s|
00006f20  74 65 70 20 3c 20 73 74  65 70 73 20 2b 20 31 20  |tep < steps + 1 |
00006f30  8c 0d 29 86 1f 73 74 61  72 74 78 2b 3d 78 73 74  |..)..startx+=xst|
00006f40  65 70 3a 73 74 61 72 74  79 2b 3d 79 73 74 65 70  |ep:starty+=ystep|
00006f50  0d 29 90 05 cd 0d 29 9a  17 e7 20 75 70 64 61 74  |.)....)... updat|
00006f60  65 5f 62 61 6e 6b 20 3d  20 31 20 8c 0d 29 a4 20  |e_bank = 1 ..). |
00006f70  6f 6c 64 78 31 3d 73 74  61 72 74 78 3a 20 6f 6c  |oldx1=startx: ol|
00006f80  64 79 31 20 3d 20 73 74  61 72 74 79 0d 29 ae 05  |dy1 = starty.)..|
00006f90  cc 0d 29 b8 20 6f 6c 64  78 32 3d 73 74 61 72 74  |..). oldx2=start|
00006fa0  78 3a 20 6f 6c 64 79 32  20 3d 20 73 74 61 72 74  |x: oldy2 = start|
00006fb0  79 0d 29 c2 05 cd 0d 29  cc 1a 73 70 72 69 74 65  |y.)....)..sprite|
00006fc0  24 3d a4 75 70 64 61 74  65 5f 73 70 72 69 74 65  |$=.update_sprite|
00006fd0  0d 29 d6 26 f2 67 72 61  62 61 72 65 61 28 73 70  |.).&.grabarea(sp|
00006fe0  72 69 74 65 24 2c 73 74  61 72 74 78 2c 73 74 61  |rite$,startx,sta|
00006ff0  72 74 79 2c 6b 29 0d 29  e0 41 e7 20 75 70 64 61  |rty,k).).A. upda|
00007000  74 65 5f 62 61 6e 6b 20  3d 20 31 20 8c 20 6f 6c  |te_bank = 1 . ol|
00007010  64 73 70 72 69 74 65 31  24 3d 73 70 72 69 74 65  |dsprite1$=sprite|
00007020  24 20 8b 20 6f 6c 64 73  70 72 69 74 65 32 24 3d  |$ . oldsprite2$=|
00007030  73 70 72 69 74 65 24 0d  29 ea 13 ec 20 73 74 61  |sprite$.)... sta|
00007040  72 74 78 2c 73 74 61 72  74 79 0d 29 f4 18 f2 70  |rtx,starty.)...p|
00007050  6c 6f 74 5f 73 70 72 69  74 65 28 63 6f 6c 24 2c  |lot_sprite(col$,|
00007060  38 29 0d 29 fe 18 f2 73  77 69 74 63 68 5f 64 69  |8).)...switch_di|
00007070  73 70 6c 61 79 5f 62 61  6e 6b 0d 2a 08 17 f2 73  |splay_bank.*...s|
00007080  77 69 74 63 68 5f 75 70  64 61 74 65 5f 62 61 6e  |witch_update_ban|
00007090  6b 0d 2a 12 12 f4 20 50  52 4f 43 64 65 6c 61 79  |k.*... PROCdelay|
000070a0  28 31 29 0d 2a 1c 0a ed  20 73 74 65 70 0d 2a 26  |(1).*... step.*&|
000070b0  18 f2 73 77 69 74 63 68  5f 64 69 73 70 6c 61 79  |..switch_display|
000070c0  5f 62 61 6e 6b 0d 2a 30  05 f4 0d 2a 3a 08 ef 20  |_bank.*0...*:.. |
000070d0  32 36 0d 2a 44 05 e1 0d  2a 4e 04 0d 2a 58 1b dd  |26.*D...*N..*X..|
000070e0  a4 64 69 73 74 61 6e 63  65 28 78 31 2c 79 31 2c  |.distance(x1,y1,|
000070f0  78 32 2c 79 32 29 0d 2a  62 1b 3d b6 28 28 78 31  |x2,y2).*b.=.((x1|
00007100  2d 78 32 29 5e 32 2b 28  79 31 2d 79 32 29 5e 32  |-x2)^2+(y1-y2)^2|
00007110  29 0d 2a 6c 04 0d 2a 76  1d dd f2 67 72 61 62 61  |).*l..*v...graba|
00007120  72 65 61 28 73 70 72 69  74 65 24 2c 78 2c 79 2c  |rea(sprite$,x,y,|
00007130  6b 29 0d 2a 80 30 ec 20  78 2d 6b 2c 79 2d 6b 3a  |k).*.0. x-k,y-k:|
00007140  ec 20 78 2b 70 69 65 63  65 73 69 7a 65 2b 6b 2c  |. x+piecesize+k,|
00007150  73 74 61 72 74 79 2b 70  69 65 63 65 73 69 7a 65  |starty+piecesize|
00007160  2b 6b 0d 2a 8a 2e c8 99  20 22 4f 53 5f 53 70 72  |+k.*.... "OS_Spr|
00007170  69 74 65 4f 70 22 2c 32  35 36 2b 31 34 2c 73 70  |iteOp",256+14,sp|
00007180  72 69 74 65 61 72 65 61  2c 73 70 72 69 74 65 24  |ritearea,sprite$|
00007190  0d 2a 94 05 e1 0d 2a 9e  04 0d 2a a8 04 0d 2a b2  |.*....*...*...*.|
000071a0  13 dd a4 75 70 64 61 74  65 5f 73 70 72 69 74 65  |...update_sprite|
000071b0  0d 2a bc 18 3d 22 74 65  6d 70 22 2b c3 75 70 64  |.*..="temp"+.upd|
000071c0  61 74 65 5f 62 61 6e 6b  0d 2a c6 04 0d 2a d0 2e  |ate_bank.*...*..|
000071d0  dd f2 66 69 6e 64 70 69  65 63 65 70 6f 69 6e 74  |..findpiecepoint|
000071e0  28 63 6f 6c 24 2c 70 69  65 63 65 2c 70 6f 69 6e  |(col$,piece,poin|
000071f0  74 2c f8 20 78 2c f8 20  79 29 0d 2a da 0c ea 20  |t,. x,. y).*... |
00007200  6f 66 66 73 65 74 0d 2a  e4 13 e7 20 70 6f 69 6e  |offset.*... poin|
00007210  74 20 3d 20 31 31 31 20  8c 0d 2a ee 16 78 20 3d  |t = 111 ..*..x =|
00007220  20 62 6f 61 72 64 73 69  7a 65 20 2b 20 36 34 0d  | boardsize + 64.|
00007230  2a f8 13 79 20 3d 20 62  6f 61 72 64 73 69 7a 65  |*..y = boardsize|
00007240  2f 32 0d 2b 02 05 e1 0d  2b 0c 05 cd 0d 2b 16 12  |/2.+....+....+..|
00007250  e7 20 70 6f 69 6e 74 20  3d 20 39 39 20 8c 0d 2b  |. point = 99 ..+|
00007260  20 22 6f 66 66 73 65 74  20 3d 20 28 70 69 65 63  | "offset = (piec|
00007270  65 2d 30 2e 35 29 2a 70  69 65 63 65 73 69 7a 65  |e-0.5)*piecesize|
00007280  0d 2b 2a 0d c8 8e 20 63  6f 6c 24 20 ca 0d 2b 34  |.+*... col$ ..+4|
00007290  0e c9 20 22 77 68 69 74  65 22 3a 0d 2b 3e 16 f2  |.. "white":.+>..|
000072a0  73 74 61 72 74 70 6f 69  6e 74 28 37 2c 78 2c 79  |startpoint(7,x,y|
000072b0  29 0d 2b 48 12 79 20 3d  79 74 6f 70 2d 6f 66 66  |).+H.y =ytop-off|
000072c0  73 65 74 0d 2b 52 0d c9  20 22 62 6c 61 63 6b 22  |set.+R.. "black"|
000072d0  0d 2b 5c 17 f2 73 74 61  72 74 70 6f 69 6e 74 28  |.+\..startpoint(|
000072e0  31 38 2c 78 2c 79 29 0d  2b 66 18 79 20 3d 20 79  |18,x,y).+f.y = y|
000072f0  62 6f 74 74 6f 6d 20 2b  20 6f 66 66 73 65 74 0d  |bottom + offset.|
00007300  2b 70 05 cb 0d 2b 7a 1c  78 2b 3d 70 6f 69 6e 74  |+p...+z.x+=point|
00007310  77 69 64 74 68 2b 62 61  72 77 69 64 74 68 2f 32  |width+barwidth/2|
00007320  0d 2b 84 05 cc 0d 2b 8e  1a f2 73 74 61 72 74 70  |.+....+...startp|
00007330  6f 69 6e 74 28 70 6f 69  6e 74 2c 78 2c 79 29 0d  |oint(point,x,y).|
00007340  2b 98 14 78 2b 3d 20 70  6f 69 6e 74 77 69 64 74  |+..x+= pointwidt|
00007350  68 2f 32 0d 2b a2 23 6f  66 66 73 65 74 20 3d 20  |h/2.+.#offset = |
00007360  28 70 69 65 63 65 2d 30  2e 35 30 29 2a 70 69 65  |(piece-0.50)*pie|
00007370  63 65 73 69 7a 65 0d 2b  ac 36 e7 20 70 6f 69 6e  |cesize.+.6. poin|
00007380  74 20 3c 20 31 33 20 8c  20 79 20 3d 20 79 74 6f  |t < 13 . y = yto|
00007390  70 2d 6f 66 66 73 65 74  20 8b 20 79 20 3d 79 62  |p-offset . y =yb|
000073a0  6f 74 74 6f 6d 2b 6f 66  66 73 65 74 0d 2b b6 05  |ottom+offset.+..|
000073b0  cd 0d 2b c0 05 e1 0d 2b  ca 04 0d 2b d4 1e dd a4  |..+....+...+....|
000073c0  6c 65 67 61 6c 6d 6f 76  65 61 76 61 69 6c 61 62  |legalmoveavailab|
000073d0  6c 65 28 63 6f 6c 24 29  0d 2b de 3c f4 20 43 61  |le(col$).+.<. Ca|
000073e0  6c 6c 65 64 20 61 74 20  73 74 61 72 74 20 6f 66  |lled at start of|
000073f0  20 6d 6f 76 65 20 74 6f  20 63 68 65 63 6b 20 74  | move to check t|
00007400  68 61 74 20 6d 6f 76 65  20 63 61 6e 20 62 65 20  |hat move can be |
00007410  6d 61 64 65 0d 2b e8 42  f4 20 61 6c 73 6f 20 63  |made.+.B. also c|
00007420  72 65 61 74 65 73 20 6c  69 73 74 20 6f 66 20 6c  |reates list of l|
00007430  65 67 61 6c 20 6d 6f 76  65 73 20 66 6f 72 20 75  |egal moves for u|
00007440  73 65 20 62 79 20 63 6f  6d 70 75 74 65 72 20 76  |se by computer v|
00007450  65 72 73 69 6f 6e 0d 2b  f2 27 ea 20 64 69 63 65  |ersion.+.'. dice|
00007460  2c 72 6f 6c 6c 2c 66 72  6f 6d 2c 74 6f 2c 75 73  |,roll,from,to,us|
00007470  69 6e 67 2c 64 65 73 74  2c 63 6f 64 65 0d 2b fc  |ing,dest,code.+.|
00007480  1f 6e 6c 65 67 61 6c 3d  30 3a 20 62 65 61 72 69  |.nlegal=0: beari|
00007490  6e 67 70 6f 73 73 69 62  6c 65 3d a3 0d 2c 06 3a  |ngpossible=..,.:|
000074a0  e7 20 a4 6f 70 65 6e 69  6e 67 5f 6d 6f 76 65 28  |. .opening_move(|
000074b0  63 6f 6c 24 29 20 8c 20  e7 20 a4 73 65 74 5f 6f  |col$) . . .set_o|
000074c0  70 65 6e 69 6e 67 5f 6d  6f 76 65 28 63 6f 6c 24  |pening_move(col$|
000074d0  29 20 8c 20 3d b9 0d 2c  10 13 f4 20 63 68 65 63  |) . =..,... chec|
000074e0  6b 20 62 61 72 6d 6f 76  65 0d 2c 1a 34 e7 20 a4  |k barmove.,.4. .|
000074f0  70 69 65 63 65 73 6f 6e  62 61 72 28 63 6f 6c 24  |piecesonbar(col$|
00007500  29 20 8c 20 62 61 72 6d  6f 76 65 20 3d 20 b9 20  |) . barmove = . |
00007510  8b 20 62 61 72 6d 6f 76  65 20 3d 20 a3 0d 2c 24  |. barmove = ..,$|
00007520  0f e7 20 62 61 72 6d 6f  76 65 20 8c 0d 2c 2e 18  |.. barmove ..,..|
00007530  e3 20 64 69 63 65 20 3d  20 31 20 b8 20 64 69 63  |. dice = 1 . dic|
00007540  65 28 30 29 0d 2c 38 13  72 6f 6c 6c 3d 64 69 63  |e(0).,8.roll=dic|
00007550  65 28 64 69 63 65 29 0d  2c 42 12 e7 20 72 6f 6c  |e(dice).,B.. rol|
00007560  6c 20 3c 20 31 32 38 20  8c 0d 2c 4c 41 e7 20 a4  |l < 128 ..,LA. .|
00007570  64 65 73 74 69 6e 61 74  69 6f 6e 4f 4b 28 39 39  |destinationOK(99|
00007580  2c 72 6f 6c 6c 2c 63 6f  6c 24 2c 64 65 73 74 29  |,roll,col$,dest)|
00007590  20 8c 20 f2 61 64 64 6c  65 67 61 6c 28 39 39 2c  | . .addlegal(99,|
000075a0  64 65 73 74 2c 64 69 63  65 29 0d 2c 56 05 cd 0d  |dest,dice).,V...|
000075b0  2c 60 0a ed 20 64 69 63  65 0d 2c 6a 05 cc 0d 2c  |,`.. dice.,j...,|
000075c0  74 13 e3 20 66 72 6f 6d  20 3d 20 31 20 b8 20 32  |t.. from = 1 . 2|
000075d0  34 0d 2c 7e 15 63 6f 64  65 20 3d 20 62 6f 61 72  |4.,~.code = boar|
000075e0  64 3f 66 72 6f 6d 0d 2c  88 46 e7 20 28 63 6f 6c  |d?from.,.F. (col|
000075f0  24 3d 22 77 68 69 74 65  22 20 80 20 63 6f 64 65  |$="white" . code|
00007600  3e 30 20 80 20 63 6f 64  65 3c 31 32 38 29 20 84  |>0 . code<128) .|
00007610  20 28 63 6f 6c 24 3d 22  62 6c 61 63 6b 22 20 80  | (col$="black" .|
00007620  20 63 6f 64 65 3e 31 32  38 29 20 8c 0d 2c 92 18  | code>128) ..,..|
00007630  e3 20 64 69 63 65 20 3d  20 31 20 b8 20 64 69 63  |. dice = 1 . dic|
00007640  65 28 30 29 0d 2c 9c 13  72 6f 6c 6c 3d 64 69 63  |e(0).,..roll=dic|
00007650  65 28 64 69 63 65 29 0d  2c a6 12 e7 20 72 6f 6c  |e(dice).,... rol|
00007660  6c 20 3c 20 31 32 38 20  8c 0d 2c b0 45 e7 20 a4  |l < 128 ..,.E. .|
00007670  64 65 73 74 69 6e 61 74  69 6f 6e 4f 4b 28 66 72  |destinationOK(fr|
00007680  6f 6d 2c 72 6f 6c 6c 2c  63 6f 6c 24 2c 64 65 73  |om,roll,col$,des|
00007690  74 29 20 8c 20 f2 61 64  64 6c 65 67 61 6c 28 66  |t) . .addlegal(f|
000076a0  72 6f 6d 2c 64 65 73 74  2c 64 69 63 65 29 0d 2c  |rom,dest,dice).,|
000076b0  ba 05 cd 0d 2c c4 0a ed  20 64 69 63 65 0d 2c ce  |....,... dice.,.|
000076c0  05 cd 0d 2c d8 0a ed 20  66 72 6f 6d 0d 2c e2 05  |...,... from.,..|
000076d0  cd 0d 2c ec 1b f4 20 50  52 49 4e 54 20 54 41 42  |..,... PRINT TAB|
000076e0  28 30 2c 30 29 3b 6e 6c  65 67 61 6c 0d 2c f6 0b  |(0,0);nlegal.,..|
000076f0  3d 6e 6c 65 67 61 6c 0d  2d 00 04 0d 2d 0a 1c dd  |=nlegal.-...-...|
00007700  a4 73 65 74 5f 6f 70 65  6e 69 6e 67 5f 6d 6f 76  |.set_opening_mov|
00007710  65 28 63 6f 6c 24 29 0d  2d 14 3b f4 20 72 65 74  |e(col$).-.;. ret|
00007720  75 72 6e 73 20 54 52 55  45 20 69 66 20 64 65 73  |urns TRUE if des|
00007730  74 69 6e 61 74 69 6f 6e  20 70 6f 69 6e 74 20 63  |tination point c|
00007740  6c 65 61 72 20 6f 66 20  6f 70 70 6f 73 69 74 69  |lear of oppositi|
00007750  6f 6e 0d 2d 1e 34 f4 20  73 6f 20 74 68 61 74 20  |on.-.4. so that |
00007760  63 6f 6d 70 75 74 65 72  20 63 61 6e 20 75 73 75  |computer can usu|
00007770  61 6c 6c 79 20 6d 61 6b  65 20 73 65 74 20 6d 6f  |ally make set mo|
00007780  76 65 73 20 69 66 0d 2d  28 18 f4 20 74 68 65 20  |ves if.-(.. the |
00007790  73 65 63 6f 6e 64 20 74  6f 20 6d 6f 76 65 0d 2d  |second to move.-|
000077a0  32 18 ea 20 6f 6b 2c 6f  70 70 63 6f 6c 24 2c 66  |2.. ok,oppcol$,f|
000077b0  72 6f 6d 2c 74 6f 0d 2d  3c 08 6f 6b 3d b9 0d 2d  |rom,to.-<.ok=..-|
000077c0  46 36 e7 20 63 6f 6c 24  3d 22 77 68 69 74 65 22  |F6. col$="white"|
000077d0  20 8c 20 6f 70 70 63 6f  6c 24 3d 22 62 6c 61 63  | . oppcol$="blac|
000077e0  6b 22 20 8b 20 6f 70 70  63 6f 6c 24 3d 22 77 68  |k" . oppcol$="wh|
000077f0  69 74 65 22 0d 2d 50 25  62 65 61 72 69 6e 67 3d  |ite".-P%bearing=|
00007800  a3 3a 62 61 72 6d 6f 76  65 3d a3 3a 6d 6f 76 65  |.:barmove=.:move|
00007810  66 72 6f 6d 62 61 72 3d  a3 0d 2d 5a 22 64 69 63  |frombar=..-Z"dic|
00007820  65 20 3d 20 64 69 63 65  28 30 29 2b 31 2d 64 69  |e = dice(0)+1-di|
00007830  63 65 61 76 61 69 6c 61  62 6c 65 0d 2d 64 40 e7  |ceavailable.-d@.|
00007840  20 64 69 63 65 61 76 61  69 6c 61 62 6c 65 3d 32  | diceavailable=2|
00007850  20 8c 20 6f 6b 3d a4 70  72 6f 6a 65 63 74 5f 6f  | . ok=.project_o|
00007860  70 65 6e 69 6e 67 5f 6d  6f 76 65 28 63 6f 6c 24  |pening_move(col$|
00007870  2c 32 2c 66 72 6f 6d 2c  74 6f 29 0d 2d 6e 1a e7  |,2,from,to).-n..|
00007880  20 ac 20 6f 6b 20 8c 20  3d a4 6e 6f 74 6f 6b 28  | . ok . =.notok(|
00007890  63 6f 6c 24 29 0d 2d 78  2f 6f 6b 3d a4 70 72 6f  |col$).-x/ok=.pro|
000078a0  6a 65 63 74 5f 6f 70 65  6e 69 6e 67 5f 6d 6f 76  |ject_opening_mov|
000078b0  65 28 63 6f 6c 24 2c 64  69 63 65 2c 66 72 6f 6d  |e(col$,dice,from|
000078c0  2c 74 6f 29 0d 2d 82 1a  e7 20 ac 20 6f 6b 20 8c  |,to).-... . ok .|
000078d0  20 3d a4 6e 6f 74 6f 6b  28 63 6f 6c 24 29 0d 2d  | =.notok(col$).-|
000078e0  8c 1b f2 61 64 64 6c 65  67 61 6c 28 66 72 6f 6d  |...addlegal(from|
000078f0  2c 74 6f 2c 64 69 63 65  29 0d 2d 96 06 3d b9 0d  |,to,dice).-..=..|
00007900  2d a0 04 0d 2d aa 11 dd  a4 6e 6f 74 6f 6b 28 63  |-...-....notok(c|
00007910  6f 6c 24 29 0d 2d b4 0d  c8 8e 20 63 6f 6c 24 20  |ol$).-.... col$ |
00007920  ca 0d 2d be 1c c9 20 22  77 68 69 74 65 22 3a 77  |..-... "white":w|
00007930  68 69 74 65 6f 70 65 6e  69 6e 67 3d a3 0d 2d c8  |hiteopening=..-.|
00007940  1c c9 20 22 62 6c 61 63  6b 22 3a 62 6c 61 63 6b  |.. "black":black|
00007950  6f 70 65 6e 69 6e 67 3d  a3 0d 2d d2 05 cb 0d 2d  |opening=..-....-|
00007960  dc 0c 6e 6c 65 67 61 6c  3d 30 0d 2d e6 30 f4 20  |..nlegal=0.-.0. |
00007970  50 52 49 4e 54 20 54 41  42 28 30 2c 30 29 3b 63  |PRINT TAB(0,0);c|
00007980  6f 6c 24 3b 22 20 22 3b  64 69 63 65 61 76 61 69  |ol$;" ";diceavai|
00007990  6c 61 62 6c 65 2c 64 69  63 65 0d 2d f0 06 3d a3  |lable,dice.-..=.|
000079a0  0d 2d fa 04 0d 2e 04 31  dd a4 70 72 6f 6a 65 63  |.-.....1..projec|
000079b0  74 5f 6f 70 65 6e 69 6e  67 5f 6d 6f 76 65 28 63  |t_opening_move(c|
000079c0  6f 6c 24 2c 64 69 63 65  2c f8 20 66 72 6f 6d 2c  |ol$,dice,. from,|
000079d0  f8 20 74 6f 29 0d 2e 0e  12 ea 20 6f 6b 2c 6f 70  |. to)..... ok,op|
000079e0  70 63 6f 6c 24 2c 64 0d  2e 18 2e e7 20 64 6f 75  |pcol$,d..... dou|
000079f0  62 6c 65 20 80 20 ac 20  66 69 72 73 74 70 61 69  |ble . . firstpai|
00007a00  72 20 8c 20 64 3d 64 69  63 65 2b 32 20 8b 20 64  |r . d=dice+2 . d|
00007a10  3d 64 69 63 65 0d 2e 22  16 66 72 6f 6d 20 3d 20  |=dice..".from = |
00007a20  6f 70 65 6e 69 6e 67 73  28 64 29 0d 2e 2c 3c e7  |openings(d)..,<.|
00007a30  20 63 6f 6c 24 3d 22 77  68 69 74 65 22 20 8c 20  | col$="white" . |
00007a40  74 6f 3d 66 72 6f 6d 2b  64 69 63 65 28 64 69 63  |to=from+dice(dic|
00007a50  65 29 20 8b 20 74 6f 3d  66 72 6f 6d 2d 64 69 63  |e) . to=from-dic|
00007a60  65 28 64 69 63 65 29 0d  2e 36 36 e7 20 63 6f 6c  |e(dice)..66. col|
00007a70  24 3d 22 77 68 69 74 65  22 20 8c 20 6f 70 70 63  |$="white" . oppc|
00007a80  6f 6c 24 3d 22 62 6c 61  63 6b 22 20 8b 20 6f 70  |ol$="black" . op|
00007a90  70 63 6f 6c 24 3d 22 77  68 69 74 65 22 0d 2e 40  |pcol$="white"..@|
00007aa0  34 e7 20 a4 70 6f 69 6e  74 70 69 65 63 65 73 28  |4. .pointpieces(|
00007ab0  6f 70 70 63 6f 6c 24 2c  74 6f 2c 62 6f 61 72 64  |oppcol$,to,board|
00007ac0  29 3d 30 20 8c 20 6f 6b  3d b9 20 8b 20 6f 6b 3d  |)=0 . ok=. . ok=|
00007ad0  a3 0d 2e 4a 07 3d 6f 6b  0d 2e 54 04 0d 2e 5e 1d  |...J.=ok..T...^.|
00007ae0  dd f2 63 61 6e 74 6d 6f  76 65 28 63 6f 6c 24 2c  |..cantmove(col$,|
00007af0  6d 65 73 73 61 67 65 24  29 0d 2e 68 06 ef 37 0d  |message$)..h..7.|
00007b00  2e 72 1e f2 67 72 61 62  62 6f 78 28 63 61 6e 74  |.r..grabbox(cant|
00007b10  62 6f 78 28 29 2c 22 74  65 6d 70 22 29 0d 2e 7c  |box(),"temp")..||
00007b20  1b f2 63 61 6e 74 62 6f  78 28 63 6f 6c 24 2c 6d  |..cantbox(col$,m|
00007b30  65 73 73 61 67 65 24 29  0d 2e 86 21 f2 72 65 73  |essage$)...!.res|
00007b40  74 6f 72 65 62 6f 78 28  63 61 6e 74 62 6f 78 28  |torebox(cantbox(|
00007b50  29 2c 22 74 65 6d 70 22  29 0d 2e 90 1b 64 69 63  |),"temp")....dic|
00007b60  65 72 6f 6c 6c 65 64 3d  a3 3a f2 64 69 63 65 70  |erolled=.:.dicep|
00007b70  61 6e 65 6c 0d 2e 9a 05  e1 0d 2e a4 04 0d 2e ae  |anel............|
00007b80  04 0d 2e b8 1d dd f2 61  64 64 6c 65 67 61 6c 28  |.......addlegal(|
00007b90  66 72 6f 6d 2c 74 6f 2c  75 73 69 6e 67 29 0d 2e  |from,to,using)..|
00007ba0  c2 0d 6e 6c 65 67 61 6c  2b 3d 31 0d 2e cc 1f 6c  |..nlegal+=1....l|
00007bb0  65 67 61 6c 6d 6f 76 65  73 28 31 2c 6e 6c 65 67  |egalmoves(1,nleg|
00007bc0  61 6c 29 20 3d 20 66 72  6f 6d 0d 2e d6 58 e7 20  |al) = from...X. |
00007bd0  62 65 61 72 69 6e 67 20  8c 20 62 65 61 72 69 6e  |bearing . bearin|
00007be0  67 70 6f 73 73 69 62 6c  65 3d b9 3a 6c 65 67 61  |gpossible=.:lega|
00007bf0  6c 6d 6f 76 65 73 28 32  2c 6e 6c 65 67 61 6c 29  |lmoves(2,nlegal)|
00007c00  20 3d 20 31 31 31 20 8b  20 6c 65 67 61 6c 6d 6f  | = 111 . legalmo|
00007c10  76 65 73 28 32 2c 6e 6c  65 67 61 6c 29 20 3d 20  |ves(2,nlegal) = |
00007c20  74 6f 0d 2e e0 20 6c 65  67 61 6c 6d 6f 76 65 73  |to... legalmoves|
00007c30  28 33 2c 6e 6c 65 67 61  6c 29 20 3d 20 75 73 69  |(3,nlegal) = usi|
00007c40  6e 67 0d 2e ea 22 6c 65  67 61 6c 6d 6f 76 65 73  |ng..."legalmoves|
00007c50  28 34 2c 6e 6c 65 67 61  6c 29 20 3d 20 62 61 72  |(4,nlegal) = bar|
00007c60  6d 6f 76 65 0d 2e f4 22  6c 65 67 61 6c 6d 6f 76  |move..."legalmov|
00007c70  65 73 28 35 2c 6e 6c 65  67 61 6c 29 20 3d 20 62  |es(5,nlegal) = b|
00007c80  65 61 72 69 6e 67 0d 2e  fe 05 e1 0d 2f 08 04 0d  |earing....../...|
00007c90  2f 12 30 dd a4 64 65 73  74 69 6e 61 74 69 6f 6e  |/.0..destination|
00007ca0  4f 4b 28 73 74 61 72 74  70 6f 69 6e 74 2c 72 6f  |OK(startpoint,ro|
00007cb0  6c 6c 2c 63 6f 6c 24 2c  f8 20 64 65 73 74 29 0d  |ll,col$,. dest).|
00007cc0  2f 1c 23 ea 20 73 74 61  74 65 24 2c 64 69 66 66  |/.#. state$,diff|
00007cd0  2c 6c 65 67 61 6c 2c 64  2c 64 69 63 65 66 6f 75  |,legal,d,dicefou|
00007ce0  6e 64 0d 2f 26 0b 6c 65  67 61 6c 3d a3 0d 2f 30  |nd./&.legal=../0|
00007cf0  1e f4 20 63 68 65 63 6b  20 66 6f 72 20 6d 6f 76  |.. check for mov|
00007d00  69 6e 67 20 6f 66 66 20  62 61 72 0d 2f 3a 17 e7  |ing off bar./:..|
00007d10  20 73 74 61 72 74 70 6f  69 6e 74 20 3d 20 39 39  | startpoint = 99|
00007d20  20 8c 0d 2f 44 11 6d 6f  76 65 66 72 6f 6d 62 61  | ../D.movefromba|
00007d30  72 3d b9 0d 2f 4e 0d c8  8e 20 63 6f 6c 24 20 ca  |r=../N... col$ .|
00007d40  0d 2f 58 1b c9 20 22 77  68 69 74 65 22 3a 20 73  |./X.. "white": s|
00007d50  74 61 72 74 70 6f 69 6e  74 3d 30 0d 2f 62 1c c9  |tartpoint=0./b..|
00007d60  20 22 62 6c 61 63 6b 22  3a 20 73 74 61 72 74 70  | "black": startp|
00007d70  6f 69 6e 74 3d 32 35 0d  2f 6c 05 cb 0d 2f 76 05  |oint=25./l.../v.|
00007d80  cc 0d 2f 80 11 6d 6f 76  65 66 72 6f 6d 62 61 72  |../..movefrombar|
00007d90  3d a3 0d 2f 8a 05 cd 0d  2f 94 24 f4 20 63 68 65  |=../..../.$. che|
00007da0  63 6b 20 66 6f 72 20 64  65 73 74 69 6e 61 74 69  |ck for destinati|
00007db0  6f 6e 20 6f 6e 20 62 6f  61 72 64 0d 2f 9e 43 e7  |on on board./.C.|
00007dc0  20 63 6f 6c 24 20 3d 22  77 68 69 74 65 22 20 8c  | col$ ="white" .|
00007dd0  20 64 65 73 74 20 3d 20  73 74 61 72 74 70 6f 69  | dest = startpoi|
00007de0  6e 74 2b 72 6f 6c 6c 20  8b 20 64 65 73 74 3d 73  |nt+roll . dest=s|
00007df0  74 61 72 74 70 6f 69 6e  74 2d 72 6f 6c 6c 0d 2f  |tartpoint-roll./|
00007e00  a8 1b e7 20 64 65 73 74  20 3c 31 20 84 20 64 65  |... dest <1 . de|
00007e10  73 74 20 3e 20 32 34 20  8c 0d 2f b2 24 f4 20 50  |st > 24 ../.$. P|
00007e20  52 49 4e 54 20 54 41 42  28 30 2c 30 29 3b 73 74  |RINT TAB(0,0);st|
00007e30  61 72 74 70 6f 69 6e 74  2c 64 65 73 74 0d 2f bc  |artpoint,dest./.|
00007e40  31 62 65 61 72 69 6e 67  20 3d 20 a4 62 65 61 72  |1bearing = .bear|
00007e50  69 6e 67 63 68 65 63 6b  28 73 74 61 72 74 70 6f  |ingcheck(startpo|
00007e60  69 6e 74 2c 64 65 73 74  2c 63 6f 6c 24 29 0d 2f  |int,dest,col$)./|
00007e70  c6 19 e7 20 62 65 61 72  69 6e 67 20 8c 20 3d 20  |... bearing . = |
00007e80  b9 20 8b 20 3d 20 a3 0d  2f d0 05 cc 0d 2f da 0d  |. . = ../..../..|
00007e90  62 65 61 72 69 6e 67 3d  a3 0d 2f e4 05 cd 0d 2f  |bearing=../..../|
00007ea0  ee 24 f4 20 63 68 65 63  6b 20 66 6f 72 20 73 74  |.$. check for st|
00007eb0  61 74 65 20 6f 66 20 64  65 73 74 69 6e 61 74 69  |ate of destinati|
00007ec0  6f 6e 0d 2f f8 1e 73 74  61 74 65 24 20 3d 20 a4  |on./..state$ = .|
00007ed0  70 6f 69 6e 74 73 74 61  74 65 28 64 65 73 74 29  |pointstate(dest)|
00007ee0  0d 30 02 4f e7 20 28 73  74 61 74 65 24 3d 22 6f  |.0.O. (state$="o|
00007ef0  6e 65 77 68 69 74 65 22  20 80 20 63 6f 6c 24 3d  |newhite" . col$=|
00007f00  22 62 6c 61 63 6b 22 29  20 84 20 28 73 74 61 74  |"black") . (stat|
00007f10  65 24 3d 22 6f 6e 65 62  6c 61 63 6b 22 20 80 20  |e$="oneblack" . |
00007f20  63 6f 6c 24 3d 22 77 68  69 74 65 22 29 20 8c 0d  |col$="white") ..|
00007f30  30 0c 10 62 61 72 6d 6f  76 65 3d b9 3a 3d b9 0d  |0..barmove=.:=..|
00007f40  30 16 05 cc 0d 30 20 0d  62 61 72 6d 6f 76 65 3d  |0....0 .barmove=|
00007f50  a3 0d 30 2a 05 cd 0d 30  34 3b e7 20 73 74 61 74  |..0*...04;. stat|
00007f60  65 24 20 3d 22 65 6d 70  74 79 22 20 84 20 73 74  |e$ ="empty" . st|
00007f70  61 74 65 24 3d 63 6f 6c  24 20 84 20 c2 73 74 61  |ate$=col$ . .sta|
00007f80  74 65 24 2c 35 29 3d 63  6f 6c 24 20 8c 20 3d 20  |te$,5)=col$ . = |
00007f90  b9 0d 30 3e 06 3d a3 0d  30 48 04 0d 30 52 23 dd  |..0>.=..0H..0R#.|
00007fa0  a4 62 65 61 72 69 6e 67  63 68 65 63 6b 28 73 74  |.bearingcheck(st|
00007fb0  61 72 74 2c 64 65 73 74  2c 63 6f 6c 24 29 0d 30  |art,dest,col$).0|
00007fc0  5c 26 ea 20 70 6f 73 73  69 62 6c 65 2c 70 6f 69  |\&. possible,poi|
00007fd0  6e 74 2c 6d 61 78 70 6f  69 6e 74 2c 6d 69 6e 70  |nt,maxpoint,minp|
00007fe0  6f 69 6e 74 0d 30 66 3d  e7 20 28 63 6f 6c 24 3d  |oint.0f=. (col$=|
00007ff0  22 77 68 69 74 65 22 20  80 20 64 65 73 74 3c 30  |"white" . dest<0|
00008000  29 20 84 20 28 63 6f 6c  24 3d 22 62 6c 61 63 6b  |) . (col$="black|
00008010  22 20 80 20 64 65 73 74  3e 32 34 29 20 8c 20 3d  |" . dest>24) . =|
00008020  a3 0d 30 70 23 e7 20 ac  20 a4 62 65 61 72 69 6e  |..0p#. . .bearin|
00008030  67 70 6f 73 73 69 62 6c  65 28 63 6f 6c 24 29 20  |gpossible(col$) |
00008040  8c 20 3d a3 0d 30 7a 0e  70 6f 73 73 69 62 6c 65  |. =..0z.possible|
00008050  3d a3 0d 30 84 0d c8 8e  20 63 6f 6c 24 20 ca 0d  |=..0.... col$ ..|
00008060  30 8e 0e c9 20 22 62 6c  61 63 6b 22 3a 0d 30 98  |0... "black":.0.|
00008070  0e e7 20 64 65 73 74 3d  30 20 8c 0d 30 a2 1f 70  |.. dest=0 ..0..p|
00008080  6f 73 73 69 62 6c 65 20  3d b9 3a 20 f4 20 65 78  |ossible =.: . ex|
00008090  61 63 74 20 6e 75 6d 62  65 72 0d 30 ac 05 cc 0d  |act number.0....|
000080a0  30 b6 0e 6d 61 78 70 6f  69 6e 74 3d 30 0d 30 c0  |0..maxpoint=0.0.|
000080b0  11 e3 20 70 6f 69 6e 74  3d 31 20 b8 20 36 0d 30  |.. point=1 . 6.0|
000080c0  ca 37 e7 20 62 6f 61 72  64 3f 70 6f 69 6e 74 3e  |.7. board?point>|
000080d0  31 32 38 20 80 20 70 6f  69 6e 74 3e 6d 61 78 70  |128 . point>maxp|
000080e0  6f 69 6e 74 20 8c 20 6d  61 78 70 6f 69 6e 74 3d  |oint . maxpoint=|
000080f0  70 6f 69 6e 74 0d 30 d4  0b ed 20 70 6f 69 6e 74  |point.0... point|
00008100  0d 30 de 38 e7 20 6d 61  78 70 6f 69 6e 74 20 3c  |.0.8. maxpoint <|
00008110  a4 6d 69 6e 64 69 63 65  20 80 20 6d 61 78 70 6f  |.mindice . maxpo|
00008120  69 6e 74 20 3d 20 73 74  61 72 74 20 8c 20 70 6f  |int = start . po|
00008130  73 73 69 62 6c 65 3d b9  0d 30 e8 05 cd 0d 30 f2  |ssible=..0....0.|
00008140  0e c9 20 22 77 68 69 74  65 22 3a 0d 30 fc 0f e7  |.. "white":.0...|
00008150  20 64 65 73 74 3d 32 35  20 8c 0d 31 06 0e 70 6f  | dest=25 ..1..po|
00008160  73 73 69 62 6c 65 3d b9  0d 31 10 05 cc 0d 31 1a  |ssible=..1....1.|
00008170  0f 6d 69 6e 70 6f 69 6e  74 3d 32 35 0d 31 24 13  |.minpoint=25.1$.|
00008180  e3 20 70 6f 69 6e 74 3d  31 38 20 b8 20 32 34 0d  |. point=18 . 24.|
00008190  31 2e 47 e7 20 62 6f 61  72 64 3f 70 6f 69 6e 74  |1.G. board?point|
000081a0  3e 30 20 80 20 62 6f 61  72 64 3f 70 6f 69 6e 74  |>0 . board?point|
000081b0  3c 31 32 38 20 80 20 70  6f 69 6e 74 3c 6d 69 6e  |<128 . point<min|
000081c0  70 6f 69 6e 74 20 8c 20  6d 69 6e 70 6f 69 6e 74  |point . minpoint|
000081d0  3d 70 6f 69 6e 74 0d 31  38 0b ed 20 70 6f 69 6e  |=point.18.. poin|
000081e0  74 0d 31 42 3d e7 20 28  32 35 2d 6d 69 6e 70 6f  |t.1B=. (25-minpo|
000081f0  69 6e 74 29 20 3c a4 6d  69 6e 64 69 63 65 20 80  |int) <.mindice .|
00008200  20 6d 69 6e 70 6f 69 6e  74 20 3d 20 73 74 61 72  | minpoint = star|
00008210  74 20 8c 20 70 6f 73 73  69 62 6c 65 3d b9 0d 31  |t . possible=..1|
00008220  4c 05 cd 0d 31 56 05 cb  0d 31 60 0d 3d 70 6f 73  |L...1V...1`.=pos|
00008230  73 69 62 6c 65 0d 31 6a  04 0d 31 74 0d dd a4 6d  |sible.1j..1t...m|
00008240  69 6e 64 69 63 65 0d 31  7e 2f f4 20 72 65 74 75  |indice.1~/. retu|
00008250  72 6e 73 20 6e 75 6d 62  65 72 20 6f 66 20 73 6d  |rns number of sm|
00008260  61 6c 6c 65 73 74 20 64  69 63 65 20 61 76 61 69  |allest dice avai|
00008270  6c 61 62 6c 65 0d 31 88  13 ea 20 64 69 63 65 2c  |lable.1... dice,|
00008280  72 6f 6c 6c 2c 6d 69 6e  0d 31 92 09 6d 69 6e 3d  |roll,min.1..min=|
00008290  36 0d 31 9c 18 e3 20 64  69 63 65 20 3d 20 31 20  |6.1... dice = 1 |
000082a0  b8 20 64 69 63 65 28 30  29 0d 31 a6 13 72 6f 6c  |. dice(0).1..rol|
000082b0  6c 3d 64 69 63 65 28 64  69 63 65 29 0d 31 b0 11  |l=dice(dice).1..|
000082c0  e7 20 72 6f 6c 6c 20 3c  31 32 38 20 8c 0d 31 ba  |. roll <128 ..1.|
000082d0  19 e7 20 72 6f 6c 6c 3c  6d 69 6e 20 8c 20 6d 69  |.. roll<min . mi|
000082e0  6e 3d 72 6f 6c 6c 0d 31  c4 05 cd 0d 31 ce 0a ed  |n=roll.1....1...|
000082f0  20 64 69 63 65 0d 31 d8  08 3d 6d 69 6e 0d 31 e2  | dice.1..=min.1.|
00008300  04 0d 31 ec 1b dd a4 62  65 61 72 69 6e 67 70 6f  |..1....bearingpo|
00008310  73 73 69 62 6c 65 28 63  6f 6c 24 29 0d 31 f6 31  |ssible(col$).1.1|
00008320  f4 20 43 68 65 63 6b 73  20 77 68 65 74 68 65 72  |. Checks whether|
00008330  20 61 6c 6c 20 70 69 65  63 65 73 20 77 69 74 68  | all pieces with|
00008340  69 6e 20 68 6f 6d 65 20  62 6f 61 72 64 0d 32 00  |in home board.2.|
00008350  22 ea 20 70 6f 69 6e 74  2c 70 6f 73 73 69 62 6c  |". point,possibl|
00008360  65 3a 20 70 6f 73 73 69  62 6c 65 20 3d 20 b9 0d  |e: possible = ..|
00008370  32 0a 0d c8 8e 20 63 6f  6c 24 20 ca 0d 32 14 0e  |2.... col$ ..2..|
00008380  c9 20 22 77 68 69 74 65  22 3a 0d 32 1e 13 e7 20  |. "white":.2... |
00008390  62 61 72 77 68 69 74 65  20 3e 30 20 8c 0d 32 28  |barwhite >0 ..2(|
000083a0  0e 70 6f 73 73 69 62 6c  65 3d a3 0d 32 32 05 cc  |.possible=..22..|
000083b0  0d 32 3c 0b 70 6f 69 6e  74 3d 30 0d 32 46 05 f5  |.2<.point=0.2F..|
000083c0  0d 32 50 0c 70 6f 69 6e  74 2b 3d 31 0d 32 5a 32  |.2P.point+=1.2Z2|
000083d0  e7 20 62 6f 61 72 64 3f  70 6f 69 6e 74 3e 30 20  |. board?point>0 |
000083e0  80 20 62 6f 61 72 64 3f  70 6f 69 6e 74 3c 31 32  |. board?point<12|
000083f0  38 20 8c 20 70 6f 73 73  69 62 6c 65 3d a3 0d 32  |8 . possible=..2|
00008400  64 1b fd 20 70 6f 69 6e  74 3d 31 38 20 84 20 ac  |d.. point=18 . .|
00008410  20 70 6f 73 73 69 62 6c  65 0d 32 6e 05 cd 0d 32  | possible.2n...2|
00008420  78 0e c9 20 22 62 6c 61  63 6b 22 3a 0d 32 82 12  |x.. "black":.2..|
00008430  e7 20 62 61 72 62 6c 61  63 6b 3e 30 20 8c 0d 32  |. barblack>0 ..2|
00008440  8c 0e 70 6f 73 73 69 62  6c 65 3d a3 0d 32 96 05  |..possible=..2..|
00008450  cc 0d 32 a0 0b 70 6f 69  6e 74 3d 36 0d 32 aa 05  |..2..point=6.2..|
00008460  f5 0d 32 b4 0c 70 6f 69  6e 74 2b 3d 31 0d 32 be  |..2..point+=1.2.|
00008470  23 e7 20 62 6f 61 72 64  3f 70 6f 69 6e 74 3e 31  |#. board?point>1|
00008480  32 38 20 8c 20 70 6f 73  73 69 62 6c 65 20 3d a3  |28 . possible =.|
00008490  0d 32 c8 1b fd 20 70 6f  69 6e 74 3d 32 34 20 84  |.2... point=24 .|
000084a0  20 ac 20 70 6f 73 73 69  62 6c 65 0d 32 d2 05 cd  | . possible.2...|
000084b0  0d 32 dc 05 cb 0d 32 e6  0d 3d 70 6f 73 73 69 62  |.2....2..=possib|
000084c0  6c 65 0d 32 f0 04 0d 32  fa 29 dd a4 6c 65 67 61  |le.2...2.)..lega|
000084d0  6c 6d 6f 76 65 28 63 6f  6c 24 2c 73 74 61 72 74  |lmove(col$,start|
000084e0  70 6f 69 6e 74 2c 65 6e  64 70 6f 69 6e 74 29 0d  |point,endpoint).|
000084f0  33 04 23 ea 20 73 74 61  74 65 24 2c 64 69 66 66  |3.#. state$,diff|
00008500  2c 6c 65 67 61 6c 2c 64  2c 64 69 63 65 66 6f 75  |,legal,d,dicefou|
00008510  6e 64 0d 33 0e 17 6c 65  67 61 6c 3d 30 3a 64 69  |nd.3..legal=0:di|
00008520  63 65 66 6f 75 6e 64 3d  30 0d 33 18 05 f5 0d 33  |cefound=0.3....3|
00008530  22 0c 6c 65 67 61 6c 2b  3d 31 0d 33 2c 47 e7 20  |".legal+=1.3,G. |
00008540  6c 65 67 61 6c 6d 6f 76  65 73 28 31 2c 6c 65 67  |legalmoves(1,leg|
00008550  61 6c 29 3d 73 74 61 72  74 70 6f 69 6e 74 20 80  |al)=startpoint .|
00008560  20 6c 65 67 61 6c 6d 6f  76 65 73 28 32 2c 6c 65  | legalmoves(2,le|
00008570  67 61 6c 29 20 3d 20 65  6e 64 70 6f 69 6e 74 20  |gal) = endpoint |
00008580  8c 0d 33 36 5f 64 69 63  65 66 6f 75 6e 64 20 3d  |..36_dicefound =|
00008590  20 6c 65 67 61 6c 6d 6f  76 65 73 28 33 2c 6c 65  | legalmoves(3,le|
000085a0  67 61 6c 29 3a 20 62 61  72 6d 6f 76 65 20 3d 20  |gal): barmove = |
000085b0  6c 65 67 61 6c 6d 6f 76  65 73 28 34 2c 6c 65 67  |legalmoves(4,leg|
000085c0  61 6c 29 3a 20 62 65 61  72 69 6e 67 3d 6c 65 67  |al): bearing=leg|
000085d0  61 6c 6d 6f 76 65 73 28  35 2c 6c 65 67 61 6c 29  |almoves(5,legal)|
000085e0  0d 33 40 05 cd 0d 33 4a  20 fd 20 64 69 63 65 66  |.3@...3J . dicef|
000085f0  6f 75 6e 64 20 84 20 6c  65 67 61 6c 20 3d 20 6e  |ound . legal = n|
00008600  6c 65 67 61 6c 0d 33 54  11 e7 20 64 69 63 65 66  |legal.3T.. dicef|
00008610  6f 75 6e 64 20 8c 0d 33  5e 19 64 69 63 65 28 64  |ound ..3^.dice(d|
00008620  69 63 65 66 6f 75 6e 64  29 20 2b 3d 31 32 38 0d  |icefound) +=128.|
00008630  33 68 16 64 69 63 65 61  76 61 69 6c 61 62 6c 65  |3h.diceavailable|
00008640  20 2d 3d 20 31 0d 33 72  05 cd 0d 33 7c 0f 3d 20  | -= 1.3r...3|.= |
00008650  64 69 63 65 66 6f 75 6e  64 0d 33 86 04 0d 33 90  |dicefound.3...3.|
00008660  17 dd a4 70 6f 69 6e 74  73 74 61 74 65 28 70 6f  |...pointstate(po|
00008670  69 6e 74 29 0d 33 9a 25  e7 20 62 6f 61 72 64 3f  |int).3.%. board?|
00008680  70 6f 69 6e 74 20 83 20  31 32 38 20 3d 30 20 8c  |point . 128 =0 .|
00008690  20 3d 22 65 6d 70 74 79  22 0d 33 a4 22 e7 20 62  | ="empty".3.". b|
000086a0  6f 61 72 64 3f 70 6f 69  6e 74 20 3d 31 20 8c 20  |oard?point =1 . |
000086b0  3d 22 6f 6e 65 77 68 69  74 65 22 0d 33 ae 24 e7  |="onewhite".3.$.|
000086c0  20 62 6f 61 72 64 3f 70  6f 69 6e 74 20 3d 31 32  | board?point =12|
000086d0  39 20 8c 20 3d 22 6f 6e  65 62 6c 61 63 6b 22 0d  |9 . ="oneblack".|
000086e0  33 b8 20 e7 20 62 6f 61  72 64 3f 70 6f 69 6e 74  |3. . board?point|
000086f0  3e 31 32 38 20 8c 20 3d  22 62 6c 61 63 6b 22 0d  |>128 . ="black".|
00008700  33 c2 0c 3d 22 77 68 69  74 65 22 0d 33 cc 04 0d  |3..="white".3...|
00008710  33 d6 21 dd f2 65 78 65  63 75 74 65 6d 6f 76 65  |3.!..executemove|
00008720  28 63 6f 6c 24 2c 73 74  61 72 74 2c 65 6e 64 29  |(col$,start,end)|
00008730  0d 33 e0 14 ea 20 73 63  72 65 65 6e 2c 6f 70 70  |.3... screen,opp|
00008740  63 6f 6c 24 0d 33 ea 36  e7 20 63 6f 6c 24 3d 22  |col$.3.6. col$="|
00008750  77 68 69 74 65 22 20 8c  20 6f 70 70 63 6f 6c 24  |white" . oppcol$|
00008760  3d 22 62 6c 61 63 6b 22  20 8b 20 6f 70 70 63 6f  |="black" . oppco|
00008770  6c 24 3d 22 77 68 69 74  65 22 0d 33 f4 2b e7 20  |l$="white".3.+. |
00008780  62 65 61 72 69 6e 67 20  8c 20 f2 62 65 61 72 6f  |bearing . .bearo|
00008790  66 66 70 69 65 63 65 28  63 6f 6c 24 2c 73 74 61  |ffpiece(col$,sta|
000087a0  72 74 29 3a e1 0d 33 fe  2a e7 20 6d 6f 76 65 66  |rt):..3.*. movef|
000087b0  72 6f 6d 62 61 72 20 80  20 ac 20 a4 63 6f 6d 70  |rombar . . .comp|
000087c0  75 74 65 72 63 6f 6c 28  63 6f 6c 24 29 20 8c 0d  |utercol(col$) ..|
000087d0  34 08 0d c8 8e 20 63 6f  6c 24 20 ca 0d 34 12 1b  |4.... col$ ..4..|
000087e0  c9 20 22 77 68 69 74 65  22 3a 20 62 61 72 77 68  |. "white": barwh|
000087f0  69 74 65 20 2d 3d 31 0d  34 1c 1b c9 20 22 62 6c  |ite -=1.4... "bl|
00008800  61 63 6b 22 3a 20 62 61  72 62 6c 61 63 6b 20 2d  |ack": barblack -|
00008810  3d 31 0d 34 26 05 cb 0d  34 30 13 f2 73 68 61 64  |=1.4&...40..shad|
00008820  6f 77 5f 64 72 61 77 62  61 72 0d 34 3a 05 cc 0d  |ow_drawbar.4:...|
00008830  34 44 1c e7 20 ac 20 a4  63 6f 6d 70 75 74 65 72  |4D.. . .computer|
00008840  63 6f 6c 28 63 6f 6c 24  29 20 8c 0d 34 4e 1d 62  |col(col$) ..4N.b|
00008850  6f 61 72 64 3f 73 74 61  72 74 3d 62 6f 61 72 64  |oard?start=board|
00008860  3f 73 74 61 72 74 2d 31  0d 34 58 25 e7 20 62 6f  |?start-1.4X%. bo|
00008870  61 72 64 3f 73 74 61 72  74 3d 31 32 38 20 8c 20  |ard?start=128 . |
00008880  62 6f 61 72 64 3f 73 74  61 72 74 3d 30 0d 34 62  |board?start=0.4b|
00008890  05 cd 0d 34 6c 05 cd 0d  34 76 11 e7 20 ac 20 62  |...4l...4v.. . b|
000088a0  61 72 6d 6f 76 65 20 8c  0d 34 80 30 e7 20 63 6f  |armove ..4.0. co|
000088b0  6c 24 3d 22 62 6c 61 63  6b 22 20 80 20 62 6f 61  |l$="black" . boa|
000088c0  72 64 3f 65 6e 64 3d 30  20 8c 20 62 6f 61 72 64  |rd?end=0 . board|
000088d0  3f 65 6e 64 3d 31 32 38  0d 34 8a 19 62 6f 61 72  |?end=128.4..boar|
000088e0  64 3f 65 6e 64 3d 62 6f  61 72 64 3f 65 6e 64 2b  |d?end=board?end+|
000088f0  31 0d 34 94 05 cc 0d 34  9e 0f 62 6f 61 72 64 3f  |1.4....4..board?|
00008900  65 6e 64 3d 31 0d 34 a8  25 e7 20 63 6f 6c 24 3d  |end=1.4.%. col$=|
00008910  22 62 6c 61 63 6b 22 20  8c 20 62 6f 61 72 64 3f  |"black" . board?|
00008920  65 6e 64 20 2b 3d 20 31  32 38 0d 34 b2 05 cd 0d  |end += 128.4....|
00008930  34 bc 14 e3 20 73 63 72  65 65 6e 20 3d 20 31 20  |4... screen = 1 |
00008940  b8 20 32 0d 34 c6 17 f2  73 77 69 74 63 68 5f 75  |. 2.4...switch_u|
00008950  70 64 61 74 65 5f 62 61  6e 6b 0d 34 d0 15 f2 64  |pdate_bank.4...d|
00008960  72 61 77 70 6f 69 6e 74  28 73 74 61 72 74 29 0d  |rawpoint(start).|
00008970  34 da 13 f2 64 72 61 77  70 6f 69 6e 74 28 65 6e  |4...drawpoint(en|
00008980  64 29 0d 34 e4 18 f2 73  77 69 74 63 68 5f 64 69  |d).4...switch_di|
00008990  73 70 6c 61 79 5f 62 61  6e 6b 0d 34 ee 0c ed 20  |splay_bank.4... |
000089a0  73 63 72 65 65 6e 0d 34  f8 0f e7 20 62 61 72 6d  |screen.4... barm|
000089b0  6f 76 65 20 8c 0d 35 02  10 d4 20 31 2c 2d 31 30  |ove ..5... 1,-10|
000089c0  2c 37 30 2c 35 0d 35 0c  23 f2 63 6f 6d 70 75 74  |,70,5.5.#.comput|
000089d0  65 72 64 72 61 67 28 6f  70 70 63 6f 6c 24 2c 65  |erdrag(oppcol$,e|
000089e0  6e 64 2c 39 39 2c b9 29  0d 35 16 0d c8 8e 20 63  |nd,99,.).5.... c|
000089f0  6f 6c 24 20 ca 0d 35 20  27 c9 20 22 77 68 69 74  |ol$ ..5 '. "whit|
00008a00  65 22 3a 20 62 61 72 62  6c 61 63 6b 2b 3d 31 3a  |e": barblack+=1:|
00008a10  20 62 6f 61 72 64 3f 65  6e 64 3d 31 0d 35 2a 29  | board?end=1.5*)|
00008a20  c9 20 22 62 6c 61 63 6b  22 3a 20 62 61 72 77 68  |. "black": barwh|
00008a30  69 74 65 2b 3d 31 3a 20  62 6f 61 72 64 3f 65 6e  |ite+=1: board?en|
00008a40  64 3d 31 32 39 0d 35 34  05 cb 0d 35 3e 13 f2 73  |d=129.54...5>..s|
00008a50  68 61 64 6f 77 5f 64 72  61 77 62 61 72 0d 35 48  |hadow_drawbar.5H|
00008a60  05 cd 0d 35 52 32 f4 20  49 46 20 6d 6f 76 65 66  |...5R2. IF movef|
00008a70  72 6f 6d 62 61 72 20 54  48 45 4e 20 50 52 4f 43  |rombar THEN PROC|
00008a80  73 68 61 64 6f 77 5f 62  6f 78 28 62 61 72 62 6f  |shadow_box(barbo|
00008a90  78 28 29 29 0d 35 5c 05  e1 0d 35 66 04 0d 35 70  |x()).5\...5f..5p|
00008aa0  1c dd f2 63 61 6e 74 62  6f 78 28 63 6f 6c 24 2c  |...cantbox(col$,|
00008ab0  6d 65 73 73 61 67 65 24  29 0d 35 7a 13 e7 20 6d  |message$).5z.. m|
00008ac0  65 73 73 61 67 65 24 3d  22 22 20 8c 0d 35 84 39  |essage$="" ..5.9|
00008ad0  e7 20 63 6f 6c 24 3d 22  77 68 69 74 65 22 20 8c  |. col$="white" .|
00008ae0  20 6d 65 73 73 61 67 65  24 20 3d 22 57 48 49 54  | message$ ="WHIT|
00008af0  45 22 20 8b 20 6d 65 73  73 61 67 65 24 3d 22 42  |E" . message$="B|
00008b00  4c 41 43 4b 22 0d 35 8e  1c 6d 65 73 73 61 67 65  |LACK".5..message|
00008b10  24 2b 3d 22 20 43 41 4e  4e 4f 54 20 4d 4f 56 45  |$+=" CANNOT MOVE|
00008b20  22 0d 35 98 05 cd 0d 35  a2 18 c8 99 20 22 48 6f  |".5....5.... "Ho|
00008b30  75 72 67 6c 61 73 73 5f  53 6d 61 73 68 22 0d 35  |urglass_Smash".5|
00008b40  ac 23 f2 64 69 73 70 6c  61 79 62 6f 78 28 63 61  |.#.displaybox(ca|
00008b50  6e 74 62 6f 78 28 29 2c  6d 65 73 73 61 67 65 24  |ntbox(),message$|
00008b60  29 0d 35 b6 05 e1 0d 35  c0 04 0d 35 ca 24 dd f2  |).5....5...5.$..|
00008b70  64 69 73 70 6c 61 79 62  6f 78 28 63 61 6e 74 62  |displaybox(cantb|
00008b80  6f 78 28 29 2c 6d 65 73  73 61 67 65 24 29 0d 35  |ox(),message$).5|
00008b90  d4 16 ea 20 78 2c 79 2c  62 75 74 74 6f 6e 2c 78  |... x,y,button,x|
00008ba0  6d 2c 79 6d 0d 35 de 23  f2 73 68 6f 77 62 6f 78  |m,ym.5.#.showbox|
00008bb0  28 63 61 6e 74 62 6f 78  28 29 2c 62 6c 61 63 6b  |(cantbox(),black|
00008bc0  2c 69 76 6f 72 79 29 0d  35 e8 12 62 75 74 74 6f  |,ivory).5..butto|
00008bd0  6e 3d 30 3a 2a 46 58 31  35 0d 35 f2 17 78 6d 20  |n=0:*FX15.5..xm |
00008be0  3d 20 63 61 6e 74 62 6f  78 28 31 29 2b 31 32 38  |= cantbox(1)+128|
00008bf0  0d 35 fc 17 79 6d 20 3d  20 63 61 6e 74 62 6f 78  |.5..ym = cantbox|
00008c00  28 32 29 2b 32 34 30 0d  36 06 0a e6 20 62 6c 75  |(2)+240.6... blu|
00008c10  65 0d 36 10 07 ef 20 35  0d 36 1a 17 ec 20 78 6d  |e.6... 5.6... xm|
00008c20  2c 79 6d 3a 20 f1 20 6d  65 73 73 61 67 65 24 0d  |,ym: . message$.|
00008c30  36 24 09 e6 20 72 65 64  0d 36 2e 38 ec 20 63 61  |6$.. red.6.8. ca|
00008c40  6e 74 62 6f 78 28 31 29  2b 31 32 38 2c 63 61 6e  |ntbox(1)+128,can|
00008c50  74 62 6f 78 28 32 29 2b  31 30 30 3a f1 20 22 50  |tbox(2)+100:. "P|
00008c60  72 65 73 73 20 61 6e 79  20 62 75 74 74 6f 6e 22  |ress any button"|
00008c70  0d 36 38 05 f5 0d 36 42  11 c8 97 20 78 2c 79 2c  |.68...6B... x,y,|
00008c80  62 75 74 74 6f 6e 0d 36  4c 0c fd 20 62 75 74 74  |button.6L.. butt|
00008c90  6f 6e 0d 36 56 07 ef 20  34 0d 36 60 17 c8 97 20  |on.6V.. 4.6`... |
00008ca0  c8 93 20 30 2c 30 2c 31  32 33 39 2c 31 30 32 33  |.. 0,0,1239,1023|
00008cb0  0d 36 6a 05 e1 0d 36 74  04 0d 36 7e 25 dd f2 73  |.6j...6t..6~%..s|
00008cc0  68 6f 77 62 6f 78 28 62  6f 78 28 29 2c 62 6f 72  |howbox(box(),bor|
00008cd0  64 65 72 63 6f 6c 2c 62  6f 78 63 6f 6c 29 0d 36  |dercol,boxcol).6|
00008ce0  88 16 ea 20 62 6f 72 64  65 72 3a 62 6f 72 64 65  |... border:borde|
00008cf0  72 3d 33 32 0d 36 92 0f  e6 20 62 6f 72 64 65 72  |r=32.6... border|
00008d00  63 6f 6c 0d 36 9c 33 c8  93 20 c8 90 20 62 6f 78  |col.6.3.. .. box|
00008d10  28 31 29 2c 62 6f 78 28  32 29 2c 62 6f 78 28 33  |(1),box(2),box(3|
00008d20  29 2d 62 6f 78 28 31 29  2c 62 6f 78 28 34 29 2d  |)-box(1),box(4)-|
00008d30  62 6f 78 28 32 29 0d 36  a6 0c e6 20 62 6f 78 63  |box(2).6... boxc|
00008d40  6f 6c 0d 36 b0 53 c8 93  20 c8 90 20 62 6f 78 28  |ol.6.S.. .. box(|
00008d50  31 29 2b 62 6f 72 64 65  72 2c 62 6f 78 28 32 29  |1)+border,box(2)|
00008d60  2b 62 6f 72 64 65 72 2c  62 6f 78 28 33 29 2d 62  |+border,box(3)-b|
00008d70  6f 78 28 31 29 2d 32 2a  62 6f 72 64 65 72 2c 62  |ox(1)-2*border,b|
00008d80  6f 78 28 34 29 2d 62 6f  78 28 32 29 2d 32 2a 62  |ox(4)-box(2)-2*b|
00008d90  6f 72 64 65 72 0d 36 ba  33 c8 97 20 c8 93 20 62  |order.6.3.. .. b|
00008da0  6f 78 28 31 29 2c 62 6f  78 28 32 29 2c 62 6f 78  |ox(1),box(2),box|
00008db0  28 33 29 2d 62 6f 78 28  31 29 2c 62 6f 78 28 34  |(3)-box(1),box(4|
00008dc0  29 2d 62 6f 78 28 32 29  0d 36 c4 05 e1 0d 36 ce  |)-box(2).6....6.|
00008dd0  04 0d 36 d8 1d dd f2 77  69 6e 64 69 73 70 6c 61  |..6....windispla|
00008de0  79 28 6d 31 24 2c 6d 32  24 2c 6d 33 24 29 0d 36  |y(m1$,m2$,m3$).6|
00008df0  e2 28 ea 20 62 6f 72 64  65 72 2c 78 2c 79 2c 79  |.(. border,x,y,y|
00008e00  73 74 65 70 2c 63 65 6e  74 72 65 73 69 7a 65 2c  |step,centresize,|
00008e10  62 75 74 74 6f 6e 0d 36  ec 31 62 6f 72 64 65 72  |button.6.1border|
00008e20  3d 33 32 3a 63 65 6e 74  72 65 73 69 7a 65 3d 28  |=32:centresize=(|
00008e30  6f 70 74 62 6f 78 28 33  29 2d 6f 70 74 62 6f 78  |optbox(3)-optbox|
00008e40  28 31 29 29 81 31 36 0d  36 f6 1d f2 67 72 61 62  |(1)).16.6...grab|
00008e50  62 6f 78 28 6f 70 74 62  6f 78 28 29 2c 22 74 65  |box(optbox(),"te|
00008e60  6d 70 22 29 0d 37 00 22  f2 73 68 6f 77 62 6f 78  |mp").7.".showbox|
00008e70  28 6f 70 74 62 6f 78 28  29 2c 62 6c 61 63 6b 2c  |(optbox(),black,|
00008e80  77 68 69 74 65 29 0d 37  0a 06 ef 35 0d 37 14 12  |white).7...5.7..|
00008e90  79 73 74 65 70 3d 33 2a  62 6f 72 64 65 72 0d 37  |ystep=3*border.7|
00008ea0  1e 24 78 3d 6f 70 74 62  6f 78 28 31 29 3a 20 79  |.$x=optbox(1): y|
00008eb0  20 3d 20 6f 70 74 62 6f  78 28 34 29 2d 79 73 74  | = optbox(4)-yst|
00008ec0  65 70 0d 37 28 0b e6 20  62 6c 61 63 6b 0d 37 32  |ep.7(.. black.72|
00008ed0  24 ec 20 78 2c 79 3a f1  20 a4 63 65 6e 74 72 65  |$. x,y:. .centre|
00008ee0  6c 28 6d 31 24 2c 63 65  6e 74 72 65 73 69 7a 65  |l(m1$,centresize|
00008ef0  29 0d 37 3c 13 79 2d 3d  79 73 74 65 70 3a 20 e6  |).7<.y-=ystep: .|
00008f00  20 72 65 64 0d 37 46 24  ec 20 78 2c 79 3a f1 20  | red.7F$. x,y:. |
00008f10  a4 63 65 6e 74 72 65 6c  28 6d 32 24 2c 63 65 6e  |.centrel(m2$,cen|
00008f20  74 72 65 73 69 7a 65 29  0d 37 50 13 79 2d 3d 79  |tresize).7P.y-=y|
00008f30  73 74 65 70 3a e6 20 62  6c 75 65 0d 37 5a 24 ec  |step:. blue.7Z$.|
00008f40  20 78 2c 79 3a f1 20 a4  63 65 6e 74 72 65 6c 28  | x,y:. .centrel(|
00008f50  6d 33 24 2c 63 65 6e 74  72 65 73 69 7a 65 29 0d  |m3$,centresize).|
00008f60  37 64 15 79 2d 3d 79 73  74 65 70 3a 20 e6 20 62  |7d.y-=ystep: . b|
00008f70  6c 61 63 6b 0d 37 6e 33  ec 20 78 2c 79 3a f1 20  |lack.7n3. x,y:. |
00008f80  a4 63 65 6e 74 72 65 6c  28 22 50 72 65 73 73 20  |.centrel("Press |
00008f90  61 6e 79 20 62 75 74 74  6f 6e 22 2c 63 65 6e 74  |any button",cent|
00008fa0  72 65 73 69 7a 65 29 0d  37 78 06 ef 34 0d 37 82  |resize).7x..4.7.|
00008fb0  09 2a 46 58 31 35 0d 37  8c 1b f5 3a c8 97 78 2c  |.*FX15.7...:..x,|
00008fc0  79 2c 62 75 74 74 6f 6e  3a fd 20 62 75 74 74 6f  |y,button:. butto|
00008fd0  6e 0d 37 96 20 f2 72 65  73 74 6f 72 65 62 6f 78  |n.7. .restorebox|
00008fe0  28 6f 70 74 62 6f 78 28  29 2c 22 74 65 6d 70 22  |(optbox(),"temp"|
00008ff0  29 0d 37 a0 17 c8 97 20  c8 93 20 30 2c 30 2c 31  |).7.... .. 0,0,1|
00009000  32 33 39 2c 31 30 32 33  0d 37 aa 05 e1 0d 37 b4  |239,1023.7....7.|
00009010  04 0d 37 be 1a dd a4 63  65 6e 74 72 65 6c 28 74  |..7....centrel(t|
00009020  65 78 74 24 2c 73 70 61  63 65 29 0d 37 c8 35 f4  |ext$,space).7.5.|
00009030  20 61 64 64 73 20 62 6c  61 6e 6b 73 20 74 6f 20  | adds blanks to |
00009040  6c 65 66 74 20 6f 66 20  74 65 78 74 24 20 74 6f  |left of text$ to|
00009050  20 63 65 6e 74 72 65 20  69 6e 20 73 70 61 63 65  | centre in space|
00009060  0d 37 d2 09 ea 20 6c 2c  61 0d 37 dc 1e 6c 3d a9  |.7... l,a.7..l=.|
00009070  28 74 65 78 74 24 29 3a  61 3d 28 73 70 61 63 65  |(text$):a=(space|
00009080  2d 6c 29 20 81 20 32 0d  37 e6 12 3d c4 61 2c 22  |-l) . 2.7..=.a,"|
00009090  20 22 29 2b 74 65 78 74  24 0d 37 f0 04 0d 37 fa  | ")+text$.7...7.|
000090a0  17 dd a4 73 75 72 65 62  6f 78 28 6d 65 73 73 61  |...surebox(messa|
000090b0  67 65 24 29 0d 38 04 36  ea 20 79 65 73 70 61 6e  |ge$).8.6. yespan|
000090c0  65 6c 28 29 2c 6e 6f 70  61 6e 65 6c 28 29 2c 62  |el(),nopanel(),b|
000090d0  6f 72 64 65 72 2c 62 75  74 74 6f 6e 2c 73 75 72  |order,button,sur|
000090e0  65 2c 64 65 63 69 73 69  6f 6e 0d 38 0e 0d 62 6f  |e,decision.8..bo|
000090f0  72 64 65 72 3d 33 32 0d  38 18 1c de 20 79 65 73  |rder=32.8... yes|
00009100  70 61 6e 65 6c 28 34 29  2c 6e 6f 70 61 6e 65 6c  |panel(4),nopanel|
00009110  28 34 29 0d 38 22 6f 79  65 73 70 61 6e 65 6c 28  |(4).8"oyespanel(|
00009120  31 29 3d 73 75 72 65 62  6f 78 28 31 29 2b 37 30  |1)=surebox(1)+70|
00009130  3a 79 65 73 70 61 6e 65  6c 28 32 29 3d 73 75 72  |:yespanel(2)=sur|
00009140  65 62 6f 78 28 32 29 2b  31 30 30 3a 79 65 73 70  |ebox(2)+100:yesp|
00009150  61 6e 65 6c 28 33 29 3d  79 65 73 70 61 6e 65 6c  |anel(3)=yespanel|
00009160  28 31 29 2b 31 30 30 3a  79 65 73 70 61 6e 65 6c  |(1)+100:yespanel|
00009170  28 34 29 3d 79 65 73 70  61 6e 65 6c 28 32 29 2b  |(4)=yespanel(2)+|
00009180  38 30 0d 38 2c 38 6e 6f  70 61 6e 65 6c 28 29 3d  |80.8,8nopanel()=|
00009190  79 65 73 70 61 6e 65 6c  28 29 3a 6e 6f 70 61 6e  |yespanel():nopan|
000091a0  65 6c 28 31 29 2b 3d 31  33 30 3a 6e 6f 70 61 6e  |el(1)+=130:nopan|
000091b0  65 6c 28 33 29 2b 3d 31  33 30 0d 38 36 1f f2 67  |el(3)+=130.86..g|
000091c0  72 61 62 62 6f 78 28 73  75 72 65 62 6f 78 28 29  |rabbox(surebox()|
000091d0  2c 22 74 65 6d 70 32 22  29 0d 38 40 25 f2 73 68  |,"temp2").8@%.sh|
000091e0  6f 77 62 6f 78 28 73 75  72 65 62 6f 78 28 29 2c  |owbox(surebox(),|
000091f0  6d 69 64 67 72 65 79 2c  77 68 69 74 65 29 0d 38  |midgrey,white).8|
00009200  4a 2c f2 64 72 61 77 74  65 78 74 62 6f 78 28 79  |J,.drawtextbox(y|
00009210  65 73 70 61 6e 65 6c 28  29 2c 22 59 45 53 22 2c  |espanel(),"YES",|
00009220  69 76 6f 72 79 2c 72 65  64 29 0d 38 54 2a f2 64  |ivory,red).8T*.d|
00009230  72 61 77 74 65 78 74 62  6f 78 28 6e 6f 70 61 6e  |rawtextbox(nopan|
00009240  65 6c 28 29 2c 22 4e 4f  22 2c 69 76 6f 72 79 2c  |el(),"NO",ivory,|
00009250  72 65 64 29 0d 38 5e 0d  e6 20 62 6c 75 65 3a ef  |red).8^.. blue:.|
00009260  37 0d 38 68 06 ef 35 0d  38 72 2c e7 20 6d 65 73  |7.8h..5.8r,. mes|
00009270  73 61 67 65 24 3d 22 22  20 8c 20 6d 65 73 73 61  |sage$="" . messa|
00009280  67 65 24 3d 22 41 52 45  20 59 4f 55 20 53 55 52  |ge$="ARE YOU SUR|
00009290  45 3f 22 0d 38 7c 2c ec  20 73 75 72 65 62 6f 78  |E?".8|,. surebox|
000092a0  28 31 29 2b 38 30 2c 73  75 72 65 62 6f 78 28 34  |(1)+80,surebox(4|
000092b0  29 2d 38 30 3a f1 20 6d  65 73 73 61 67 65 24 0d  |)-80:. message$.|
000092c0  38 86 17 62 75 74 74 6f  6e 3d 30 3a 64 65 63 69  |8..button=0:deci|
000092d0  73 69 6f 6e 3d a3 0d 38  90 05 f5 0d 38 9a 38 e7  |sion=..8....8.8.|
000092e0  20 a4 6d 6f 75 73 65 69  6e 62 6f 78 28 79 65 73  | .mouseinbox(yes|
000092f0  70 61 6e 65 6c 28 29 2c  62 75 74 74 6f 6e 29 20  |panel(),button) |
00009300  8c 20 73 75 72 65 3d b9  3a 64 65 63 69 73 69 6f  |. sure=.:decisio|
00009310  6e 3d b9 0d 38 a4 37 e7  20 a4 6d 6f 75 73 65 69  |n=..8.7. .mousei|
00009320  6e 62 6f 78 28 6e 6f 70  61 6e 65 6c 28 29 2c 62  |nbox(nopanel(),b|
00009330  75 74 74 6f 6e 29 20 8c  20 73 75 72 65 3d a3 3a  |utton) . sure=.:|
00009340  64 65 63 69 73 69 6f 6e  3d b9 0d 38 ae 0e fd 20  |decision=..8... |
00009350  64 65 63 69 73 69 6f 6e  0d 38 b8 22 f2 72 65 73  |decision.8.".res|
00009360  74 6f 72 65 62 6f 78 28  73 75 72 65 62 6f 78 28  |torebox(surebox(|
00009370  29 2c 22 74 65 6d 70 32  22 29 0d 38 c2 1a ef 34  |),"temp2").8...4|
00009380  3a c8 97 20 c8 93 20 30  2c 30 2c 31 32 33 39 2c  |:.. .. 0,0,1239,|
00009390  31 30 32 33 0d 38 cc 09  3d 73 75 72 65 0d 38 d6  |1023.8..=sure.8.|
000093a0  04 0d 38 e0 04 0d 38 ea  1e dd f2 62 65 61 72 6f  |..8...8....bearo|
000093b0  66 66 70 69 65 63 65 28  63 6f 6c 24 2c 73 74 61  |ffpiece(col$,sta|
000093c0  72 74 29 0d 38 f4 1b ea  20 77 69 6e 6e 65 72 24  |rt).8... winner$|
000093d0  2c 73 3a 20 77 69 6e 6e  65 72 24 3d 22 22 0d 38  |,s: winner$="".8|
000093e0  fe 0d c8 8e 20 63 6f 6c  24 20 ca 0d 39 08 0e c9  |.... col$ ..9...|
000093f0  20 22 77 68 69 74 65 22  3a 0d 39 12 0b fb 20 77  | "white":.9... w|
00009400  68 69 74 65 0d 39 1c 12  77 68 69 74 65 62 65 61  |hite.9..whitebea|
00009410  72 69 6e 67 3d b9 0d 39  26 16 77 68 69 74 65 67  |ring=..9&.whiteg|
00009420  61 6d 65 73 63 6f 72 65  20 2b 3d 31 0d 39 30 13  |amescore +=1.90.|
00009430  77 68 69 74 65 70 69 65  63 65 73 20 2d 3d 31 0d  |whitepieces -=1.|
00009440  39 3a 25 e7 20 77 68 69  74 65 70 69 65 63 65 73  |9:%. whitepieces|
00009450  20 3d 20 30 20 8c 20 77  69 6e 6e 65 72 24 20 3d  | = 0 . winner$ =|
00009460  63 6f 6c 24 0d 39 44 0f  e3 20 73 20 3d 20 31 20  |col$.9D.. s = 1 |
00009470  b8 20 32 0d 39 4e 1b f1  20 8a 37 30 2c 36 29 3b  |. 2.9N.. .70,6);|
00009480  77 68 69 74 65 67 61 6d  65 73 63 6f 72 65 0d 39  |whitegamescore.9|
00009490  58 17 f2 73 77 69 74 63  68 5f 75 70 64 61 74 65  |X..switch_update|
000094a0  5f 62 61 6e 6b 0d 39 62  07 ed 20 73 0d 39 6c 0e  |_bank.9b.. s.9l.|
000094b0  c9 20 22 62 6c 61 63 6b  22 3a 0d 39 76 0b fb 20  |. "black":.9v.. |
000094c0  62 6c 61 63 6b 0d 39 80  12 62 6c 61 63 6b 62 65  |black.9..blackbe|
000094d0  61 72 69 6e 67 3d b9 0d  39 8a 16 62 6c 61 63 6b  |aring=..9..black|
000094e0  67 61 6d 65 73 63 6f 72  65 20 2b 3d 31 0d 39 94  |gamescore +=1.9.|
000094f0  13 62 6c 61 63 6b 70 69  65 63 65 73 20 2d 3d 31  |.blackpieces -=1|
00009500  0d 39 9e 26 e7 20 62 6c  61 63 6b 70 69 65 63 65  |.9.&. blackpiece|
00009510  73 20 3d 20 30 20 8c 20  77 69 6e 6e 65 72 24 20  |s = 0 . winner$ |
00009520  3d 20 63 6f 6c 24 0d 39  a8 0f e3 20 73 20 3d 20  |= col$.9... s = |
00009530  31 20 b8 20 32 0d 39 b2  1c f1 20 8a 37 30 2c 31  |1 . 2.9... .70,1|
00009540  35 29 3b 62 6c 61 63 6b  67 61 6d 65 73 63 6f 72  |5);blackgamescor|
00009550  65 0d 39 bc 17 f2 73 77  69 74 63 68 5f 75 70 64  |e.9...switch_upd|
00009560  61 74 65 5f 62 61 6e 6b  0d 39 c6 07 ed 20 73 0d  |ate_bank.9... s.|
00009570  39 d0 05 cb 0d 39 da 1c  e7 20 ac 20 a4 63 6f 6d  |9....9... . .com|
00009580  70 75 74 65 72 63 6f 6c  28 63 6f 6c 24 29 20 8c  |putercol(col$) .|
00009590  0d 39 e4 1d 62 6f 61 72  64 3f 73 74 61 72 74 3d  |.9..board?start=|
000095a0  62 6f 61 72 64 3f 73 74  61 72 74 2d 31 0d 39 ee  |board?start-1.9.|
000095b0  25 e7 20 62 6f 61 72 64  3f 73 74 61 72 74 3d 31  |%. board?start=1|
000095c0  32 38 20 8c 20 62 6f 61  72 64 3f 73 74 61 72 74  |28 . board?start|
000095d0  3d 30 0d 39 f8 1e f2 73  68 61 64 6f 77 5f 64 72  |=0.9...shadow_dr|
000095e0  61 77 70 6f 69 6e 74 28  73 74 61 72 74 2c a3 29  |awpoint(start,.)|
000095f0  0d 3a 02 05 cd 0d 3a 0c  3a f4 20 57 68 65 6e 20  |.:....:.:. When |
00009600  63 6f 6d 70 75 74 65 72  20 69 73 20 62 65 61 72  |computer is bear|
00009610  69 6e 67 20 6f 66 66 2c  20 73 74 61 72 74 20 70  |ing off, start p|
00009620  6f 69 6e 74 20 69 73 20  72 65 64 72 61 77 6e 0d  |oint is redrawn.|
00009630  3a 16 19 f4 20 62 79 20  50 52 4f 43 63 6f 6d 70  |:... by PROCcomp|
00009640  75 74 65 72 64 72 61 67  0d 3a 20 24 e7 20 77 69  |uterdrag.: $. wi|
00009650  6e 6e 65 72 24 20 3e 22  22 20 8c 20 f2 77 69 6e  |nner$ >"" . .win|
00009660  6e 65 72 28 77 69 6e 6e  65 72 24 29 0d 3a 2a 05  |ner(winner$).:*.|
00009670  e1 0d 3a 34 04 0d 3a 3e  12 dd f2 77 69 6e 6e 65  |..:4..:>...winne|
00009680  72 28 63 6f 6c 24 29 0d  3a 48 41 ea 20 6d 65 73  |r(col$).:HA. mes|
00009690  73 61 67 65 31 24 2c 6d  65 73 73 61 67 65 32 24  |sage1$,message2$|
000096a0  2c 6d 65 73 73 61 67 65  33 24 2c 77 69 6e 6e 69  |,message3$,winni|
000096b0  6e 67 73 2c 62 6f 6e 75  73 2c 77 69 6e 6e 65 72  |ngs,bonus,winner|
000096c0  24 2c 6c 6f 73 65 72 24  0d 3a 52 53 e7 20 64 6f  |$,loser$.:RS. do|
000096d0  75 62 6c 65 63 75 62 65  20 3d 20 36 34 20 80 20  |ublecube = 64 . |
000096e0  64 6f 75 62 6c 65 74 75  72 6e 24 3d 22 65 69 74  |doubleturn$="eit|
000096f0  68 65 72 22 20 8c 20 77  69 6e 6e 69 6e 67 73 20  |her" . winnings |
00009700  3d 20 31 20 8b 20 77 69  6e 6e 69 6e 67 73 20 3d  |= 1 . winnings =|
00009710  20 64 6f 75 62 6c 65 63  75 62 65 0d 3a 5c 1f 62  | doublecube.:\.b|
00009720  6f 6e 75 73 3d a4 77 69  6e 62 6f 6e 75 73 28 63  |onus=.winbonus(c|
00009730  6f 6c 24 2c 62 6f 61 72  64 29 0d 3a 66 1d 77 69  |ol$,board).:f.wi|
00009740  6e 6e 69 6e 67 73 20 3d  20 77 69 6e 6e 69 6e 67  |nnings = winning|
00009750  73 2a 62 6f 6e 75 73 0d  3a 70 54 e7 20 63 6f 6c  |s*bonus.:pT. col|
00009760  24 3d 22 77 68 69 74 65  22 20 8c 20 77 69 6e 6e  |$="white" . winn|
00009770  65 72 24 3d 22 57 48 49  54 45 22 3a 6c 6f 73 65  |er$="WHITE":lose|
00009780  72 24 3d 22 42 4c 41 43  4b 22 20 8b 20 77 69 6e  |r$="BLACK" . win|
00009790  6e 65 72 24 3d 22 42 4c  41 43 4b 22 3a 6c 6f 73  |ner$="BLACK":los|
000097a0  65 72 24 3d 22 57 48 49  54 45 22 0d 3a 7a 1e 6d  |er$="WHITE".:z.m|
000097b0  65 73 73 61 67 65 31 24  3d 77 69 6e 6e 65 72 24  |essage1$=winner$|
000097c0  2b 22 20 57 49 4e 53 21  22 0d 3a 84 0e c8 8e 20  |+" WINS!".:.... |
000097d0  62 6f 6e 75 73 20 ca 0d  3a 8e 24 c9 20 31 3a 20  |bonus ..:.$. 1: |
000097e0  6d 65 73 73 61 67 65 32  24 3d 22 53 54 41 4e 44  |message2$="STAND|
000097f0  41 52 44 20 50 41 59 4f  55 54 22 0d 3a 98 28 c9  |ARD PAYOUT".:.(.|
00009800  20 32 3a 20 6d 65 73 73  61 67 65 32 24 3d 6c 6f  | 2: message2$=lo|
00009810  73 65 72 24 2b 22 20 49  53 20 47 41 4d 4d 4f 4e  |ser$+" IS GAMMON|
00009820  45 44 22 0d 3a a2 2c c9  20 33 3a 20 6d 65 73 73  |ED".:.,. 3: mess|
00009830  61 67 65 32 24 3d 6c 6f  73 65 72 24 2b 22 20 49  |age2$=loser$+" I|
00009840  53 20 42 41 43 4b 47 41  4d 4d 4f 4e 45 44 22 0d  |S BACKGAMMONED".|
00009850  3a ac 05 cb 0d 3a b6 28  6d 65 73 73 61 67 65 33  |:....:.(message3|
00009860  24 3d 6c 6f 73 65 72 24  2b 22 20 50 41 59 53 20  |$=loser$+" PAYS |
00009870  a3 22 2b c3 77 69 6e 6e  69 6e 67 73 0d 3a c0 2e  |."+.winnings.:..|
00009880  f2 77 69 6e 64 69 73 70  6c 61 79 28 6d 65 73 73  |.windisplay(mess|
00009890  61 67 65 31 24 2c 6d 65  73 73 61 67 65 32 24 2c  |age1$,message2$,|
000098a0  6d 65 73 73 61 67 65 33  24 29 0d 3a ca 6a e7 20  |message3$).:.j. |
000098b0  63 6f 6c 24 3d 22 77 68  69 74 65 22 20 8c 20 77  |col$="white" . w|
000098c0  68 69 74 65 6d 6f 6e 65  79 2b 3d 77 69 6e 6e 69  |hitemoney+=winni|
000098d0  6e 67 73 3a 62 6c 61 63  6b 6d 6f 6e 65 79 2d 3d  |ngs:blackmoney-=|
000098e0  77 69 6e 6e 69 6e 67 73  20 8b 20 62 6c 61 63 6b  |winnings . black|
000098f0  6d 6f 6e 65 79 2b 3d 77  69 6e 6e 69 6e 67 73 3a  |money+=winnings:|
00009900  77 68 69 74 65 6d 6f 6e  65 79 2d 3d 77 69 6e 6e  |whitemoney-=winn|
00009910  69 6e 67 73 0d 3a d4 38  e7 20 77 68 69 74 65 6d  |ings.:.8. whitem|
00009920  6f 6e 65 79 20 3c 20 30  20 84 20 62 6c 61 63 6b  |oney < 0 . black|
00009930  6d 6f 6e 65 79 20 3c 30  20 8c 20 f2 62 61 6e 6b  |money <0 . .bank|
00009940  72 75 70 74 28 6c 6f 73  65 72 24 29 0d 3a de 14  |rupt(loser$).:..|
00009950  67 61 6d 65 69 6e 70 72  6f 67 72 65 73 73 3d a3  |gameinprogress=.|
00009960  0d 3a e8 05 e1 0d 3a f2  04 0d 3a fc 16 dd f2 62  |.:....:...:....b|
00009970  61 6e 6b 72 75 70 74 28  6c 6f 73 65 72 24 29 0d  |ankrupt(loser$).|
00009980  3b 06 0e ea 20 6d 65 73  73 61 67 65 24 0d 3b 10  |;... message$.;.|
00009990  14 f2 64 65 6c 61 79 28  33 30 29 3a 2a 46 58 31  |..delay(30):*FX1|
000099a0  35 0d 3b 1a 23 6d 65 73  73 61 67 65 24 3d 6c 6f  |5.;.#message$=lo|
000099b0  73 65 72 24 2b 22 20 49  53 20 42 41 4e 4b 52 55  |ser$+" IS BANKRU|
000099c0  50 54 21 22 0d 3b 24 1e  f2 67 72 61 62 62 6f 78  |PT!".;$..grabbox|
000099d0  28 63 61 6e 74 62 6f 78  28 29 2c 22 74 65 6d 70  |(cantbox(),"temp|
000099e0  22 29 0d 3b 2e 23 f2 64  69 73 70 6c 61 79 62 6f  |").;.#.displaybo|
000099f0  78 28 63 61 6e 74 62 6f  78 28 29 2c 6d 65 73 73  |x(cantbox(),mess|
00009a00  61 67 65 24 29 0d 3b 38  21 f2 72 65 73 74 6f 72  |age$).;8!.restor|
00009a10  65 62 6f 78 28 63 61 6e  74 62 6f 78 28 29 2c 22  |ebox(cantbox(),"|
00009a20  74 65 6d 70 22 29 0d 3b  42 17 c8 97 20 c8 93 20  |temp").;B... .. |
00009a30  30 2c 30 2c 31 32 33 39  2c 31 30 32 33 0d 3b 4c  |0,0,1239,1023.;L|
00009a40  21 77 68 69 74 65 6d 6f  6e 65 79 3d 31 30 30 3a  |!whitemoney=100:|
00009a50  62 6c 61 63 6b 6d 6f 6e  65 79 3d 31 30 30 0d 3b  |blackmoney=100.;|
00009a60  56 05 e1 0d 3b 60 04 0d  3b 6a 1a dd a4 77 69 6e  |V...;`..;j...win|
00009a70  62 6f 6e 75 73 28 63 6f  6c 24 2c 62 6f 61 72 64  |bonus(col$,board|
00009a80  29 0d 3b 74 19 e7 20 64  6f 75 62 6c 65 5f 72 65  |).;t.. double_re|
00009a90  66 75 73 65 64 20 8c 20  3d 31 0d 3b 7e 39 f4 20  |fused . =1.;~9. |
00009aa0  52 65 74 75 72 6e 73 20  32 20 66 6f 72 20 67 61  |Returns 2 for ga|
00009ab0  6d 6d 6f 6e 2c 20 33 20  66 6f 72 20 62 61 63 6b  |mmon, 3 for back|
00009ac0  67 61 6d 6d 6f 6e 2c 20  6f 74 68 65 72 77 69 73  |gammon, otherwis|
00009ad0  65 20 31 0d 3b 88 11 ea  20 62 6f 6e 75 73 2c 70  |e 1.;... bonus,p|
00009ae0  6f 69 6e 74 0d 3b 92 0d  c8 8e 20 63 6f 6c 24 20  |oint.;.... col$ |
00009af0  ca 0d 3b 9c 0d c9 20 22  77 68 69 74 65 22 0d 3b  |..;... "white".;|
00009b00  a6 18 e7 20 62 6c 61 63  6b 70 69 65 63 65 73 20  |... blackpieces |
00009b10  3c 20 31 35 20 8c 0d 3b  b0 0b 62 6f 6e 75 73 3d  |< 15 ..;..bonus=|
00009b20  31 0d 3b ba 05 cc 0d 3b  c4 0b 62 6f 6e 75 73 3d  |1.;....;..bonus=|
00009b30  32 0d 3b ce 15 e3 20 70  6f 69 6e 74 20 3d 20 31  |2.;... point = 1|
00009b40  39 20 b8 20 32 34 0d 3b  d8 31 e7 20 a4 70 6f 69  |9 . 24.;.1. .poi|
00009b50  6e 74 70 69 65 63 65 73  28 22 62 6c 61 63 6b 22  |ntpieces("black"|
00009b60  2c 70 6f 69 6e 74 2c 62  6f 61 72 64 29 20 8c 20  |,point,board) . |
00009b70  62 6f 6e 75 73 3d 33 0d  3b e2 0b ed 20 70 6f 69  |bonus=3.;... poi|
00009b80  6e 74 0d 3b ec 05 cd 0d  3b f6 0d c9 20 22 62 6c  |nt.;....;... "bl|
00009b90  61 63 6b 22 0d 3c 00 17  e7 20 77 68 69 74 65 70  |ack".<... whitep|
00009ba0  69 65 63 65 73 20 3c 31  35 20 8c 0d 3c 0a 0c 62  |ieces <15 ..<..b|
00009bb0  6f 6e 75 73 20 3d 31 0d  3c 14 05 cc 0d 3c 1e 0b  |onus =1.<....<..|
00009bc0  62 6f 6e 75 73 3d 32 0d  3c 28 13 e3 20 70 6f 69  |bonus=2.<(.. poi|
00009bd0  6e 74 20 3d 20 31 20 b8  20 36 0d 3c 32 31 e7 20  |nt = 1 . 6.<21. |
00009be0  a4 70 6f 69 6e 74 70 69  65 63 65 73 28 22 77 68  |.pointpieces("wh|
00009bf0  69 74 65 22 2c 70 6f 69  6e 74 2c 62 6f 61 72 64  |ite",point,board|
00009c00  29 20 8c 20 62 6f 6e 75  73 3d 33 0d 3c 3c 0b ed  |) . bonus=3.<<..|
00009c10  20 70 6f 69 6e 74 0d 3c  46 05 cd 0d 3c 50 05 cb  | point.<F...<P..|
00009c20  0d 3c 5a 0a 3d 62 6f 6e  75 73 0d 3c 64 04 0d 3c  |.<Z.=bonus.<d..<|
00009c30  6e 17 f4 20 43 6f 6d 70  75 74 65 72 20 73 74 72  |n.. Computer str|
00009c40  61 74 65 67 79 0d 3c 78  17 f4 20 3d 3d 3d 3d 3d  |ategy.<x.. =====|
00009c50  3d 3d 3d 3d 3d 3d 3d 3d  3d 3d 3d 3d 0d 3c 82 04  |============.<..|
00009c60  0d 3c 8c 1e dd a4 63 68  6f 6f 73 65 63 6f 6d 70  |.<....choosecomp|
00009c70  75 74 65 72 6d 6f 76 65  28 63 6f 6c 24 29 0d 3c  |utermove(col$).<|
00009c80  96 1f ea 20 6c 65 67 61  6c 2c 76 61 6c 75 65 2c  |... legal,value,|
00009c90  6d 61 78 2c 6e 6d 61 78  2c 6d 6f 76 65 0d 3c a0  |max,nmax,move.<.|
00009ca0  13 e7 20 6e 6c 65 67 61  6c 3d 31 20 8c 20 3d 31  |.. nlegal=1 . =1|
00009cb0  0d 3c aa 3e e7 20 ac 20  62 65 61 72 69 6e 67 70  |.<.>. . bearingp|
00009cc0  6f 73 73 69 62 6c 65 20  80 20 28 61 6c 6c 70 61  |ossible . (allpa|
00009cd0  73 74 20 84 20 a4 6f 70  70 6f 6e 65 6e 74 62 65  |st . .opponentbe|
00009ce0  61 72 69 6e 67 28 63 6f  6c 24 29 29 20 8c 0d 3c  |aring(col$)) ..<|
00009cf0  b4 1b 3d a4 6d 6f 73 74  64 69 73 74 61 6e 74 6d  |..=.mostdistantm|
00009d00  6f 76 65 28 63 6f 6c 24  29 0d 3c be 05 cd 0d 3c  |ove(col$).<....<|
00009d10  c8 17 e7 20 62 65 61 72  69 6e 67 70 6f 73 73 69  |... bearingpossi|
00009d20  62 6c 65 20 8c 0d 3c d2  34 e7 20 a4 6e 6f 68 6f  |ble ..<.4. .noho|
00009d30  6d 65 62 6c 6f 74 73 28  63 6f 6c 24 29 20 8c 20  |meblots(col$) . |
00009d40  3d a4 63 68 6f 6f 73 65  62 65 61 72 69 6e 67 6d  |=.choosebearingm|
00009d50  6f 76 65 28 63 6f 6c 24  29 0d 3c dc 05 cd 0d 3c  |ove(col$).<....<|
00009d60  e6 14 e7 20 6d 6f 76 65  3e 30 20 8c 20 3d 6d 6f  |... move>0 . =mo|
00009d70  76 65 0d 3c f0 39 f4 20  45 76 61 6c 75 61 74 65  |ve.<.9. Evaluate|
00009d80  20 70 6f 73 73 69 62 6c  65 20 6d 6f 76 65 73 20  | possible moves |
00009d90  61 6e 64 20 6b 65 65 70  20 6c 69 73 74 20 6f 66  |and keep list of|
00009da0  20 74 68 6f 73 65 20 77  69 74 68 0d 3c fa 34 f4  | those with.<.4.|
00009db0  20 65 71 75 61 6c 20 6d  61 78 69 6d 75 6d 20 73  | equal maximum s|
00009dc0  63 6f 72 65 2e 20 54 68  65 6e 20 63 68 6f 6f 73  |core. Then choos|
00009dd0  65 20 6f 6e 65 20 61 74  20 72 61 6e 64 6f 6d 0d  |e one at random.|
00009de0  3d 04 1f 6d 61 78 20 3d  20 a4 65 76 61 6c 75 61  |=..max = .evalua|
00009df0  74 65 6d 6f 76 65 28 31  2c 63 6f 6c 24 29 0d 3d  |temove(1,col$).=|
00009e00  0e 25 6e 6d 61 78 20 3d  20 31 3a 20 62 65 73 74  |.%nmax = 1: best|
00009e10  6d 6f 76 65 73 28 31 29  20 3d 20 31 3a 6d 6f 76  |moves(1) = 1:mov|
00009e20  65 3d 31 0d 3d 18 23 f4  20 50 52 49 4e 54 20 54  |e=1.=.#. PRINT T|
00009e30  41 42 28 30 2c 31 29 3b  22 20 20 20 20 20 20 20  |AB(0,1);"       |
00009e40  20 20 20 20 20 22 0d 3d  22 40 f4 20 50 52 49 4e  |     ".="@. PRIN|
00009e50  54 20 54 41 42 28 30 2c  31 29 3b 63 6f 6c 24 3b  |T TAB(0,1);col$;|
00009e60  22 20 22 3b 31 3b 22 20  22 3b 6c 65 67 61 6c 6d  |" ";1;" ";legalm|
00009e70  6f 76 65 73 28 31 2c 31  29 3b 22 20 22 3b 6d 61  |oves(1,1);" ";ma|
00009e80  78 3b 22 20 20 22 0d 3d  2c 18 e3 20 6c 65 67 61  |x;"  ".=,.. lega|
00009e90  6c 20 3d 20 32 20 b8 20  6e 6c 65 67 61 6c 0d 3d  |l = 2 . nlegal.=|
00009ea0  36 23 76 61 6c 75 65 3d  a4 65 76 61 6c 75 61 74  |6#value=.evaluat|
00009eb0  65 6d 6f 76 65 28 6c 65  67 61 6c 2c 63 6f 6c 24  |emove(legal,col$|
00009ec0  29 0d 3d 40 31 f4 20 46  4f 52 20 69 3d 31 20 54  |).=@1. FOR i=1 T|
00009ed0  4f 20 32 34 3a 62 65 73  74 62 6f 61 72 64 3f 69  |O 24:bestboard?i|
00009ee0  20 3d 20 6e 65 77 62 6f  61 72 64 3f 69 3a 4e 45  | = newboard?i:NE|
00009ef0  58 54 0d 3d 4a 13 e7 20  76 61 6c 75 65 20 3e 20  |XT.=J.. value > |
00009f00  6d 61 78 20 8c 0d 3d 54  32 6d 61 78 3d 76 61 6c  |max ..=T2max=val|
00009f10  75 65 3a 6e 6d 61 78 3d  31 3a 62 65 73 74 6d 6f  |ue:nmax=1:bestmo|
00009f20  76 65 73 28 31 29 3d 6c  65 67 61 6c 3a 6d 6f 76  |ves(1)=legal:mov|
00009f30  65 3d 6c 65 67 61 6c 0d  3d 5e 05 cc 0d 3d 68 13  |e=legal.=^...=h.|
00009f40  e7 20 76 61 6c 75 65 20  3d 20 6d 61 78 20 8c 0d  |. value = max ..|
00009f50  3d 72 24 6e 6d 61 78 2b  3d 31 3a 20 62 65 73 74  |=r$nmax+=1: best|
00009f60  6d 6f 76 65 73 28 6e 6d  61 78 29 20 3d 20 6c 65  |moves(nmax) = le|
00009f70  67 61 6c 0d 3d 7c 05 cd  0d 3d 86 05 cd 0d 3d 90  |gal.=|...=....=.|
00009f80  27 f4 20 50 52 49 4e 54  20 54 41 42 28 30 2c 6c  |'. PRINT TAB(0,l|
00009f90  65 67 61 6c 29 3b 22 20  20 20 20 20 20 20 20 20  |egal);"         |
00009fa0  20 20 20 22 0d 3d 9a 4e  f4 20 50 52 49 4e 54 20  |   ".=.N. PRINT |
00009fb0  54 41 42 28 30 2c 6c 65  67 61 6c 29 3b 63 6f 6c  |TAB(0,legal);col|
00009fc0  24 3b 22 20 22 3b 6c 65  67 61 6c 3b 22 20 22 3b  |$;" ";legal;" ";|
00009fd0  6c 65 67 61 6c 6d 6f 76  65 73 28 31 2c 6c 65 67  |legalmoves(1,leg|
00009fe0  61 6c 29 3b 22 20 22 3b  76 61 6c 75 65 3b 22 20  |al);" ";value;" |
00009ff0  20 22 0d 3d a4 0b ed 20  6c 65 67 61 6c 0d 3d ae  | ".=... legal.=.|
0000a000  27 f4 20 50 52 49 4e 54  20 54 41 42 28 30 2c 6c  |'. PRINT TAB(0,l|
0000a010  65 67 61 6c 29 3b 22 20  20 20 20 20 20 20 20 20  |egal);"         |
0000a020  20 20 20 22 0d 3d b8 20  f4 20 50 52 49 4e 54 20  |   ".=. . PRINT |
0000a030  54 41 42 28 30 2c 6c 65  67 61 6c 29 6e 6d 61 78  |TAB(0,legal)nmax|
0000a040  2c 6d 61 78 0d 3d c2 49  f4 20 49 46 20 6e 6d 61  |,max.=.I. IF nma|
0000a050  78 20 3d 20 31 20 54 48  45 4e 20 6d 6f 76 65 20  |x = 1 THEN move |
0000a060  3d 62 65 73 74 6d 6f 76  65 73 28 31 29 20 45 4c  |=bestmoves(1) EL|
0000a070  53 45 20 6d 6f 76 65 20  3d 62 65 73 74 6d 6f 76  |SE move =bestmov|
0000a080  65 73 28 52 4e 44 28 6e  6d 61 78 29 29 0d 3d cc  |es(RND(nmax)).=.|
0000a090  1b f4 20 50 52 49 4e 54  20 54 41 42 28 30 2c 30  |.. PRINT TAB(0,0|
0000a0a0  29 3b 53 50 43 35 30 3b  0d 3d d6 55 f4 20 50 52  |);SPC50;.=.U. PR|
0000a0b0  49 4e 54 20 54 41 42 28  30 2c 30 29 3b 22 63 6f  |INT TAB(0,0);"co|
0000a0c0  6c 6f 75 72 20 22 3b 63  6f 6c 24 3b 22 20 6e 6c  |lour ";col$;" nl|
0000a0d0  65 67 61 6c 20 22 3b 6e  6c 65 67 61 6c 3b 22 20  |egal ";nlegal;" |
0000a0e0  62 65 73 74 6d 6f 76 65  20 22 3b 6d 6f 76 65 3b  |bestmove ";move;|
0000a0f0  22 20 76 61 6c 75 65 20  22 3b 6d 61 78 0d 3d e0  |" value ";max.=.|
0000a100  09 3d 6d 6f 76 65 0d 3d  ea 04 0d 3d f4 19 dd a4  |.=move.=...=....|
0000a110  70 6c 61 79 65 72 62 65  61 72 69 6e 67 28 63 6f  |playerbearing(co|
0000a120  6c 24 29 0d 3d fe 45 3d  20 28 28 63 6f 6c 24 3d  |l$).=.E= ((col$=|
0000a130  22 77 68 69 74 65 22 20  80 20 77 68 69 74 65 62  |"white" . whiteb|
0000a140  65 61 72 69 6e 67 29 20  84 20 28 63 6f 6c 24 3d  |earing) . (col$=|
0000a150  22 62 6c 61 63 6b 22 20  80 20 62 6c 61 63 6b 62  |"black" . blackb|
0000a160  65 61 72 69 6e 67 29 29  0d 3e 08 04 0d 3e 12 1b  |earing)).>...>..|
0000a170  dd a4 6f 70 70 6f 6e 65  6e 74 62 65 61 72 69 6e  |..opponentbearin|
0000a180  67 28 63 6f 6c 24 29 0d  3e 1c 4b e7 20 28 63 6f  |g(col$).>.K. (co|
0000a190  6c 24 3d 22 77 68 69 74  65 22 20 80 20 62 6c 61  |l$="white" . bla|
0000a1a0  63 6b 70 69 65 63 65 73  3c 37 29 20 84 20 28 63  |ckpieces<7) . (c|
0000a1b0  6f 6c 24 3d 22 62 6c 61  63 6b 22 20 80 20 77 68  |ol$="black" . wh|
0000a1c0  69 74 65 70 69 65 63 65  73 3c 37 29 20 8c 20 3d  |itepieces<7) . =|
0000a1d0  20 a3 0d 3e 26 42 3d 28  63 6f 6c 24 3d 22 77 68  | ..>&B=(col$="wh|
0000a1e0  69 74 65 22 20 80 20 62  6c 61 63 6b 62 65 61 72  |ite" . blackbear|
0000a1f0  69 6e 67 29 20 84 20 28  63 6f 6c 24 3d 22 62 6c  |ing) . (col$="bl|
0000a200  61 63 6b 22 20 80 20 77  68 69 74 65 62 65 61 72  |ack" . whitebear|
0000a210  69 6e 67 29 0d 3e 30 04  0d 3e 3a 1b dd a4 6d 6f  |ing).>0..>:...mo|
0000a220  73 74 64 69 73 74 61 6e  74 6d 6f 76 65 28 63 6f  |stdistantmove(co|
0000a230  6c 24 29 0d 3e 44 38 f4  20 72 65 74 75 72 6e 73  |l$).>D8. returns|
0000a240  20 6c 65 67 61 6c 20 6d  6f 76 65 20 6f 66 20 70  | legal move of p|
0000a250  69 65 63 65 20 6d 6f 73  74 20 64 69 73 74 61 6e  |iece most distan|
0000a260  74 20 66 72 6f 6d 20 68  6f 6d 65 0d 3e 4e 20 ea  |t from home.>N .|
0000a270  20 6d 6f 76 65 2c 62 65  73 74 2c 66 75 72 74 68  | move,best,furth|
0000a280  65 73 74 2c 63 75 72 72  65 6e 74 0d 3e 58 28 62  |est,current.>X(b|
0000a290  65 73 74 20 3d 20 31 3a  20 66 75 72 74 68 65 73  |est = 1: furthes|
0000a2a0  74 20 3d 20 6c 65 67 61  6c 6d 6f 76 65 73 28 31  |t = legalmoves(1|
0000a2b0  2c 31 29 0d 3e 62 17 e3  20 6d 6f 76 65 20 3d 20  |,1).>b.. move = |
0000a2c0  32 20 b8 20 6e 6c 65 67  61 6c 0d 3e 6c 20 63 75  |2 . nlegal.>l cu|
0000a2d0  72 72 65 6e 74 20 3d 20  6c 65 67 61 6c 6d 6f 76  |rrent = legalmov|
0000a2e0  65 73 28 31 2c 6d 6f 76  65 29 0d 3e 76 0d c8 8e  |es(1,move).>v...|
0000a2f0  20 63 6f 6c 24 20 ca 0d  3e 80 42 c9 20 22 77 68  | col$ ..>.B. "wh|
0000a300  69 74 65 22 3a 20 e7 20  63 75 72 72 65 6e 74 20  |ite": . current |
0000a310  3c 20 66 75 72 74 68 65  73 74 20 8c 20 63 75 72  |< furthest . cur|
0000a320  72 65 6e 74 20 3d 20 66  75 72 74 68 65 73 74 3a  |rent = furthest:|
0000a330  62 65 73 74 3d 6d 6f 76  65 0d 3e 8a 42 c9 20 22  |best=move.>.B. "|
0000a340  62 6c 61 63 6b 22 3a 20  e7 20 63 75 72 72 65 6e  |black": . curren|
0000a350  74 20 3e 20 66 75 72 74  68 65 73 74 20 8c 20 63  |t > furthest . c|
0000a360  75 72 72 65 6e 74 20 3d  20 66 75 72 74 68 65 73  |urrent = furthes|
0000a370  74 3a 62 65 73 74 3d 6d  6f 76 65 0d 3e 94 05 cb  |t:best=move.>...|
0000a380  0d 3e 9e 0a ed 20 6d 6f  76 65 0d 3e a8 09 3d 62  |.>... move.>..=b|
0000a390  65 73 74 0d 3e b2 04 0d  3e bc 17 dd a4 6e 6f 68  |est.>...>....noh|
0000a3a0  6f 6d 65 62 6c 6f 74 73  28 63 6f 6c 24 29 0d 3e  |omeblots(col$).>|
0000a3b0  c6 41 f4 20 72 65 74 75  72 6e 73 20 54 52 55 45  |.A. returns TRUE|
0000a3c0  20 69 66 20 6e 6f 20 62  6c 6f 74 73 20 69 6e 20  | if no blots in |
0000a3d0  68 6f 6d 65 20 62 6f 61  72 64 20 74 68 61 74 20  |home board that |
0000a3e0  63 61 6e 20 62 65 20 61  74 74 61 63 6b 65 64 0d  |can be attacked.|
0000a3f0  3e d0 27 ea 20 73 74 61  72 74 2c 65 6e 64 2c 70  |>.'. start,end,p|
0000a400  6f 69 6e 74 2c 62 6c 6f  74 73 63 6f 72 65 2c 70  |oint,blotscore,p|
0000a410  72 65 73 65 6e 74 0d 3e  da 40 e7 20 28 63 6f 6c  |resent.>.@. (col|
0000a420  24 3d 22 77 68 69 74 65  22 20 80 20 62 61 72 62  |$="white" . barb|
0000a430  6c 61 63 6b 29 20 84 20  28 63 6f 6c 24 3d 22 62  |lack) . (col$="b|
0000a440  6c 61 63 6b 22 20 80 20  62 61 72 77 68 69 74 65  |lack" . barwhite|
0000a450  29 20 8c 20 3d a3 0d 3e  e4 0f 62 6c 6f 74 73 63  |) . =..>..blotsc|
0000a460  6f 72 65 3d 30 0d 3e ee  34 e7 20 63 6f 6c 24 3d  |ore=0.>.4. col$=|
0000a470  22 77 68 69 74 65 22 20  8c 20 73 74 61 72 74 3d  |"white" . start=|
0000a480  31 39 3a 65 6e 64 3d 32  34 20 8b 20 73 74 61 72  |19:end=24 . star|
0000a490  74 3d 31 3a 65 6e 64 3d  36 0d 3e f8 17 e3 20 70  |t=1:end=6.>... p|
0000a4a0  6f 69 6e 74 3d 73 74 61  72 74 20 b8 20 65 6e 64  |oint=start . end|
0000a4b0  0d 3f 02 2c 70 72 65 73  65 6e 74 20 3d 20 a4 70  |.?.,present = .p|
0000a4c0  6f 69 6e 74 70 69 65 63  65 73 28 63 6f 6c 24 2c  |ointpieces(col$,|
0000a4d0  70 6f 69 6e 74 2c 62 6f  61 72 64 29 0d 3f 0c 58  |point,board).?.X|
0000a4e0  e7 20 70 72 65 73 65 6e  74 3d 31 20 8c 20 62 6c  |. present=1 . bl|
0000a4f0  6f 74 73 63 6f 72 65 20  2d 3d 20 a4 62 6c 6f 74  |otscore -= .blot|
0000a500  73 63 6f 72 65 28 63 6f  6c 24 2c 70 6f 69 6e 74  |score(col$,point|
0000a510  2c 63 6f 6c 24 2c 62 61  72 77 68 69 74 65 2c 62  |,col$,barwhite,b|
0000a520  61 72 62 6c 61 63 6b 2c  62 6f 61 72 64 2c 31 2c  |arblack,board,1,|
0000a530  30 2c 30 29 0d 3f 16 0b  ed 20 70 6f 69 6e 74 0d  |0,0).?... point.|
0000a540  3f 20 2f f4 20 50 52 49  4e 54 20 54 41 42 28 30  |? /. PRINT TAB(0|
0000a550  2c 30 29 3b 22 20 20 20  20 20 22 3b 54 41 42 28  |,0);"     ";TAB(|
0000a560  30 2c 30 29 3b 62 6c 6f  74 73 63 6f 72 65 0d 3f  |0,0);blotscore.?|
0000a570  2a 12 3d 28 62 6c 6f 74  73 63 6f 72 65 3d 30 29  |*.=(blotscore=0)|
0000a580  0d 3f 34 04 0d 3f 3e 1d  dd a4 63 68 6f 6f 73 65  |.?4..?>...choose|
0000a590  62 65 61 72 69 6e 67 6d  6f 76 65 28 63 6f 6c 24  |bearingmove(col$|
0000a5a0  29 0d 3f 48 45 f4 20 63  68 6f 6f 73 65 73 20 62  |).?HE. chooses b|
0000a5b0  65 61 72 69 6e 67 20 6d  6f 76 65 20 74 68 61 74  |earing move that|
0000a5c0  20 69 73 20 66 75 72 74  68 65 73 74 20 66 72 6f  | is furthest fro|
0000a5d0  6d 20 74 68 65 20 65 6e  64 20 6f 66 20 74 68 65  |m the end of the|
0000a5e0  20 62 6f 61 72 64 0d 3f  52 25 ea 20 6d 6f 76 65  | board.?R%. move|
0000a5f0  2c 66 72 6f 6d 2c 62 65  73 74 6d 6f 76 65 2c 62  |,from,bestmove,b|
0000a600  65 73 74 6d 6f 76 65 66  72 6f 6d 0d 3f 5c 0e 62  |estmovefrom.?\.b|
0000a610  65 73 74 6d 6f 76 65 3d  30 0d 3f 66 17 e3 20 6d  |estmove=0.?f.. m|
0000a620  6f 76 65 20 3d 20 31 20  b8 20 6e 6c 65 67 61 6c  |ove = 1 . nlegal|
0000a630  0d 3f 70 1a e7 20 6c 65  67 61 6c 6d 6f 76 65 73  |.?p.. legalmoves|
0000a640  28 35 2c 6d 6f 76 65 29  20 8c 0d 3f 7a 1d 66 72  |(5,move) ..?z.fr|
0000a650  6f 6d 20 3d 20 6c 65 67  61 6c 6d 6f 76 65 73 28  |om = legalmoves(|
0000a660  31 2c 6d 6f 76 65 29 0d  3f 84 12 e7 20 62 65 73  |1,move).?... bes|
0000a670  74 6d 6f 76 65 3d 30 20  8c 0d 3f 8e 23 62 65 73  |tmove=0 ..?.#bes|
0000a680  74 6d 6f 76 65 3d 6d 6f  76 65 3a 62 65 73 74 6d  |tmove=move:bestm|
0000a690  6f 76 65 66 72 6f 6d 3d  66 72 6f 6d 0d 3f 98 05  |ovefrom=from.?..|
0000a6a0  cc 0d 3f a2 0d c8 8e 20  63 6f 6c 24 20 ca 0d 3f  |..?.... col$ ..?|
0000a6b0  ac 4b c9 20 22 77 68 69  74 65 22 3a e7 20 66 72  |.K. "white":. fr|
0000a6c0  6f 6d 3c 62 65 73 74 6d  6f 76 65 66 72 6f 6d 20  |om<bestmovefrom |
0000a6d0  8c 20 62 65 73 74 6d 6f  76 65 3d 6d 6f 76 65 3a  |. bestmove=move:|
0000a6e0  62 65 73 74 6d 6f 76 65  66 72 6f 6d 3d 62 65 73  |bestmovefrom=bes|
0000a6f0  74 6d 6f 76 65 66 72 6f  6d 0d 3f b6 4b c9 20 22  |tmovefrom.?.K. "|
0000a700  62 6c 61 63 6b 22 3a e7  20 66 72 6f 6d 3e 62 65  |black":. from>be|
0000a710  73 74 6d 6f 76 65 66 72  6f 6d 20 8c 20 62 65 73  |stmovefrom . bes|
0000a720  74 6d 6f 76 65 3d 6d 6f  76 65 3a 62 65 73 74 6d  |tmove=move:bestm|
0000a730  6f 76 65 66 72 6f 6d 3d  62 65 73 74 6d 6f 76 65  |ovefrom=bestmove|
0000a740  66 72 6f 6d 0d 3f c0 05  cb 0d 3f ca 05 cd 0d 3f  |from.?....?....?|
0000a750  d4 05 cd 0d 3f de 0a ed  20 6d 6f 76 65 0d 3f e8  |....?... move.?.|
0000a760  2d f4 20 50 52 49 4e 54  20 54 41 42 28 30 2c 31  |-. PRINT TAB(0,1|
0000a770  29 3b 22 20 20 20 20 22  3b 54 41 42 28 30 2c 31  |);"    ";TAB(0,1|
0000a780  29 3b 62 65 73 74 6d 6f  76 65 0d 3f f2 0d 3d 62  |);bestmove.?..=b|
0000a790  65 73 74 6d 6f 76 65 0d  3f fc 04 0d 40 06 1d dd  |estmove.?...@...|
0000a7a0  a4 65 76 61 6c 75 61 74  65 6d 6f 76 65 28 6d 6f  |.evaluatemove(mo|
0000a7b0  76 65 2c 63 6f 6c 24 29  0d 40 10 1b f2 70 72 6f  |ve,col$).@...pro|
0000a7c0  6a 65 63 74 6d 6f 76 65  28 6d 6f 76 65 2c 63 6f  |jectmove(move,co|
0000a7d0  6c 24 29 0d 40 1a 63 3d  a4 65 76 61 6c 75 61 74  |l$).@.c=.evaluat|
0000a7e0  65 62 6f 61 72 64 28 63  6f 6c 24 2c 6e 65 77 62  |eboard(col$,newb|
0000a7f0  6f 61 72 64 2c 6e 65 77  77 68 69 74 65 70 69 65  |oard,newwhitepie|
0000a800  63 65 73 2c 6e 65 77 62  6c 61 63 6b 70 69 65 63  |ces,newblackpiec|
0000a810  65 73 2c 6e 65 77 62 61  72 77 68 69 74 65 2c 6e  |es,newbarwhite,n|
0000a820  65 77 62 61 72 62 6c 61  63 6b 2c 6e 65 77 77 69  |ewbarblack,newwi|
0000a830  6e 6e 65 72 24 29 0d 40  24 04 0d 40 2e 1c dd f2  |nner$).@$..@....|
0000a840  70 72 6f 6a 65 63 74 6d  6f 76 65 28 6d 6f 76 65  |projectmove(move|
0000a850  2c 63 6f 6c 24 29 0d 40  38 0b ea 20 70 6f 69 6e  |,col$).@8.. poin|
0000a860  74 0d 40 42 35 e3 20 70  6f 69 6e 74 3d 31 20 b8  |t.@B5. point=1 .|
0000a870  20 32 34 3a 6e 65 77 62  6f 61 72 64 3f 70 6f 69  | 24:newboard?poi|
0000a880  6e 74 3d 62 6f 61 72 64  3f 70 6f 69 6e 74 3a ed  |nt=board?point:.|
0000a890  20 70 6f 69 6e 74 0d 40  4c 1e 73 74 61 72 74 20  | point.@L.start |
0000a8a0  3d 20 6c 65 67 61 6c 6d  6f 76 65 73 28 31 2c 6d  |= legalmoves(1,m|
0000a8b0  6f 76 65 29 0d 40 56 1c  65 6e 64 20 3d 20 6c 65  |ove).@V.end = le|
0000a8c0  67 61 6c 6d 6f 76 65 73  28 32 2c 6d 6f 76 65 29  |galmoves(2,move)|
0000a8d0  0d 40 60 21 64 69 63 65  75 73 65 64 20 3d 20 6c  |.@`!diceused = l|
0000a8e0  65 67 61 6c 6d 6f 76 65  73 28 33 2c 6d 6f 76 65  |egalmoves(3,move|
0000a8f0  29 0d 40 6a 20 62 61 72  6d 6f 76 65 20 3d 20 6c  |).@j barmove = l|
0000a900  65 67 61 6c 6d 6f 76 65  73 28 34 2c 6d 6f 76 65  |egalmoves(4,move|
0000a910  29 0d 40 74 20 62 65 61  72 69 6e 67 20 3d 20 6c  |).@t bearing = l|
0000a920  65 67 61 6c 6d 6f 76 65  73 28 35 2c 6d 6f 76 65  |egalmoves(5,move|
0000a930  29 0d 40 7e 1c 6d 6f 76  65 66 72 6f 6d 62 61 72  |).@~.movefrombar|
0000a940  20 3d 20 28 73 74 61 72  74 3d 39 39 29 0d 40 88  | = (start=99).@.|
0000a950  20 6e 65 77 77 68 69 74  65 70 69 65 63 65 73 20  | newwhitepieces |
0000a960  3d 20 77 68 69 74 65 70  69 65 63 65 73 0d 40 92  |= whitepieces.@.|
0000a970  20 6e 65 77 62 6c 61 63  6b 70 69 65 63 65 73 20  | newblackpieces |
0000a980  3d 20 62 6c 61 63 6b 70  69 65 63 65 73 0d 40 9c  |= blackpieces.@.|
0000a990  1a 6e 65 77 62 61 72 77  68 69 74 65 20 3d 20 62  |.newbarwhite = b|
0000a9a0  61 72 77 68 69 74 65 0d  40 a6 1a 6e 65 77 62 61  |arwhite.@..newba|
0000a9b0  72 62 6c 61 63 6b 20 3d  20 62 61 72 62 6c 61 63  |rblack = barblac|
0000a9c0  6b 0d 40 b0 11 6e 65 77  77 69 6e 6e 65 72 24 3d  |k.@..newwinner$=|
0000a9d0  22 22 0d 40 ba 2d e7 20  62 65 61 72 69 6e 67 20  |"".@.-. bearing |
0000a9e0  8c 20 f2 70 72 6f 6a 65  63 74 62 65 61 72 69 6e  |. .projectbearin|
0000a9f0  67 28 63 6f 6c 24 2c 73  74 61 72 74 29 3a e1 0d  |g(col$,start):..|
0000aa00  40 c4 13 e7 20 6d 6f 76  65 66 72 6f 6d 62 61 72  |@... movefrombar|
0000aa10  20 8c 0d 40 ce 0d c8 8e  20 63 6f 6c 24 20 ca 0d  | ..@.... col$ ..|
0000aa20  40 d8 1e c9 20 22 77 68  69 74 65 22 3a 20 6e 65  |@... "white": ne|
0000aa30  77 62 61 72 77 68 69 74  65 20 2d 3d 31 0d 40 e2  |wbarwhite -=1.@.|
0000aa40  1e c9 20 22 62 6c 61 63  6b 22 3a 20 6e 65 77 62  |.. "black": newb|
0000aa50  61 72 62 6c 61 63 6b 20  2d 3d 31 0d 40 ec 05 cb  |arblack -=1.@...|
0000aa60  0d 40 f6 05 cc 0d 41 00  23 6e 65 77 62 6f 61 72  |.@....A.#newboar|
0000aa70  64 3f 73 74 61 72 74 3d  6e 65 77 62 6f 61 72 64  |d?start=newboard|
0000aa80  3f 73 74 61 72 74 2d 31  0d 41 0a 2b e7 20 6e 65  |?start-1.A.+. ne|
0000aa90  77 62 6f 61 72 64 3f 73  74 61 72 74 3d 31 32 38  |wboard?start=128|
0000aaa0  20 8c 20 6e 65 77 62 6f  61 72 64 3f 73 74 61 72  | . newboard?star|
0000aab0  74 3d 30 0d 41 14 05 cd  0d 41 1e 0f e7 20 62 61  |t=0.A....A... ba|
0000aac0  72 6d 6f 76 65 20 8c 0d  41 28 0d c8 8e 20 63 6f  |rmove ..A(... co|
0000aad0  6c 24 20 ca 0d 41 32 2e  c9 20 22 77 68 69 74 65  |l$ ..A2.. "white|
0000aae0  22 3a 20 6e 65 77 62 61  72 62 6c 61 63 6b 20 2b  |": newbarblack +|
0000aaf0  3d 31 3a 20 6e 65 77 62  6f 61 72 64 3f 65 6e 64  |=1: newboard?end|
0000ab00  3d 31 0d 41 3c 30 c9 20  22 62 6c 61 63 6b 22 3a  |=1.A<0. "black":|
0000ab10  20 6e 65 77 62 61 72 77  68 69 74 65 20 2b 3d 31  | newbarwhite +=1|
0000ab20  3a 20 6e 65 77 62 6f 61  72 64 3f 65 6e 64 3d 31  |: newboard?end=1|
0000ab30  32 39 0d 41 46 05 cb 0d  41 50 05 cc 0d 41 5a 36  |29.AF...AP...AZ6|
0000ab40  e7 20 63 6f 6c 24 3d 22  62 6c 61 63 6b 22 20 80  |. col$="black" .|
0000ab50  20 6e 65 77 62 6f 61 72  64 3f 65 6e 64 3d 30 20  | newboard?end=0 |
0000ab60  8c 20 6e 65 77 62 6f 61  72 64 3f 65 6e 64 3d 31  |. newboard?end=1|
0000ab70  32 38 0d 41 64 1f 6e 65  77 62 6f 61 72 64 3f 65  |28.Ad.newboard?e|
0000ab80  6e 64 3d 6e 65 77 62 6f  61 72 64 3f 65 6e 64 2b  |nd=newboard?end+|
0000ab90  31 0d 41 6e 05 cd 0d 41  78 05 e1 0d 41 82 04 0d  |1.An...Ax...A...|
0000aba0  41 8c 20 dd f2 70 72 6f  6a 65 63 74 62 65 61 72  |A. ..projectbear|
0000abb0  69 6e 67 28 63 6f 6c 24  2c 73 74 61 72 74 29 0d  |ing(col$,start).|
0000abc0  41 96 11 6e 65 77 77 69  6e 6e 65 72 24 3d 22 22  |A..newwinner$=""|
0000abd0  0d 41 a0 0d c8 8e 20 63  6f 6c 24 20 ca 0d 41 aa  |.A.... col$ ..A.|
0000abe0  0e c9 20 22 77 68 69 74  65 22 3a 0d 41 b4 0b fb  |.. "white":.A...|
0000abf0  20 77 68 69 74 65 0d 41  be 16 6e 65 77 77 68 69  | white.A..newwhi|
0000ac00  74 65 70 69 65 63 65 73  20 2d 3d 31 0d 41 c8 2b  |tepieces -=1.A.+|
0000ac10  e7 20 6e 65 77 77 68 69  74 65 70 69 65 63 65 73  |. newwhitepieces|
0000ac20  20 3d 20 30 20 8c 20 6e  65 77 77 69 6e 6e 65 72  | = 0 . newwinner|
0000ac30  24 20 3d 63 6f 6c 24 0d  41 d2 0e c9 20 22 62 6c  |$ =col$.A... "bl|
0000ac40  61 63 6b 22 3a 0d 41 dc  0b fb 20 62 6c 61 63 6b  |ack":.A... black|
0000ac50  0d 41 e6 16 6e 65 77 62  6c 61 63 6b 70 69 65 63  |.A..newblackpiec|
0000ac60  65 73 20 2d 3d 31 0d 41  f0 2c e7 20 6e 65 77 62  |es -=1.A.,. newb|
0000ac70  6c 61 63 6b 70 69 65 63  65 73 20 3d 20 30 20 8c  |lackpieces = 0 .|
0000ac80  20 6e 65 77 77 69 6e 6e  65 72 24 20 3d 20 63 6f  | newwinner$ = co|
0000ac90  6c 24 0d 41 fa 05 cb 0d  42 04 23 6e 65 77 62 6f  |l$.A....B.#newbo|
0000aca0  61 72 64 3f 73 74 61 72  74 3d 6e 65 77 62 6f 61  |ard?start=newboa|
0000acb0  72 64 3f 73 74 61 72 74  2d 31 0d 42 0e 2b e7 20  |rd?start-1.B.+. |
0000acc0  6e 65 77 62 6f 61 72 64  3f 73 74 61 72 74 3d 31  |newboard?start=1|
0000acd0  32 38 20 8c 20 6e 65 77  62 6f 61 72 64 3f 73 74  |28 . newboard?st|
0000ace0  61 72 74 3d 30 0d 42 18  05 e1 0d 42 22 04 0d 42  |art=0.B....B"..B|
0000acf0  2c 4e dd a4 65 76 61 6c  75 61 74 65 62 6f 61 72  |,N..evaluateboar|
0000ad00  64 28 63 6f 6c 24 2c 62  6f 61 72 64 2c 77 68 69  |d(col$,board,whi|
0000ad10  74 65 70 69 65 63 65 73  2c 62 6c 61 63 6b 70 69  |tepieces,blackpi|
0000ad20  65 63 65 73 2c 62 61 72  77 68 69 74 65 2c 62 61  |eces,barwhite,ba|
0000ad30  72 62 6c 61 63 6b 2c 77  69 6e 24 29 0d 42 36 1f  |rblack,win$).B6.|
0000ad40  e7 20 63 6f 6c 24 20 3d  20 77 69 6e 24 20 8c 20  |. col$ = win$ . |
0000ad50  3d 70 6c 61 79 65 72 77  69 6e 73 0d 42 40 2c ea  |=playerwins.B@,.|
0000ad60  20 73 63 6f 72 65 2c 77  70 2c 62 70 2c 77 68 63  | score,wp,bp,whc|
0000ad70  2c 77 6f 63 2c 62 68 63  2c 62 6f 63 3a 20 73 63  |,woc,bhc,boc: sc|
0000ad80  6f 72 65 20 3d 20 30 0d  42 4a 2d f2 63 6f 75 6e  |ore = 0.BJ-.coun|
0000ad90  74 5f 62 6f 61 72 64 28  62 6f 61 72 64 2c 77 70  |t_board(board,wp|
0000ada0  2c 62 70 2c 77 68 63 2c  77 6f 63 2c 62 68 63 2c  |,bp,whc,woc,bhc,|
0000adb0  62 6f 63 29 0d 42 54 0d  c8 8e 20 63 6f 6c 24 20  |boc).BT... col$ |
0000adc0  ca 0d 42 5e 0e c9 20 22  77 68 69 74 65 22 3a 0d  |..B^.. "white":.|
0000add0  42 68 ab 73 63 6f 72 65  20 3d 20 a4 62 6f 61 72  |Bh.score = .boar|
0000ade0  64 73 63 6f 72 65 28 22  77 68 69 74 65 22 2c 62  |dscore("white",b|
0000adf0  6f 61 72 64 2c 63 6f 6c  24 2c 62 61 72 77 68 69  |oard,col$,barwhi|
0000ae00  74 65 2c 62 61 72 62 6c  61 63 6b 2c 77 70 2c 77  |te,barblack,wp,w|
0000ae10  68 63 2c 77 6f 63 2c 62  68 63 2c 62 6f 63 2c 77  |hc,woc,bhc,boc,w|
0000ae20  68 69 74 65 62 6c 6f 74  73 29 2d a4 62 6f 61 72  |hiteblots)-.boar|
0000ae30  64 73 63 6f 72 65 28 22  62 6c 61 63 6b 22 2c 62  |dscore("black",b|
0000ae40  6f 61 72 64 2c 63 6f 6c  24 2c 62 61 72 77 68 69  |oard,col$,barwhi|
0000ae50  74 65 2c 62 61 72 62 6c  61 63 6b 2c 62 70 2c 62  |te,barblack,bp,b|
0000ae60  68 63 2c 62 6f 63 2c 77  68 63 2c 77 6f 63 2c 62  |hc,boc,whc,woc,b|
0000ae70  6c 61 63 6b 62 6c 6f 74  73 29 0d 42 72 20 73 63  |lackblots).Br sc|
0000ae80  6f 72 65 20 2b 3d 20 62  61 72 77 68 69 74 65 2a  |ore += barwhite*|
0000ae90  70 69 65 63 65 6f 6e 62  61 72 0d 42 7c 20 73 63  |pieceonbar.B| sc|
0000aea0  6f 72 65 20 2d 3d 20 62  61 72 62 6c 61 63 6b 2a  |ore -= barblack*|
0000aeb0  70 69 65 63 65 6f 6e 62  61 72 0d 42 86 2b 73 63  |pieceonbar.B.+sc|
0000aec0  6f 72 65 20 2b 3d 20 28  31 35 2d 77 68 69 74 65  |ore += (15-white|
0000aed0  70 69 65 63 65 73 29 2a  70 69 65 63 65 6f 66 66  |pieces)*pieceoff|
0000aee0  62 6f 61 72 64 0d 42 90  2b 73 63 6f 72 65 20 2d  |board.B.+score -|
0000aef0  3d 20 28 31 35 2d 62 6c  61 63 6b 70 69 65 63 65  |= (15-blackpiece|
0000af00  73 29 2a 70 69 65 63 65  6f 66 66 62 6f 61 72 64  |s)*pieceoffboard|
0000af10  0d 42 9a 0d c9 20 22 62  6c 61 63 6b 22 0d 42 a4  |.B... "black".B.|
0000af20  ab 73 63 6f 72 65 20 3d  20 a4 62 6f 61 72 64 73  |.score = .boards|
0000af30  63 6f 72 65 28 22 62 6c  61 63 6b 22 2c 62 6f 61  |core("black",boa|
0000af40  72 64 2c 63 6f 6c 24 2c  62 61 72 77 68 69 74 65  |rd,col$,barwhite|
0000af50  2c 62 61 72 62 6c 61 63  6b 2c 62 70 2c 62 68 63  |,barblack,bp,bhc|
0000af60  2c 62 6f 63 2c 77 68 63  2c 77 6f 63 2c 62 6c 61  |,boc,whc,woc,bla|
0000af70  63 6b 62 6c 6f 74 73 29  2d a4 62 6f 61 72 64 73  |ckblots)-.boards|
0000af80  63 6f 72 65 28 22 77 68  69 74 65 22 2c 62 6f 61  |core("white",boa|
0000af90  72 64 2c 63 6f 6c 24 2c  62 61 72 77 68 69 74 65  |rd,col$,barwhite|
0000afa0  2c 62 61 72 62 6c 61 63  6b 2c 77 70 2c 77 68 63  |,barblack,wp,whc|
0000afb0  2c 77 6f 63 2c 62 68 63  2c 62 6f 63 2c 77 68 69  |,woc,bhc,boc,whi|
0000afc0  74 65 62 6c 6f 74 73 29  0d 42 ae 20 73 63 6f 72  |teblots).B. scor|
0000afd0  65 20 2d 3d 20 62 61 72  77 68 69 74 65 2a 70 69  |e -= barwhite*pi|
0000afe0  65 63 65 6f 6e 62 61 72  0d 42 b8 20 73 63 6f 72  |eceonbar.B. scor|
0000aff0  65 20 2b 3d 20 62 61 72  62 6c 61 63 6b 2a 70 69  |e += barblack*pi|
0000b000  65 63 65 6f 6e 62 61 72  0d 42 c2 2b 73 63 6f 72  |eceonbar.B.+scor|
0000b010  65 20 2d 3d 20 28 31 35  2d 77 68 69 74 65 70 69  |e -= (15-whitepi|
0000b020  65 63 65 73 29 2a 70 69  65 63 65 6f 66 66 62 6f  |eces)*pieceoffbo|
0000b030  61 72 64 0d 42 cc 2b 73  63 6f 72 65 20 2b 3d 20  |ard.B.+score += |
0000b040  28 31 35 2d 62 6c 61 63  6b 70 69 65 63 65 73 29  |(15-blackpieces)|
0000b050  2a 70 69 65 63 65 6f 66  66 62 6f 61 72 64 0d 42  |*pieceoffboard.B|
0000b060  d6 30 f4 20 56 44 55 37  3a 50 52 49 4e 54 20 54  |.0. VDU7:PRINT T|
0000b070  41 42 28 30 2c 31 29 3b  22 20 20 20 20 20 22 3b  |AB(0,1);"     ";|
0000b080  54 41 42 28 30 2c 31 29  3b 73 63 6f 72 65 0d 42  |TAB(0,1);score.B|
0000b090  e0 16 f4 20 52 45 50 45  41 54 20 55 4e 54 49 4c  |... REPEAT UNTIL|
0000b0a0  20 47 45 54 0d 42 ea 05  cb 0d 42 f4 0a 3d 73 63  | GET.B....B..=sc|
0000b0b0  6f 72 65 0d 42 fe 04 0d  43 08 60 dd f2 63 6f 75  |ore.B...C.`..cou|
0000b0c0  6e 74 5f 62 6f 61 72 64  28 62 6f 61 72 64 2c f8  |nt_board(board,.|
0000b0d0  20 77 68 69 74 65 70 6f  69 6e 74 73 2c f8 20 62  | whitepoints,. b|
0000b0e0  6c 61 63 6b 70 6f 69 6e  74 73 2c f8 20 77 68 69  |lackpoints,. whi|
0000b0f0  74 65 5f 68 63 2c f8 20  77 68 69 74 65 5f 6f 63  |te_hc,. white_oc|
0000b100  2c f8 20 62 6c 61 63 6b  5f 68 63 2c f8 20 62 6c  |,. black_hc,. bl|
0000b110  61 63 6b 5f 6f 63 29 0d  43 12 25 ea 20 70 6f 69  |ack_oc).C.%. poi|
0000b120  6e 74 2c 77 68 69 74 65  70 72 65 73 65 6e 74 2c  |nt,whitepresent,|
0000b130  62 6c 61 63 6b 70 72 65  73 65 6e 74 0d 43 1c 4b  |blackpresent.C.K|
0000b140  77 68 69 74 65 70 6f 69  6e 74 73 3d 30 3a 62 6c  |whitepoints=0:bl|
0000b150  61 63 6b 70 6f 69 6e 74  73 3d 30 3a 77 68 69 74  |ackpoints=0:whit|
0000b160  65 5f 68 63 3d 30 3a 77  68 69 74 65 5f 6f 63 3d  |e_hc=0:white_oc=|
0000b170  30 3a 62 6c 61 63 6b 5f  68 63 3d 30 3a 62 6c 61  |0:black_hc=0:bla|
0000b180  63 6b 5f 6f 63 3d 30 0d  43 26 14 e3 20 70 6f 69  |ck_oc=0.C&.. poi|
0000b190  6e 74 20 3d 20 31 20 b8  20 32 34 0d 43 30 34 77  |nt = 1 . 24.C04w|
0000b1a0  68 69 74 65 70 72 65 73  65 6e 74 20 3d 20 a4 70  |hitepresent = .p|
0000b1b0  6f 69 6e 74 70 69 65 63  65 73 28 22 77 68 69 74  |ointpieces("whit|
0000b1c0  65 22 2c 70 6f 69 6e 74  2c 62 6f 61 72 64 29 0d  |e",point,board).|
0000b1d0  43 3a 29 77 68 69 74 65  62 6c 6f 74 73 3f 70 6f  |C:)whiteblots?po|
0000b1e0  69 6e 74 20 3d 20 28 77  68 69 74 65 70 72 65 73  |int = (whitepres|
0000b1f0  65 6e 74 20 3d 20 31 29  0d 43 44 2a 77 68 69 74  |ent = 1).CD*whit|
0000b200  65 5f 63 6f 76 65 72 3f  70 6f 69 6e 74 20 3d 20  |e_cover?point = |
0000b210  28 77 68 69 74 65 70 72  65 73 65 6e 74 20 3e 20  |(whitepresent > |
0000b220  31 29 0d 43 4e 34 62 6c  61 63 6b 70 72 65 73 65  |1).CN4blackprese|
0000b230  6e 74 20 3d 20 a4 70 6f  69 6e 74 70 69 65 63 65  |nt = .pointpiece|
0000b240  73 28 22 62 6c 61 63 6b  22 2c 70 6f 69 6e 74 2c  |s("black",point,|
0000b250  62 6f 61 72 64 29 0d 43  58 29 62 6c 61 63 6b 62  |board).CX)blackb|
0000b260  6c 6f 74 73 3f 70 6f 69  6e 74 20 3d 20 28 62 6c  |lots?point = (bl|
0000b270  61 63 6b 70 72 65 73 65  6e 74 20 3d 20 31 29 0d  |ackpresent = 1).|
0000b280  43 62 2a 62 6c 61 63 6b  5f 63 6f 76 65 72 3f 70  |Cb*black_cover?p|
0000b290  6f 69 6e 74 20 3d 20 28  62 6c 61 63 6b 70 72 65  |oint = (blackpre|
0000b2a0  73 65 6e 74 20 3e 20 31  29 0d 43 6c 18 e7 20 77  |sent > 1).Cl.. w|
0000b2b0  68 69 74 65 70 72 65 73  65 6e 74 20 3e 20 30 20  |hitepresent > 0 |
0000b2c0  8c 0d 43 76 60 e7 20 70  6f 69 6e 74 3c 31 39 20  |..Cv`. point<19 |
0000b2d0  8c 20 77 68 69 74 65 70  6f 69 6e 74 73 20 2b 3d  |. whitepoints +=|
0000b2e0  20 77 68 69 74 65 70 72  65 73 65 6e 74 2a 70 6f  | whitepresent*po|
0000b2f0  69 6e 74 20 8b 20 77 68  69 74 65 70 6f 69 6e 74  |int . whitepoint|
0000b300  73 20 2b 3d 77 68 69 74  65 70 72 65 73 65 6e 74  |s +=whitepresent|
0000b310  2a 70 69 65 63 65 69 6e  68 6f 6d 65 62 6f 61 72  |*pieceinhomeboar|
0000b320  64 0d 43 80 17 e7 20 77  68 69 74 65 70 72 65 73  |d.C... whitepres|
0000b330  65 6e 74 20 3e 31 20 8c  0d 43 8a 39 e7 20 70 6f  |ent >1 ..C.9. po|
0000b340  69 6e 74 20 3e 20 31 38  20 8c 20 77 68 69 74 65  |int > 18 . white|
0000b350  5f 68 63 2b 3d 31 20 8b  20 e7 20 70 6f 69 6e 74  |_hc+=1 . . point|
0000b360  3e 31 32 20 8c 20 77 68  69 74 65 5f 6f 63 2b 3d  |>12 . white_oc+=|
0000b370  31 0d 43 94 05 cd 0d 43  9e 05 cd 0d 43 a8 18 e7  |1.C....C....C...|
0000b380  20 62 6c 61 63 6b 70 72  65 73 65 6e 74 20 3e 20  | blackpresent > |
0000b390  30 20 8c 0d 43 b2 64 e7  20 70 6f 69 6e 74 3e 36  |0 ..C.d. point>6|
0000b3a0  20 8c 20 62 6c 61 63 6b  70 6f 69 6e 74 73 20 2b  | . blackpoints +|
0000b3b0  3d 20 62 6c 61 63 6b 70  72 65 73 65 6e 74 2a 28  |= blackpresent*(|
0000b3c0  32 35 2d 70 6f 69 6e 74  29 20 8b 20 62 6c 61 63  |25-point) . blac|
0000b3d0  6b 70 6f 69 6e 74 73 20  2b 3d 62 6c 61 63 6b 70  |kpoints +=blackp|
0000b3e0  72 65 73 65 6e 74 2a 70  69 65 63 65 69 6e 68 6f  |resent*pieceinho|
0000b3f0  6d 65 62 6f 61 72 64 0d  43 bc 17 e7 20 62 6c 61  |meboard.C... bla|
0000b400  63 6b 70 72 65 73 65 6e  74 20 3e 31 20 8c 0d 43  |ckpresent >1 ..C|
0000b410  c6 38 e7 20 70 6f 69 6e  74 20 3c 20 37 20 8c 20  |.8. point < 7 . |
0000b420  62 6c 61 63 6b 5f 68 63  2b 3d 31 20 8b 20 e7 20  |black_hc+=1 . . |
0000b430  70 6f 69 6e 74 3c 31 33  20 8c 20 62 6c 61 63 6b  |point<13 . black|
0000b440  5f 6f 63 2b 3d 31 0d 43  d0 05 cd 0d 43 da 05 cd  |_oc+=1.C....C...|
0000b450  0d 43 e4 0b ed 20 70 6f  69 6e 74 0d 43 ee 05 e1  |.C... point.C...|
0000b460  0d 43 f8 04 0d 44 02 69  dd a4 62 6f 61 72 64 73  |.C...D.i..boards|
0000b470  63 6f 72 65 28 63 6f 6c  24 2c 62 6f 61 72 64 2c  |core(col$,board,|
0000b480  6d 6f 76 65 63 6f 6c 24  2c 62 61 72 77 68 69 74  |movecol$,barwhit|
0000b490  65 2c 62 61 72 62 6c 61  63 6b 2c 62 6f 61 72 64  |e,barblack,board|
0000b4a0  5f 70 6f 69 6e 74 73 2c  6f 77 6e 5f 68 63 2c 6f  |_points,own_hc,o|
0000b4b0  77 6e 5f 6f 63 2c 6f 70  70 5f 68 63 2c 6f 70 70  |wn_oc,opp_hc,opp|
0000b4c0  5f 6f 63 2c 6f 77 6e 62  6c 6f 74 73 29 0d 44 0c  |_oc,ownblots).D.|
0000b4d0  40 ea 20 70 6f 69 6e 74  2c 70 72 65 73 65 6e 74  |@. point,present|
0000b4e0  2c 73 63 6f 72 65 2c 62  6c 6f 74 73 63 6f 72 65  |,score,blotscore|
0000b4f0  2c 6e 74 72 61 70 70 69  6e 67 2c 6e 74 72 61 70  |,ntrapping,ntrap|
0000b500  70 65 64 2c 74 72 61 70  73 63 6f 72 65 0d 44 16  |ped,trapscore.D.|
0000b510  32 62 6c 6f 74 73 63 6f  72 65 3d 30 3a 6e 74 72  |2blotscore=0:ntr|
0000b520  61 70 70 65 64 3d 30 3a  6e 74 72 61 70 70 69 6e  |apped=0:ntrappin|
0000b530  67 3d 30 3a 74 72 61 70  73 63 6f 72 65 3d 30 0d  |g=0:trapscore=0.|
0000b540  44 20 49 73 63 6f 72 65  3d 62 6f 61 72 64 5f 70  |D Iscore=board_p|
0000b550  6f 69 6e 74 73 2b 6f 77  6e 5f 68 63 2a 64 6f 75  |oints+own_hc*dou|
0000b560  62 6c 65 69 6e 68 6f 6d  65 62 6f 6e 75 73 2b 6f  |bleinhomebonus+o|
0000b570  77 6e 5f 6f 63 2a 64 6f  75 62 6c 65 69 6e 6f 75  |wn_oc*doubleinou|
0000b580  74 65 72 62 6f 6e 75 73  0d 44 2a 14 e3 20 70 6f  |terbonus.D*.. po|
0000b590  69 6e 74 20 3d 20 31 20  b8 20 32 34 0d 44 34 77  |int = 1 . 24.D4w|
0000b5a0  e7 20 6f 77 6e 62 6c 6f  74 73 3f 70 6f 69 6e 74  |. ownblots?point|
0000b5b0  20 8c 20 62 6c 6f 74 73  63 6f 72 65 20 2b 3d 20  | . blotscore += |
0000b5c0  a4 62 6c 6f 74 73 63 6f  72 65 28 63 6f 6c 24 2c  |.blotscore(col$,|
0000b5d0  70 6f 69 6e 74 2c 6d 6f  76 65 63 6f 6c 24 2c 62  |point,movecol$,b|
0000b5e0  61 72 77 68 69 74 65 2c  62 61 72 62 6c 61 63 6b  |arwhite,barblack|
0000b5f0  2c 62 6f 61 72 64 2c 64  69 63 65 61 76 61 69 6c  |,board,diceavail|
0000b600  61 62 6c 65 2c 6f 70 70  5f 68 63 2c 6f 70 70 5f  |able,opp_hc,opp_|
0000b610  6f 63 29 0d 44 3e 0d c8  8e 20 63 6f 6c 24 20 ca  |oc).D>... col$ .|
0000b620  0d 44 48 0e c9 20 22 77  68 69 74 65 22 3a 0d 44  |.DH.. "white":.D|
0000b630  52 19 e7 20 77 68 69 74  65 5f 63 6f 76 65 72 3f  |R.. white_cover?|
0000b640  70 6f 69 6e 74 20 8c 0d  44 5c 10 e7 20 70 6f 69  |point ..D\.. poi|
0000b650  6e 74 3e 31 38 20 8c 0d  44 66 35 74 72 61 70 73  |nt>18 ..Df5traps|
0000b660  63 6f 72 65 2b 3d a4 74  72 61 70 62 6f 6e 75 73  |core+=.trapbonus|
0000b670  28 63 6f 6c 24 2c 70 6f  69 6e 74 2c 62 6f 61 72  |(col$,point,boar|
0000b680  64 2c 6e 74 72 61 70 70  69 6e 67 29 0d 44 70 05  |d,ntrapping).Dp.|
0000b690  cc 0d 44 7a 43 e7 20 70  6f 69 6e 74 20 3e 31 32  |..DzC. point >12|
0000b6a0  20 8c 20 74 72 61 70 73  63 6f 72 65 2b 3d a4 74  | . trapscore+=.t|
0000b6b0  72 61 70 62 6f 6e 75 73  28 63 6f 6c 24 2c 70 6f  |rapbonus(col$,po|
0000b6c0  69 6e 74 2c 62 6f 61 72  64 2c 6e 74 72 61 70 70  |int,board,ntrapp|
0000b6d0  69 6e 67 29 0d 44 84 05  cd 0d 44 8e 05 cd 0d 44  |ing).D....D....D|
0000b6e0  98 0d c9 20 22 62 6c 61  63 6b 22 0d 44 a2 19 e7  |... "black".D...|
0000b6f0  20 62 6c 61 63 6b 5f 63  6f 76 65 72 3f 70 6f 69  | black_cover?poi|
0000b700  6e 74 20 8c 0d 44 ac 10  e7 20 70 6f 69 6e 74 20  |nt ..D... point |
0000b710  3c 37 20 8c 0d 44 b6 35  74 72 61 70 73 63 6f 72  |<7 ..D.5trapscor|
0000b720  65 2b 3d a4 74 72 61 70  62 6f 6e 75 73 28 63 6f  |e+=.trapbonus(co|
0000b730  6c 24 2c 70 6f 69 6e 74  2c 62 6f 61 72 64 2c 6e  |l$,point,board,n|
0000b740  74 72 61 70 70 69 6e 67  29 0d 44 c0 05 cc 0d 44  |trapping).D....D|
0000b750  ca 43 e7 20 70 6f 69 6e  74 20 3c 31 33 20 8c 20  |.C. point <13 . |
0000b760  74 72 61 70 73 63 6f 72  65 2b 3d a4 74 72 61 70  |trapscore+=.trap|
0000b770  62 6f 6e 75 73 28 63 6f  6c 24 2c 70 6f 69 6e 74  |bonus(col$,point|
0000b780  2c 62 6f 61 72 64 2c 6e  74 72 61 70 70 69 6e 67  |,board,ntrapping|
0000b790  29 0d 44 d4 05 cd 0d 44  de 05 cd 0d 44 e8 05 cb  |).D....D....D...|
0000b7a0  0d 44 f2 36 f4 20 50 52  49 4e 54 20 54 41 42 28  |.D.6. PRINT TAB(|
0000b7b0  30 2c 70 6f 69 6e 74 29  3b 70 6f 69 6e 74 2c 70  |0,point);point,p|
0000b7c0  72 65 73 65 6e 74 2c 73  63 6f 72 65 2c 62 6c 6f  |resent,score,blo|
0000b7d0  74 73 63 6f 72 65 0d 44  fc 0b ed 20 70 6f 69 6e  |tscore.D... poin|
0000b7e0  74 0d 45 06 2c e7 20 6e  74 72 61 70 70 69 6e 67  |t.E.,. ntrapping|
0000b7f0  20 3e 34 20 8c 20 74 72  61 70 73 63 6f 72 65 20  | >4 . trapscore |
0000b800  3d 20 32 2a 74 72 61 70  73 63 6f 72 65 0d 45 10  |= 2*trapscore.E.|
0000b810  14 73 63 6f 72 65 2b 3d  74 72 61 70 73 63 6f 72  |.score+=trapscor|
0000b820  65 0d 45 1a 28 f4 20 49  46 20 63 6f 6c 24 3d 22  |e.E.(. IF col$="|
0000b830  77 68 69 74 65 22 20 54  48 45 4e 20 78 3d 30 20  |white" THEN x=0 |
0000b840  45 4c 53 45 20 78 3d 34  30 0d 45 24 1a f4 20 50  |ELSE x=40.E$.. P|
0000b850  52 49 4e 54 20 54 41 42  28 78 2c 30 29 53 50 43  |RINT TAB(x,0)SPC|
0000b860  36 30 3b 0d 45 2e 3b f4  20 50 52 49 4e 54 20 54  |60;.E.;. PRINT T|
0000b870  41 42 28 78 2c 30 29 3b  63 6f 6c 24 3b 22 20 22  |AB(x,0);col$;" "|
0000b880  3b 73 63 6f 72 65 3b 22  20 22 3b 74 72 61 70 73  |;score;" ";traps|
0000b890  63 6f 72 65 2c 6e 74 72  61 70 70 69 6e 67 0d 45  |core,ntrapping.E|
0000b8a0  38 17 3d a8 28 73 63 6f  72 65 2b 62 6c 6f 74 73  |8.=.(score+blots|
0000b8b0  63 6f 72 65 29 0d 45 42  04 0d 45 4c 33 dd a4 74  |core).EB..EL3..t|
0000b8c0  72 61 70 62 6f 6e 75 73  28 63 6f 6c 24 2c 64 6f  |rapbonus(col$,do|
0000b8d0  75 62 6c 65 70 6f 69 6e  74 2c 62 6f 61 72 64 2c  |ublepoint,board,|
0000b8e0  f8 20 6e 74 72 61 70 70  69 6e 67 29 0d 45 56 39  |. ntrapping).EV9|
0000b8f0  f4 20 61 77 61 72 64 73  20 70 6f 69 6e 74 73 20  |. awards points |
0000b900  66 6f 72 20 65 6e 65 6d  79 20 70 69 65 63 65 73  |for enemy pieces|
0000b910  20 69 6e 73 69 64 65 20  64 6f 75 62 6c 65 64 20  | inside doubled |
0000b920  70 6f 69 6e 74 0d 45 60  1e f4 20 69 6e 20 68 6f  |point.E`.. in ho|
0000b930  6d 65 20 61 6e 64 20 6f  75 74 65 72 20 62 6f 61  |me and outer boa|
0000b940  72 64 73 0d 45 6a 1f ea  20 70 6f 69 6e 74 2c 6f  |rds.Ej.. point,o|
0000b950  70 70 63 6f 6c 24 2c 62  6f 6e 75 73 2c 74 62 2c  |ppcol$,bonus,tb,|
0000b960  70 70 0d 45 74 43 e7 20  a4 70 6c 61 79 65 72 62  |pp.EtC. .playerb|
0000b970  65 61 72 69 6e 67 28 63  6f 6c 24 29 20 8c 20 74  |earing(col$) . t|
0000b980  70 20 3d 20 62 65 61 72  69 6e 67 74 72 61 70 62  |p = bearingtrapb|
0000b990  6f 6e 75 73 20 8b 20 74  70 20 3d 20 74 72 61 70  |onus . tp = trap|
0000b9a0  62 6f 6e 75 73 0d 45 7e  0b 62 6f 6e 75 73 3d 30  |bonus.E~.bonus=0|
0000b9b0  0d 45 88 36 e7 20 63 6f  6c 24 3d 22 77 68 69 74  |.E.6. col$="whit|
0000b9c0  65 22 20 8c 20 6f 70 70  63 6f 6c 24 3d 22 62 6c  |e" . oppcol$="bl|
0000b9d0  61 63 6b 22 20 8b 20 6f  70 70 63 6f 6c 24 3d 22  |ack" . oppcol$="|
0000b9e0  77 68 69 74 65 22 0d 45  92 0d c8 8e 20 63 6f 6c  |white".E.... col|
0000b9f0  24 20 ca 0d 45 9c 0e c9  20 22 77 68 69 74 65 22  |$ ..E... "white"|
0000ba00  3a 0d 45 a6 18 62 6f 6e  75 73 20 2b 3d 20 62 61  |:.E..bonus += ba|
0000ba10  72 62 6c 61 63 6b 2a 74  70 0d 45 b0 1e e3 20 70  |rblack*tp.E... p|
0000ba20  6f 69 6e 74 20 3d 20 64  6f 75 62 6c 65 70 6f 69  |oint = doublepoi|
0000ba30  6e 74 20 b8 20 32 34 0d  45 ba 30 62 6f 6e 75 73  |nt . 24.E.0bonus|
0000ba40  2b 3d 20 a4 70 6f 69 6e  74 70 69 65 63 65 73 28  |+= .pointpieces(|
0000ba50  6f 70 70 63 6f 6c 24 2c  70 6f 69 6e 74 2c 62 6f  |oppcol$,point,bo|
0000ba60  61 72 64 29 2a 74 70 0d  45 c4 0b ed 20 70 6f 69  |ard)*tp.E... poi|
0000ba70  6e 74 0d 45 ce 0e c9 20  22 62 6c 61 63 6b 22 3a  |nt.E... "black":|
0000ba80  0d 45 d8 18 62 6f 6e 75  73 20 2b 3d 20 62 61 72  |.E..bonus += bar|
0000ba90  77 68 69 74 65 2a 74 70  0d 45 e2 1d e3 20 70 6f  |white*tp.E... po|
0000baa0  69 6e 74 20 3d 20 31 20  b8 20 64 6f 75 62 6c 65  |int = 1 . double|
0000bab0  70 6f 69 6e 74 0d 45 ec  2f 62 6f 6e 75 73 2b 3d  |point.E./bonus+=|
0000bac0  a4 70 6f 69 6e 74 70 69  65 63 65 73 28 6f 70 70  |.pointpieces(opp|
0000bad0  63 6f 6c 24 2c 70 6f 69  6e 74 2c 62 6f 61 72 64  |col$,point,board|
0000bae0  29 2a 74 70 0d 45 f6 0b  ed 20 70 6f 69 6e 74 0d  |)*tp.E... point.|
0000baf0  46 00 05 cb 0d 46 0a 4b  f4 20 50 52 49 4e 54 20  |F....F.K. PRINT |
0000bb00  54 41 42 28 30 2c 30 29  3b 53 50 43 33 30 3b 54  |TAB(0,0);SPC30;T|
0000bb10  41 42 28 30 2c 30 29 3b  63 6f 6c 24 2c 64 6f 75  |AB(0,0);col$,dou|
0000bb20  62 6c 65 70 6f 69 6e 74  2c 62 6f 6e 75 73 3a 52  |blepoint,bonus:R|
0000bb30  45 50 45 41 54 20 55 4e  54 49 4c 20 47 45 54 0d  |EPEAT UNTIL GET.|
0000bb40  46 14 1d e7 20 62 6f 6e  75 73 3e 30 20 8c 20 6e  |F... bonus>0 . n|
0000bb50  74 72 61 70 70 69 6e 67  20 2b 3d 31 0d 46 1e 0a  |trapping +=1.F..|
0000bb60  3d 62 6f 6e 75 73 0d 46  28 04 0d 46 32 04 0d 46  |=bonus.F(..F2..F|
0000bb70  3c 57 dd a4 62 6c 6f 74  73 63 6f 72 65 28 63 6f  |<W..blotscore(co|
0000bb80  6c 24 2c 62 6c 6f 74 70  6f 69 6e 74 2c 6d 6f 76  |l$,blotpoint,mov|
0000bb90  65 63 6f 6c 24 2c 62 61  72 77 68 69 74 65 2c 62  |ecol$,barwhite,b|
0000bba0  61 72 62 6c 61 63 6b 2c  62 6f 61 72 64 2c 64 69  |arblack,board,di|
0000bbb0  63 65 6c 65 66 74 2c 6f  70 70 5f 68 63 2c 6f 70  |celeft,opp_hc,op|
0000bbc0  70 5f 6f 63 29 0d 46 46  38 f4 20 70 65 6e 61 6c  |p_oc).FF8. penal|
0000bbd0  74 79 20 66 6f 72 20 62  6c 6f 74 20 64 65 70 65  |ty for blot depe|
0000bbe0  6e 64 73 20 6f 6e 20 68  6f 77 20 61 64 76 61 6e  |nds on how advan|
0000bbf0  63 65 64 20 74 68 65 20  70 6f 69 6e 74 0d 46 50  |ced the point.FP|
0000bc00  33 f4 20 61 6e 64 20 68  6f 77 20 6d 61 6e 79 20  |3. and how many |
0000bc10  6f 70 70 6f 6e 65 6e 74  20 77 69 74 68 69 6e 20  |opponent within |
0000bc20  73 69 78 20 70 6f 69 6e  74 73 20 61 68 65 61 64  |six points ahead|
0000bc30  0d 46 5a 34 f4 20 61 6e  64 20 63 6f 76 65 72 69  |.FZ4. and coveri|
0000bc40  6e 67 20 6f 66 20 6f 70  70 6f 6e 65 6e 74 73 20  |ng of opponents |
0000bc50  68 6f 6d 65 20 61 6e 64  20 6f 75 74 65 72 62 6f  |home and outerbo|
0000bc60  61 72 64 73 0d 46 64 30  ea 20 62 6c 6f 74 73 63  |ards.Fd0. blotsc|
0000bc70  6f 72 65 2c 63 6f 76 65  72 61 62 6c 65 2c 70 65  |ore,coverable,pe|
0000bc80  6e 61 6c 74 79 2c 61 68  65 61 64 2c 6f 70 70 63  |nalty,ahead,oppc|
0000bc90  6f 76 65 72 0d 46 6e 12  e7 20 61 6c 6c 70 61 73  |over.Fn.. allpas|
0000bca0  74 20 8c 20 3d 30 0d 46  78 3e e7 20 63 6f 6c 24  |t . =0.Fx>. col$|
0000bcb0  20 3c 3e 20 6d 6f 76 65  63 6f 6c 24 20 84 20 64  | <> movecol$ . d|
0000bcc0  69 63 65 6c 65 66 74 20  3c 32 20 8c 20 70 65 6e  |iceleft <2 . pen|
0000bcd0  61 6c 74 79 20 3d 20 b9  20 8b 20 70 65 6e 61 6c  |alty = . . penal|
0000bce0  74 79 3d a3 0d 46 82 45  f4 20 62 6c 6f 74 73 20  |ty=..F.E. blots |
0000bcf0  61 6c 77 61 79 73 20 73  63 6f 72 65 64 20 61 73  |always scored as|
0000bd00  20 70 65 6e 61 6c 74 69  65 73 20 77 68 65 6e 20  | penalties when |
0000bd10  65 76 61 6c 75 61 74 69  6e 67 20 6f 70 70 6f 6e  |evaluating oppon|
0000bd20  65 6e 74 73 20 6d 6f 76  65 0d 46 8c 21 f4 20 6f  |ents move.F.!. o|
0000bd30  72 20 77 68 65 6e 20 70  6c 61 79 69 6e 67 20 73  |r when playing s|
0000bd40  65 63 6f 6e 64 20 64 69  63 65 0d 46 96 11 e7 20  |econd dice.F... |
0000bd50  ac 20 70 65 6e 61 6c 74  79 20 8c 0d 46 a0 4d e7  |. penalty ..F.M.|
0000bd60  20 ac 20 a4 63 6f 76 65  72 61 62 6c 65 5f 62 6c  | . .coverable_bl|
0000bd70  6f 74 28 63 6f 6c 24 2c  62 6c 6f 74 70 6f 69 6e  |ot(col$,blotpoin|
0000bd80  74 2c 62 6f 61 72 64 2c  62 61 72 62 6c 61 63 6b  |t,board,barblack|
0000bd90  2c 62 61 72 77 68 69 74  65 29 20 8c 20 70 65 6e  |,barwhite) . pen|
0000bda0  61 6c 74 79 20 3d 20 b9  0d 46 aa 05 cd 0d 46 b4  |alty = ..F....F.|
0000bdb0  3f f4 20 61 6c 73 6f 20  74 72 65 61 74 65 64 20  |?. also treated |
0000bdc0  61 73 20 70 65 6e 61 6c  74 69 65 73 20 69 66 20  |as penalties if |
0000bdd0  70 6c 61 79 69 6e 67 20  74 68 65 20 66 69 72 73  |playing the firs|
0000bde0  74 20 64 69 63 65 20 61  6e 64 20 61 0d 46 be 26  |t dice and a.F.&|
0000bdf0  f4 20 73 65 63 6f 6e 64  20 6f 6e 65 20 63 61 6e  |. second one can|
0000be00  6e 6f 74 20 63 6f 76 65  72 20 74 68 65 20 62 6c  |not cover the bl|
0000be10  6f 74 0d 46 c8 11 e7 20  ac 20 70 65 6e 61 6c 74  |ot.F... . penalt|
0000be20  79 20 8c 0d 46 d2 0d c8  8e 20 63 6f 6c 24 20 ca  |y ..F.... col$ .|
0000be30  0d 46 dc 3d c9 20 22 77  68 69 74 65 22 3a 20 62  |.F.=. "white": b|
0000be40  6c 6f 74 73 63 6f 72 65  20 3d 20 62 6c 6f 74 70  |lotscore = blotp|
0000be50  6f 73 77 65 69 67 68 74  2a 28 28 62 6c 6f 74 70  |osweight*((blotp|
0000be60  6f 69 6e 74 2d 31 29 81  20 36 29 2b 31 0d 46 e6  |oint-1). 6)+1.F.|
0000be70  40 c9 20 22 62 6c 61 63  6b 22 3a 20 62 6c 6f 74  |@. "black": blot|
0000be80  73 63 6f 72 65 20 3d 20  62 6c 6f 74 70 6f 73 77  |score = blotposw|
0000be90  65 69 67 68 74 2a 28 28  32 35 2d 62 6c 6f 74 70  |eight*((25-blotp|
0000bea0  6f 69 6e 74 2d 31 29 81  20 36 29 2b 31 0d 46 f0  |oint-1). 6)+1.F.|
0000beb0  05 cb 0d 46 fa 05 cc 0d  47 04 14 f4 20 70 65 6e  |...F....G... pen|
0000bec0  61 6c 69 73 65 20 62 6c  6f 74 73 0d 47 0e 20 6f  |alise blots.G. o|
0000bed0  70 70 63 6f 76 65 72 20  3d 20 32 2a 6f 70 70 5f  |ppcover = 2*opp_|
0000bee0  68 63 20 2b 20 6f 70 70  5f 6f 63 0d 47 18 53 61  |hc + opp_oc.G.Sa|
0000bef0  68 65 61 64 20 3d 20 a4  61 68 65 61 64 6f 66 62  |head = .aheadofb|
0000bf00  6c 6f 74 28 63 6f 6c 24  2c 62 6c 6f 74 70 6f 69  |lot(col$,blotpoi|
0000bf10  6e 74 2c 62 6f 61 72 64  2c 62 61 72 62 6c 61 63  |nt,board,barblac|
0000bf20  6b 2c 62 61 72 77 68 69  74 65 2c 6f 70 70 63 6f  |k,barwhite,oppco|
0000bf30  76 65 72 2c 62 6c 6f 74  73 63 6f 72 65 29 0d 47  |ver,blotscore).G|
0000bf40  22 05 cd 0d 47 2c 52 f4  20 56 44 55 37 3a 50 52  |"...G,R. VDU7:PR|
0000bf50  49 4e 54 20 54 41 42 28  30 2c 30 29 3b 53 50 43  |INT TAB(0,0);SPC|
0000bf60  33 30 3b 54 41 42 28 30  2c 30 29 3b 63 6f 6c 24  |30;TAB(0,0);col$|
0000bf70  2c 62 6c 6f 74 70 6f 69  6e 74 2c 62 6c 6f 74 73  |,blotpoint,blots|
0000bf80  63 6f 72 65 3a 52 45 50  45 41 54 20 55 4e 54 49  |core:REPEAT UNTI|
0000bf90  4c 20 47 45 54 0d 47 36  0e 3d 62 6c 6f 74 73 63  |L GET.G6.=blotsc|
0000bfa0  6f 72 65 0d 47 40 04 0d  47 4a 4e dd a4 61 68 65  |ore.G@..GJN..ahe|
0000bfb0  61 64 6f 66 62 6c 6f 74  28 63 6f 6c 24 2c 62 6c  |adofblot(col$,bl|
0000bfc0  6f 74 70 6f 69 6e 74 2c  62 6f 61 72 64 2c 62 61  |otpoint,board,ba|
0000bfd0  72 62 6c 61 63 6b 2c 62  61 72 77 68 69 74 65 2c  |rblack,barwhite,|
0000bfe0  6f 70 70 63 6f 76 65 72  2c f8 20 62 6c 6f 74 73  |oppcover,. blots|
0000bff0  63 6f 72 65 29 0d 47 54  30 ea 20 61 68 65 61 64  |core).GT0. ahead|
0000c000  2c 20 61 68 65 61 64 70  6f 69 6e 74 2c 70 6f 69  |, aheadpoint,poi|
0000c010  6e 74 2c 62 6c 6f 74 6e  65 67 2c 63 6f 76 65 72  |nt,blotneg,cover|
0000c020  73 63 6f 72 65 0d 47 5e  46 e7 20 28 63 6f 6c 24  |score.G^F. (col$|
0000c030  3d 22 77 68 69 74 65 22  20 80 20 62 6c 6f 74 70  |="white" . blotp|
0000c040  6f 69 6e 74 3e 31 32 29  20 84 20 28 63 6f 6c 24  |oint>12) . (col$|
0000c050  3d 22 62 6c 61 63 6b 22  20 80 20 62 6c 6f 74 70  |="black" . blotp|
0000c060  6f 69 6e 74 20 3c 31 33  29 20 8c 0d 47 68 1b 63  |oint <13) ..Gh.c|
0000c070  6f 76 65 72 73 63 6f 72  65 3d 6f 70 70 63 6f 76  |overscore=oppcov|
0000c080  65 72 20 81 20 34 0d 47  72 05 cc 0d 47 7c 10 63  |er . 4.Gr...G|.c|
0000c090  6f 76 65 72 73 63 6f 72  65 3d 30 0d 47 86 05 cd  |overscore=0.G...|
0000c0a0  0d 47 90 0d c8 8e 20 63  6f 6c 24 20 ca 0d 47 9a  |.G.... col$ ..G.|
0000c0b0  0e c9 20 22 77 68 69 74  65 22 3a 0d 47 a4 2c e7  |.. "white":.G.,.|
0000c0c0  20 62 6c 6f 74 70 6f 69  6e 74 20 3e 20 31 38 20  | blotpoint > 18 |
0000c0d0  80 20 62 61 72 62 6c 61  63 6b 3e 30 20 8c 20 61  |. barblack>0 . a|
0000c0e0  68 65 61 64 2b 3d 32 0d  47 ae 40 f4 20 70 69 65  |head+=2.G.@. pie|
0000c0f0  63 65 20 6f 6e 20 62 61  72 20 63 6f 75 6e 74 65  |ce on bar counte|
0000c100  64 20 64 6f 75 62 6c 65  20 74 6f 20 64 65 74 65  |d double to dete|
0000c110  72 20 68 69 74 74 69 6e  67 20 69 6e 20 68 6f 6d  |r hitting in hom|
0000c120  65 20 62 6f 61 72 64 0d  47 b8 3d 61 68 65 61 64  |e board.G.=ahead|
0000c130  70 6f 69 6e 74 3d 62 6c  6f 74 70 6f 69 6e 74 2b  |point=blotpoint+|
0000c140  36 3a e7 20 61 68 65 61  64 70 6f 69 6e 74 20 3e  |6:. aheadpoint >|
0000c150  32 34 20 8c 20 61 68 65  61 64 70 6f 69 6e 74 20  |24 . aheadpoint |
0000c160  3d 20 32 34 0d 47 c2 24  e3 20 70 6f 69 6e 74 20  |= 24.G.$. point |
0000c170  3d 20 62 6c 6f 74 70 6f  69 6e 74 20 b8 20 61 68  |= blotpoint . ah|
0000c180  65 61 64 70 6f 69 6e 74  0d 47 cc 34 e7 20 a4 70  |eadpoint.G.4. .p|
0000c190  6f 69 6e 74 70 69 65 63  65 73 28 22 62 6c 61 63  |ointpieces("blac|
0000c1a0  6b 22 2c 70 6f 69 6e 74  2c 62 6f 61 72 64 29 3e  |k",point,board)>|
0000c1b0  30 20 8c 20 61 68 65 61  64 2b 3d 31 0d 47 d6 0b  |0 . ahead+=1.G..|
0000c1c0  ed 20 70 6f 69 6e 74 0d  47 e0 36 e7 20 61 68 65  |. point.G.6. ahe|
0000c1d0  61 64 20 3d 20 30 20 8c  20 62 6c 6f 74 6e 65 67  |ad = 0 . blotneg|
0000c1e0  20 3d 31 20 8b 20 62 6c  6f 74 6e 65 67 20 3d 20  | =1 . blotneg = |
0000c1f0  62 6c 6f 74 6e 65 67 77  65 69 67 68 74 0d 47 ea  |blotnegweight.G.|
0000c200  3e 62 6c 6f 74 73 63 6f  72 65 3d 28 61 68 65 61  |>blotscore=(ahea|
0000c210  64 2b 63 6f 76 65 72 73  63 6f 72 65 29 2a 62 6c  |d+coverscore)*bl|
0000c220  6f 74 6e 65 67 2a 28 28  62 6c 6f 74 70 6f 69 6e  |otneg*((blotpoin|
0000c230  74 2d 31 29 20 81 20 36  29 2b 31 0d 47 f4 0e c9  |t-1) . 6)+1.G...|
0000c240  20 22 62 6c 61 63 6b 22  3a 0d 47 fe 2a e7 20 62  | "black":.G.*. b|
0000c250  6c 6f 74 70 6f 69 6e 74  20 3c 37 20 80 20 62 61  |lotpoint <7 . ba|
0000c260  72 77 68 69 74 65 3e 30  20 8c 20 61 68 65 61 64  |rwhite>0 . ahead|
0000c270  2b 3d 32 0d 48 08 3b 61  68 65 61 64 70 6f 69 6e  |+=2.H.;aheadpoin|
0000c280  74 3d 62 6c 6f 74 70 6f  69 6e 74 2d 36 3a e7 20  |t=blotpoint-6:. |
0000c290  61 68 65 61 64 70 6f 69  6e 74 20 3c 31 20 8c 20  |aheadpoint <1 . |
0000c2a0  61 68 65 61 64 70 6f 69  6e 74 20 3d 20 31 0d 48  |aheadpoint = 1.H|
0000c2b0  12 24 e3 20 70 6f 69 6e  74 20 3d 20 61 68 65 61  |.$. point = ahea|
0000c2c0  64 70 6f 69 6e 74 20 b8  20 62 6c 6f 74 70 6f 69  |dpoint . blotpoi|
0000c2d0  6e 74 0d 48 1c 34 e7 20  a4 70 6f 69 6e 74 70 69  |nt.H.4. .pointpi|
0000c2e0  65 63 65 73 28 22 77 68  69 74 65 22 2c 70 6f 69  |eces("white",poi|
0000c2f0  6e 74 2c 62 6f 61 72 64  29 3e 30 20 8c 20 61 68  |nt,board)>0 . ah|
0000c300  65 61 64 2b 3d 31 0d 48  26 0b ed 20 70 6f 69 6e  |ead+=1.H&.. poin|
0000c310  74 0d 48 30 36 e7 20 61  68 65 61 64 20 3d 20 30  |t.H06. ahead = 0|
0000c320  20 8c 20 62 6c 6f 74 6e  65 67 20 3d 31 20 8b 20  | . blotneg =1 . |
0000c330  62 6c 6f 74 6e 65 67 20  3d 20 62 6c 6f 74 6e 65  |blotneg = blotne|
0000c340  67 77 65 69 67 68 74 0d  48 3a 41 62 6c 6f 74 73  |gweight.H:Ablots|
0000c350  63 6f 72 65 3d 28 61 68  65 61 64 2b 63 6f 76 65  |core=(ahead+cove|
0000c360  72 73 63 6f 72 65 29 2a  62 6c 6f 74 6e 65 67 2a  |rscore)*blotneg*|
0000c370  28 28 32 35 2d 62 6c 6f  74 70 6f 69 6e 74 2d 31  |((25-blotpoint-1|
0000c380  29 20 81 20 36 29 2b 31  0d 48 44 05 cb 0d 48 4e  |) . 6)+1.HD...HN|
0000c390  1a 62 6c 6f 74 73 63 6f  72 65 20 3d 20 2d 62 6c  |.blotscore = -bl|
0000c3a0  6f 74 73 63 6f 72 65 0d  48 58 0a 3d 61 68 65 61  |otscore.HX.=ahea|
0000c3b0  64 0d 48 62 04 0d 48 6c  3c dd a4 63 6f 76 65 72  |d.Hb..Hl<..cover|
0000c3c0  61 62 6c 65 5f 62 6c 6f  74 28 63 6f 6c 24 2c 62  |able_blot(col$,b|
0000c3d0  6c 6f 74 70 6f 69 6e 74  2c 62 6f 61 72 64 2c 62  |lotpoint,board,b|
0000c3e0  61 72 62 6c 61 63 6b 2c  62 61 72 77 68 69 74 65  |arblack,barwhite|
0000c3f0  29 0d 48 76 3f ea 20 64  69 63 65 66 72 65 65 2c  |).Hv?. dicefree,|
0000c400  73 74 61 72 74 70 6f 69  6e 74 2c 72 6f 6c 6c 2c  |startpoint,roll,|
0000c410  70 72 65 73 65 6e 74 2c  6f 6b 2c 65 6e 64 70 6f  |present,ok,endpo|
0000c420  69 6e 74 2c 73 74 61 74  65 24 2c 64 75 6d 6d 79  |int,state$,dummy|
0000c430  0d 48 80 2c e7 20 64 69  63 65 75 73 65 64 20 3d  |.H.,. diceused =|
0000c440  20 31 20 8c 20 64 69 63  65 66 72 65 65 3d 32 20  | 1 . dicefree=2 |
0000c450  8b 20 64 69 63 65 66 72  65 65 3d 31 0d 48 8a 17  |. dicefree=1.H..|
0000c460  72 6f 6c 6c 3d 64 69 63  65 28 64 69 63 65 66 72  |roll=dice(dicefr|
0000c470  65 65 29 0d 48 94 4c e7  20 63 6f 6c 24 3d 22 77  |ee).H.L. col$="w|
0000c480  68 69 74 65 22 20 8c 20  73 74 61 72 74 70 6f 69  |hite" . startpoi|
0000c490  6e 74 20 3d 20 62 6c 6f  74 70 6f 69 6e 74 2d 72  |nt = blotpoint-r|
0000c4a0  6f 6c 6c 20 8b 20 73 74  61 72 74 70 6f 69 6e 74  |oll . startpoint|
0000c4b0  3d 62 6c 6f 74 70 6f 69  6e 74 2b 72 6f 6c 6c 0d  |=blotpoint+roll.|
0000c4c0  48 9e 26 e7 20 73 74 61  72 74 70 6f 69 6e 74 20  |H.&. startpoint |
0000c4d0  3c 30 20 84 20 73 74 61  72 74 70 6f 69 6e 74 20  |<0 . startpoint |
0000c4e0  3e 32 34 20 8c 0d 48 a8  08 6f 6b 3d a3 0d 48 b2  |>24 ..H..ok=..H.|
0000c4f0  05 cc 0d 48 bc 31 70 72  65 73 65 6e 74 20 3d 20  |...H.1present = |
0000c500  a4 70 6f 69 6e 74 70 69  65 63 65 73 28 63 6f 6c  |.pointpieces(col|
0000c510  24 2c 73 74 61 72 74 70  6f 69 6e 74 2c 62 6f 61  |$,startpoint,boa|
0000c520  72 64 29 0d 48 c6 2d e7  20 70 72 65 73 65 6e 74  |rd).H.-. present|
0000c530  20 3e 30 20 80 20 70 72  65 73 65 6e 74 20 3c 3e  | >0 . present <>|
0000c540  20 32 20 8c 20 6f 6b 3d  b9 20 8b 20 6f 6b 3d a3  | 2 . ok=. . ok=.|
0000c550  0d 48 d0 3a f4 20 69 66  20 63 6f 76 65 72 69 6e  |.H.:. if coverin|
0000c560  67 20 70 6f 69 6e 74 20  68 61 73 20 74 77 6f 20  |g point has two |
0000c570  70 69 65 63 65 73 20 74  68 65 6e 20 63 6f 76 65  |pieces then cove|
0000c580  72 69 6e 67 20 77 6f 75  6c 64 0d 48 da 14 f4 20  |ring would.H... |
0000c590  63 72 65 61 74 65 20 61  20 62 6c 6f 74 21 0d 48  |create a blot!.H|
0000c5a0  e4 05 cd 0d 48 ee 42 f4  20 49 66 20 62 6c 6f 74  |....H.B. If blot|
0000c5b0  20 63 61 6e 6e 6f 74 20  62 65 20 63 6f 76 65 72  | cannot be cover|
0000c5c0  65 64 20 74 68 65 6e 20  63 68 65 63 6b 20 69 66  |ed then check if|
0000c5d0  20 69 74 20 63 6f 75 6c  64 20 62 65 20 6d 6f 76  | it could be mov|
0000c5e0  65 20 6f 75 74 0d 48 f8  3d f4 20 6f 66 20 64 61  |e out.H.=. of da|
0000c5f0  6e 67 65 72 20 62 79 20  73 65 63 6f 6e 64 20 64  |nger by second d|
0000c600  69 63 65 2e 20 54 68 65  20 64 65 73 74 69 6e 61  |ice. The destina|
0000c610  74 69 6f 6e 20 70 6f 69  6e 74 20 6d 75 73 74 20  |tion point must |
0000c620  62 65 0d 49 02 30 f4 20  69 6e 20 74 68 65 20 73  |be.I.0. in the s|
0000c630  61 6d 65 20 73 74 61 74  65 20 61 73 20 69 6e 20  |ame state as in |
0000c640  6e 65 77 62 6f 61 72 64  20 61 6e 64 20 62 6f 61  |newboard and boa|
0000c650  72 64 0d 49 0c 0c e7 20  ac 20 6f 6b 20 8c 0d 49  |rd.I... . ok ..I|
0000c660  16 6a e7 20 63 6f 6c 24  3d 22 77 68 69 74 65 22  |.j. col$="white"|
0000c670  20 8c 20 65 6e 64 70 6f  69 6e 74 20 3d 20 62 6c  | . endpoint = bl|
0000c680  6f 74 70 6f 69 6e 74 2b  72 6f 6c 6c 3a 6f 70 70  |otpoint+roll:opp|
0000c690  63 6f 6c 24 3d 22 62 6c  61 63 6b 22 20 8b 20 65  |col$="black" . e|
0000c6a0  6e 64 70 6f 69 6e 74 20  3d 20 62 6c 6f 74 70 6f  |ndpoint = blotpo|
0000c6b0  69 6e 74 2d 72 6f 6c 6c  3a 6f 70 70 63 6f 6c 24  |int-roll:oppcol$|
0000c6c0  3d 22 62 6c 61 63 6b 22  0d 49 20 20 e7 20 65 6e  |="black".I  . en|
0000c6d0  64 70 6f 69 6e 74 3c 30  20 84 20 65 6e 64 70 6f  |dpoint<0 . endpo|
0000c6e0  69 6e 74 3e 32 34 20 8c  0d 49 2a 0a 6f 6b 20 3d  |int>24 ..I*.ok =|
0000c6f0  20 a3 0d 49 34 05 cc 0d  49 3e 20 73 74 61 74 65  | ..I4...I> state|
0000c700  24 3d a4 70 6f 69 6e 74  73 74 61 74 65 28 65 6e  |$=.pointstate(en|
0000c710  64 70 6f 69 6e 74 29 0d  49 48 1d e7 20 c2 73 74  |dpoint).IH.. .st|
0000c720  61 74 65 24 2c 35 29 3d  6f 70 70 63 6f 6c 24 20  |ate$,5)=oppcol$ |
0000c730  8c 20 3d b9 0d 49 52 68  e7 20 73 74 61 74 65 24  |. =..IRh. state$|
0000c740  3d 22 65 6d 70 74 79 22  20 84 20 73 74 61 74 65  |="empty" . state|
0000c750  24 3d 63 6f 6c 24 20 8c  20 6f 6b 20 3d 20 ac 20  |$=col$ . ok = . |
0000c760  a4 61 68 65 61 64 6f 66  62 6c 6f 74 28 63 6f 6c  |.aheadofblot(col|
0000c770  24 2c 62 6c 6f 74 70 6f  69 6e 74 2c 62 6f 61 72  |$,blotpoint,boar|
0000c780  64 2c 62 61 72 62 6c 61  63 6b 2c 62 61 72 77 68  |d,barblack,barwh|
0000c790  69 74 65 2c 30 2c 64 75  6d 6d 79 29 0d 49 5c 05  |ite,0,dummy).I\.|
0000c7a0  cd 0d 49 66 05 cd 0d 49  70 07 3d 6f 6b 0d 49 7a  |..If...Ip.=ok.Iz|
0000c7b0  04 0d 49 84 23 dd a4 70  6f 69 6e 74 70 69 65 63  |..I.#..pointpiec|
0000c7c0  65 73 28 63 6f 6c 24 2c  70 6f 69 6e 74 2c 62 6f  |es(col$,point,bo|
0000c7d0  61 72 64 29 0d 49 8e 0c  ea 20 70 69 65 63 65 73  |ard).I... pieces|
0000c7e0  0d 49 98 18 70 69 65 63  65 73 20 3d 20 62 6f 61  |.I..pieces = boa|
0000c7f0  72 64 3f 70 6f 69 6e 74  0d 49 a2 15 e7 20 70 69  |rd?point.I... pi|
0000c800  65 63 65 73 20 3d 20 30  20 8c 20 3d 30 0d 49 ac  |eces = 0 . =0.I.|
0000c810  0d c8 8e 20 63 6f 6c 24  20 ca 0d 49 b6 0e c9 20  |... col$ ..I... |
0000c820  22 77 68 69 74 65 22 3a  0d 49 c0 21 e7 20 70 69  |"white":.I.!. pi|
0000c830  65 63 65 73 20 3e 31 32  38 20 8c 20 3d 30 20 8b  |eces >128 . =0 .|
0000c840  20 3d 20 70 69 65 63 65  73 0d 49 ca 0e c9 20 22  | = pieces.I... "|
0000c850  62 6c 61 63 6b 22 3a 0d  49 d4 27 e7 20 70 69 65  |black":.I.'. pie|
0000c860  63 65 73 20 3c 31 32 39  20 8c 20 3d 30 20 8b 20  |ces <129 . =0 . |
0000c870  3d 20 70 69 65 63 65 73  20 83 20 31 32 38 0d 49  |= pieces . 128.I|
0000c880  de 05 cb 0d 49 e8 04 0d  49 f2 04 0d 49 fc 15 dd  |....I...I...I...|
0000c890  f2 69 6e 69 74 5f 77 65  69 67 68 74 69 6e 67 73  |.init_weightings|
0000c8a0  0d 4a 06 33 f4 20 73 69  67 6e 65 64 20 66 6f 72  |.J.3. signed for|
0000c8b0  20 70 6c 61 79 65 72 20  6f 66 20 63 75 72 72 65  | player of curre|
0000c8c0  6e 74 20 63 6f 6c 6f 75  72 2c 20 6f 70 70 6f 6e  |nt colour, oppon|
0000c8d0  65 6e 74 0d 4a 10 28 f4  20 70 69 65 63 65 73 20  |ent.J.(. pieces |
0000c8e0  73 63 6f 72 65 64 20 61  73 20 6e 65 67 61 74 69  |scored as negati|
0000c8f0  6f 6e 20 6f 66 20 74 68  65 73 65 0d 4a 1a 27 f4  |on of these.J.'.|
0000c900  20 61 6c 74 65 72 20 74  68 65 73 65 20 74 6f 20  | alter these to |
0000c910  74 77 65 61 6b 20 74 68  65 20 73 74 72 61 74 65  |tweak the strate|
0000c920  67 79 0d 4a 24 14 70 6c  61 79 65 72 77 69 6e 73  |gy.J$.playerwins|
0000c930  20 3d 20 39 39 39 0d 4a  2e 19 70 69 65 63 65 69  | = 999.J..piecei|
0000c940  6e 68 6f 6d 65 62 6f 61  72 64 20 3d 20 31 39 0d  |nhomeboard = 19.|
0000c950  4a 38 35 70 69 65 63 65  69 6e 61 77 61 79 62 6f  |J85pieceinawaybo|
0000c960  61 72 64 20 3d 20 2d 32  3a 20 f4 20 69 65 20 6f  |ard = -2: . ie o|
0000c970  70 70 6f 6e 65 6e 74 27  73 20 68 6f 6d 65 20 62  |pponent's home b|
0000c980  6f 61 72 64 0d 4a 42 16  70 69 65 63 65 6f 66 66  |oard.JB.pieceoff|
0000c990  62 6f 61 72 64 20 3d 20  33 30 0d 4a 4c 13 70 69  |board = 30.JL.pi|
0000c9a0  65 63 65 6f 6e 62 61 72  20 3d 20 2d 35 0d 4a 56  |eceonbar = -5.JV|
0000c9b0  17 64 6f 75 62 6c 65 69  6e 68 6f 6d 65 62 6f 6e  |.doubleinhomebon|
0000c9c0  75 73 3d 33 0d 4a 60 18  64 6f 75 62 6c 65 69 6e  |us=3.J`.doublein|
0000c9d0  6f 75 74 65 72 62 6f 6e  75 73 3d 32 0d 4a 6a 40  |outerbonus=2.Jj@|
0000c9e0  74 72 61 70 62 6f 6e 75  73 20 3d 20 31 20 20 20  |trapbonus = 1   |
0000c9f0  20 20 20 20 20 3a f4 20  62 6f 6e 75 73 20 66 6f  |     :. bonus fo|
0000ca00  72 20 70 69 65 63 65 20  69 6e 73 69 64 65 20 64  |r piece inside d|
0000ca10  6f 75 62 6c 65 64 20 70  6f 69 6e 74 0d 4a 74 3c  |oubled point.Jt<|
0000ca20  62 65 61 72 69 6e 67 74  72 61 70 62 6f 6e 75 73  |bearingtrapbonus|
0000ca30  20 3d 20 32 2e 35 20 3a  f4 20 61 73 20 61 62 6f  | = 2.5 :. as abo|
0000ca40  76 65 20 77 68 65 6e 20  61 6c 73 6f 20 62 65 61  |ve when also bea|
0000ca50  72 69 6e 67 20 6f 66 66  0d 4a 7e 19 64 6f 75 62  |ring off.J~.doub|
0000ca60  6c 65 5f 74 68 72 65 73  68 6f 6c 64 20 3d 20 33  |le_threshold = 3|
0000ca70  30 0d 4a 88 43 f4 20 73  69 6e 63 65 20 61 6c 6c  |0.J.C. since all|
0000ca80  20 70 69 65 63 65 73 20  73 63 6f 72 65 20 66 6f  | pieces score fo|
0000ca90  72 20 68 6f 77 20 61 64  76 61 6e 63 65 64 20 74  |r how advanced t|
0000caa0  68 65 79 20 61 72 65 20  6f 6e 20 74 68 65 20 62  |hey are on the b|
0000cab0  6f 61 72 64 0d 4a 92 43  f4 20 68 69 74 74 69 6e  |oard.J.C. hittin|
0000cac0  67 20 61 6e 64 20 61 64  76 61 6e 63 65 64 20 70  |g and advanced p|
0000cad0  69 65 63 65 20 61 75 74  6f 6d 61 74 69 63 61 6c  |iece automatical|
0000cae0  6c 79 20 69 6e 63 75 72  73 20 61 20 73 75 62 73  |ly incurs a subs|
0000caf0  74 61 6e 74 69 61 6c 0d  4a 9c 0d f4 20 62 65 6e  |tantial.J... ben|
0000cb00  65 66 69 74 0d 4a a6 15  62 6c 6f 74 6e 65 67 77  |efit.J..blotnegw|
0000cb10  65 69 67 68 74 20 3d 20  32 0d 4a b0 15 62 6c 6f  |eight = 2.J..blo|
0000cb20  74 70 6f 73 77 65 69 67  68 74 20 3d 20 32 0d 4a  |tposweight = 2.J|
0000cb30  ba 05 e1 0d 4a c4 04 0d  4a ce 18 dd f2 61 6c 6c  |....J...J....all|
0000cb40  70 61 73 74 5f 77 65 69  67 68 74 69 6e 67 73 0d  |past_weightings.|
0000cb50  4a d8 32 f4 20 77 65 69  67 68 74 69 6e 67 73 20  |J.2. weightings |
0000cb60  72 65 73 65 74 20 77 68  65 6e 20 70 69 65 63 65  |reset when piece|
0000cb70  73 20 70 61 73 73 20 65  61 63 68 20 6f 74 68 65  |s pass each othe|
0000cb80  72 0d 4a e2 19 70 69 65  63 65 69 6e 68 6f 6d 65  |r.J..pieceinhome|
0000cb90  62 6f 61 72 64 20 3d 20  33 30 0d 4a ec 16 70 69  |board = 30.J..pi|
0000cba0  65 63 65 6f 66 66 62 6f  61 72 64 20 3d 20 35 30  |eceoffboard = 50|
0000cbb0  0d 4a f6 05 e1 0d 4b 00  04 0d 4b 0a 1e dd f2 66  |.J....K...K....f|
0000cbc0  69 6e 64 5f 6f 70 65 6e  69 6e 67 5f 6d 6f 76 65  |ind_opening_move|
0000cbd0  73 28 63 6f 6c 24 29 0d  4b 14 1d ea 20 6d 6f 76  |s(col$).K... mov|
0000cbe0  65 73 2c 6e 2c 69 2c 6a  2c 64 69 63 65 31 2c 64  |es,n,i,j,dice1,d|
0000cbf0  69 63 65 32 0d 4b 1e 1f  64 69 63 65 31 3d 64 69  |ice2.K..dice1=di|
0000cc00  63 65 28 31 29 3a 64 69  63 65 32 3d 64 69 63 65  |ce(1):dice2=dice|
0000cc10  28 32 29 0d 4b 28 0b 6d  6f 76 65 73 3d 30 0d 4b  |(2).K(.moves=0.K|
0000cc20  32 0e f5 3a 6d 6f 76 65  73 2b 3d 31 0d 4b 3c 43  |2..:moves+=1.K<C|
0000cc30  fd 20 64 69 63 65 31 20  3d 20 6f 70 65 6e 69 6e  |. dice1 = openin|
0000cc40  67 5f 6d 6f 76 65 73 28  31 2c 6d 6f 76 65 73 29  |g_moves(1,moves)|
0000cc50  20 80 20 64 69 63 65 32  3d 6f 70 65 6e 69 6e 67  | . dice2=opening|
0000cc60  5f 6d 6f 76 65 73 28 32  2c 6d 6f 76 65 73 29 0d  |_moves(2,moves).|
0000cc70  4b 46 0e e7 20 64 6f 75  62 6c 65 20 8c 0d 4b 50  |KF.. double ..KP|
0000cc80  0d e3 20 69 3d 31 20 b8  20 34 0d 4b 5a 0a c8 8e  |.. i=1 . 4.KZ...|
0000cc90  20 69 20 ca 0d 4b 64 0e  c9 20 31 2c 32 3a 20 6a  | i ..Kd.. 1,2: j|
0000cca0  3d 33 0d 4b 6e 0e c9 20  33 2c 34 3a 20 6a 3d 34  |=3.Kn.. 3,4: j=4|
0000ccb0  0d 4b 78 05 cb 0d 4b 82  3b 6f 70 65 6e 69 6e 67  |.Kx...K.;opening|
0000ccc0  73 28 69 29 3d a4 6f 70  65 6e 69 6e 67 5f 70 6f  |s(i)=.opening_po|
0000ccd0  69 6e 74 28 6f 70 65 6e  69 6e 67 5f 6d 6f 76 65  |int(opening_move|
0000cce0  73 28 6a 2c 6d 6f 76 65  73 29 2c 63 6f 6c 24 29  |s(j,moves),col$)|
0000ccf0  0d 4b 8c 22 f4 20 50 52  49 4e 54 20 54 41 42 28  |.K.". PRINT TAB(|
0000cd00  30 2c 69 29 3b 69 2c 6f  70 65 6e 69 6e 67 73 28  |0,i);i,openings(|
0000cd10  69 29 0d 4b 96 07 ed 20  69 0d 4b a0 05 cc 0d 4b  |i).K... i.K....K|
0000cd20  aa 0d e3 20 69 3d 31 20  b8 20 32 0d 4b b4 3d 6f  |... i=1 . 2.K.=o|
0000cd30  70 65 6e 69 6e 67 73 28  69 29 3d a4 6f 70 65 6e  |penings(i)=.open|
0000cd40  69 6e 67 5f 70 6f 69 6e  74 28 6f 70 65 6e 69 6e  |ing_point(openin|
0000cd50  67 5f 6d 6f 76 65 73 28  69 2b 32 2c 6d 6f 76 65  |g_moves(i+2,move|
0000cd60  73 29 2c 63 6f 6c 24 29  0d 4b be 22 f4 20 50 52  |s),col$).K.". PR|
0000cd70  49 4e 54 20 54 41 42 28  30 2c 69 29 3b 69 2c 6f  |INT TAB(0,i);i,o|
0000cd80  70 65 6e 69 6e 67 73 28  69 29 0d 4b c8 07 ed 20  |penings(i).K... |
0000cd90  69 0d 4b d2 05 cd 0d 4b  dc 05 e1 0d 4b e6 04 0d  |i.K....K....K...|
0000cda0  4b f0 1f dd a4 6f 70 65  6e 69 6e 67 5f 70 6f 69  |K....opening_poi|
0000cdb0  6e 74 28 70 6f 69 6e 74  2c 63 6f 6c 24 29 0d 4b  |nt(point,col$).K|
0000cdc0  fa 14 e7 20 63 6f 6c 24  3d 22 62 6c 61 63 6b 22  |... col$="black"|
0000cdd0  20 8c 0d 4c 04 0f 3d 28  32 35 2d 70 6f 69 6e 74  | ..L..=(25-point|
0000cde0  29 0d 4c 0e 05 cc 0d 4c  18 0a 3d 70 6f 69 6e 74  |).L....L..=point|
0000cdf0  0d 4c 22 05 cd 0d 4c 2c  04 0d 4c 36 18 dd f2 69  |.L"...L,..L6...i|
0000ce00  6e 69 74 5f 6f 70 65 6e  69 6e 67 5f 6d 6f 76 65  |nit_opening_move|
0000ce10  73 0d 4c 40 0c ea 20 6d  6f 76 65 2c 69 0d 4c 4a  |s.L@.. move,i.LJ|
0000ce20  0a f7 20 8d 70 5a 4c 0d  4c 54 25 de 20 6f 70 65  |.. .pZL.LT%. ope|
0000ce30  6e 69 6e 67 5f 6d 6f 76  65 73 28 34 2c 32 31 29  |ning_moves(4,21)|
0000ce40  2c 6f 70 65 6e 69 6e 67  73 28 34 29 0d 4c 5e 11  |,openings(4).L^.|
0000ce50  e3 20 6d 6f 76 65 3d 31  20 b8 20 32 31 0d 4c 68  |. move=1 . 21.Lh|
0000ce60  0d e3 20 69 3d 31 20 b8  20 34 0d 4c 72 1b f3 20  |.. i=1 . 4.Lr.. |
0000ce70  6f 70 65 6e 69 6e 67 5f  6d 6f 76 65 73 28 69 2c  |opening_moves(i,|
0000ce80  6d 6f 76 65 29 0d 4c 7c  07 ed 20 69 0d 4c 86 0a  |move).L|.. i.L..|
0000ce90  ed 20 6d 6f 76 65 0d 4c  90 05 e1 0d 4c 9a 0f dc  |. move.L....L...|
0000cea0  20 33 2c 31 2c 31 37 2c  31 39 0d 4c a4 0f dc 20  | 3,1,17,19.L... |
0000ceb0  36 2c 31 2c 31 32 2c 31  37 0d 4c ae 0f dc 20 34  |6,1,12,17.L... 4|
0000cec0  2c 32 2c 31 37 2c 31 39  0d 4c b8 0f dc 20 35 2c  |,2,17,19.L... 5,|
0000ced0  33 2c 31 37 2c 31 39 0d  4c c2 0d dc 20 36 2c 35  |3,17,19.L... 6,5|
0000cee0  2c 31 2c 37 0d 4c cc 0d  dc 20 36 2c 34 2c 31 2c  |,1,7.L... 6,4,1,|
0000cef0  37 0d 4c d6 0d dc 20 36  2c 33 2c 31 2c 37 0d 4c  |7.L... 6,3,1,7.L|
0000cf00  e0 0f dc 20 36 2c 32 2c  31 32 2c 31 38 0d 4c ea  |... 6,2,12,18.L.|
0000cf10  0f dc 20 35 2c 31 2c 31  32 2c 31 39 0d 4c f4 0f  |.. 5,1,12,19.L..|
0000cf20  dc 20 34 2c 31 2c 31 32  2c 31 39 0d 4c fe 0f dc  |. 4,1,12,19.L...|
0000cf30  20 32 2c 31 2c 31 32 2c  31 39 0d 4d 08 0f dc 20  | 2,1,12,19.M... |
0000cf40  35 2c 34 2c 31 32 2c 31  32 0d 4d 12 0f dc 20 35  |5,4,12,12.M... 5|
0000cf50  2c 32 2c 31 32 2c 31 32  0d 4d 1c 0f dc 20 34 2c  |,2,12,12.M... 4,|
0000cf60  33 2c 31 32 2c 31 32 0d  4d 26 0f dc 20 33 2c 32  |3,12,12.M&.. 3,2|
0000cf70  2c 31 32 2c 31 32 0d 4d  30 0e dc 20 36 2c 36 2c  |,12,12.M0.. 6,6,|
0000cf80  31 2c 31 32 0d 4d 3a 0f  dc 20 35 2c 35 2c 31 32  |1,12.M:.. 5,5,12|
0000cf90  2c 31 37 0d 4d 44 0e dc  20 34 2c 34 2c 31 2c 31  |,17.MD.. 4,4,1,1|
0000cfa0  32 0d 4d 4e 0f dc 20 33  2c 33 2c 31 37 2c 31 39  |2.MN.. 3,3,17,19|
0000cfb0  0d 4d 58 0f dc 20 32 2c  32 2c 31 32 2c 31 39 0d  |.MX.. 2,2,12,19.|
0000cfc0  4d 62 0f dc 20 31 2c 31  2c 31 37 2c 31 39 0d 4d  |Mb.. 1,1,17,19.M|
0000cfd0  6c 04 0d 4d 76 04 0d 4d  80 1e f4 20 45 6e 64 20  |l..Mv..M... End |
0000cfe0  6f 66 20 63 6f 6d 70 75  74 65 72 20 73 74 72 61  |of computer stra|
0000cff0  74 65 67 79 0d 4d 8a 1e  f4 20 3d 3d 3d 3d 3d 3d  |tegy.M... ======|
0000d000  3d 3d 3d 3d 3d 3d 3d 3d  3d 3d 3d 3d 3d 3d 3d 3d  |================|
0000d010  3d 3d 0d 4d 94 04 0d 4d  9e 04 0d 4d a8 19 dd f2  |==.M...M...M....|
0000d020  73 77 69 74 63 68 5f 64  69 73 70 6c 61 79 5f 62  |switch_display_b|
0000d030  61 6e 6b 0d 4d b2 36 e7  20 64 69 73 70 6c 61 79  |ank.M.6. display|
0000d040  5f 62 61 6e 6b 3d 31 20  8c 20 64 69 73 70 6c 61  |_bank=1 . displa|
0000d050  79 5f 62 61 6e 6b 3d 32  20 8b 20 64 69 73 70 6c  |y_bank=2 . displ|
0000d060  61 79 5f 62 61 6e 6b 3d  31 0d 4d bc 06 c8 96 0d  |ay_bank=1.M.....|
0000d070  4d c6 1d ff 20 22 46 58  20 31 31 33 2c 22 2b c3  |M... "FX 113,"+.|
0000d080  64 69 73 70 6c 61 79 5f  62 61 6e 6b 0d 4d d0 05  |display_bank.M..|
0000d090  e1 0d 4d da 04 0d 4d e4  18 dd f2 73 77 69 74 63  |..M...M....switc|
0000d0a0  68 5f 75 70 64 61 74 65  5f 62 61 6e 6b 0d 4d ee  |h_update_bank.M.|
0000d0b0  33 e7 20 75 70 64 61 74  65 5f 62 61 6e 6b 3d 31  |3. update_bank=1|
0000d0c0  20 8c 20 75 70 64 61 74  65 5f 62 61 6e 6b 3d 32  | . update_bank=2|
0000d0d0  20 8b 20 75 70 64 61 74  65 5f 62 61 6e 6b 3d 31  | . update_bank=1|
0000d0e0  0d 4d f8 06 c8 96 0d 4e  02 1c ff 20 22 46 58 20  |.M.....N... "FX |
0000d0f0  31 31 32 2c 22 2b c3 75  70 64 61 74 65 5f 62 61  |112,"+.update_ba|
0000d100  6e 6b 0d 4e 0c 05 e1 0d  4e 16 04 0d 4e 20 17 dd  |nk.N....N...N ..|
0000d110  f2 73 68 61 64 6f 77 5f  62 6f 78 28 62 6f 78 28  |.shadow_box(box(|
0000d120  29 29 0d 4e 2a 29 f4 20  43 6f 70 79 20 73 63 72  |)).N*). Copy scr|
0000d130  65 65 6e 20 61 72 65 61  20 69 6e 74 6f 20 73 68  |een area into sh|
0000d140  61 64 6f 77 20 73 63 72  65 65 6e 0d 4e 34 1a f2  |adow screen.N4..|
0000d150  67 72 61 62 62 6f 78 28  62 6f 78 28 29 2c 22 74  |grabbox(box(),"t|
0000d160  65 6d 70 22 29 0d 4e 3e  17 f2 73 77 69 74 63 68  |emp").N>..switch|
0000d170  5f 75 70 64 61 74 65 5f  62 61 6e 6b 0d 4e 48 1d  |_update_bank.NH.|
0000d180  f2 72 65 73 74 6f 72 65  62 6f 78 28 62 6f 78 28  |.restorebox(box(|
0000d190  29 2c 22 74 65 6d 70 22  29 0d 4e 52 17 f2 73 77  |),"temp").NR..sw|
0000d1a0  69 74 63 68 5f 75 70 64  61 74 65 5f 62 61 6e 6b  |itch_update_bank|
0000d1b0  0d 4e 5c 05 e1 0d 4e 66  04 0d ff                 |.N\...Nf...|
0000d1bb