Home » Personal collection » Acorn hard disk » games » !Ludo » !RunImage

!RunImage

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

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

Tape/disk: Home » Personal collection » Acorn hard disk » games » !Ludo
Filename: !RunImage
Read OK:
File size: 6E78 bytes
Load address: 0000
Exec address: 0000
File contents
   10REM <Ludo$Dir>.!RunImage
   20REM Desktop Ludo Game
   30REM LEN A.L. Stoner
   40REM v1.21 (25/03/94)
   50:
   60ON ERROR PROCError(REPORT$+" at line "+STR$(ERL)):END
   70:
   80PROCInit
   90PROCLoadData
  100PROCLoadTemplates
  110PROCCreateMenus
  120PROCIconbarIcon
  130PROCNewGame
  140PROCPollLoop
  150:
  160END
  170:
  180DEFPROCError(error$)
  190  SYS "Wimp_CommandWindow",-1
  200  !errblk%=ERR: $(errblk%+4)=error$+CHR$(0)
  210  SYS "Wimp_ReportError",errblk%,1,app_name$
  220ENDPROC
  230:
  240DEFPROCInit
  250  DIM block% &8000, errblk% &100, buffer% &1600
  260  DIM indbuff% &600, handles% &2000
  270  DIM IconMenu% &200, MainMenu% &200
  280  DIM spritearea 9*1024
  290
  300  DIM icon(3,58)  : REM colour,position
  310  red=0:blue=1:yellow=2:green=3
  320
  330  FOR pos=1 TO 58:icon(red,pos)=pos:NEXT pos
  340
  350  FOR pos=01 TO 39:icon(blue,pos)=pos+13:NEXT pos
  360  FOR pos=40 TO 52:icon(blue,pos)=pos-39:NEXT pos
  370  FOR pos=53 TO 58:icon(blue,pos)=pos+6:NEXT pos
  380
  390  FOR pos=01 TO 26:icon(yellow,pos)=pos+26:NEXT pos
  400  FOR pos=27 TO 52:icon(yellow,pos)=pos-26:NEXT pos
  410  FOR pos=53 TO 58:icon(yellow,pos)=pos+12:NEXT pos
  420
  430  FOR pos=01 TO 13:icon(green,pos)=pos+39:NEXT pos
  440  FOR pos=14 TO 52:icon(green,pos)=pos-13:NEXT pos
  450  FOR pos=53 TO 58:icon(green,pos)=pos+18:NEXT pos
  460
  470  DIM red(3)
  480  DIM blue(3)
  490  DIM yellow(3)
  500  DIM green(3)
  510
  520  DIM name$(3)
  530  DIM PlayerType(3)
  540  Human=1:Computer=2
  550  NumPlayers=4:AllHome=0
  560
  570  drag%=TRUE
  580
  590  app_name$="Desktop Ludo"
  600  $block%="TASK"
  610  SYS "Wimp_Initialise",200,!block%,app_name$ TO version%,task%
  620  grey%=&400000
  630  black%=&FFBFFFFF
  640  on=1
  650  off=0
  660ENDPROC
  670:
  680DEFPROCLoadData
  690
  700REM routine to load any data needed
  710
  720  spritearea!0=(9*1024)  : REM size of sprite area
  730  spritearea!8=16        : REM offset to first sprite
  740  SYS "OS_SpriteOp",256+9,spritearea  : REM set up user sprite area
  750  SYS "OS_SpriteOp",256+10,spritearea,"<Ludo$Dir>.Sprites"
  760
  770ENDPROC
  780:
  790DEFPROCLoadTemplates
  800REM Load window templates
  810
  820  SYS "Wimp_OpenTemplate",,"<Ludo$Dir>.Templates"
  830  players%=FNtwindow("Players")
  840  main%=FNtwindow("Main")
  850  dice%=FNtwindow("Dice")
  860  results%=FNtwindow("Results")
  870  proginfo%=FNtwindow("ProgInfo")
  880  savebox%=FNtwindow("SaveBox")
  890  SYS "Wimp_CloseTemplate"
  900ENDPROC
  910:
  920DEFFNtwindow(win$)
  930REM create windows
  940
  950  buffend%=buffer%+&1600
  960  SYS "Wimp_LoadTemplate",,block%,buffer%,buffend%,-1,win$ TO ,,buffer%
  970  block%!64=spritearea   : REM use user sprite area for window
  980  SYS "Wimp_CreateWindow",,block% TO han%
  990=han%
 1000:
 1010DEFPROCIconbarIcon
 1020REM Put Icon on Icon Bar
 1030
 1040  LOCAL ssx%,ssy%,ssm%,px%,py%
 1050  SYS "Wimp_SpriteOp",40,,"!Ludo" TO ,,,ssx%,ssy%,,ssm%
 1060  SYS "OS_ReadModeVariable",ssm%,4 TO ,,px%: ssx%=ssx%<<px%
 1070  SYS "OS_ReadModeVariable",ssm%,5 TO ,,py%: ssy%=ssy%<<py%
 1080  :
 1090  block%!0=-1:block%!4=0:block%!8=0
 1100  block%!12=block%!4+ssx%+10:block%!16=20+ssy%
 1110  block%!20=&3002
 1120  $(block%+24)="!Ludo"
 1130  SYS "Wimp_CreateIcon",,block% TO ihandle%
 1140ENDPROC
 1150:
 1160DEFPROCCreateMenus
 1170REM Create Menus
 1180
 1190  PROCDrawMenu(IconMenu%,"Ludo,Info,New Game,Quit")
 1200  IconMenu%!16=8*16+12
 1210  IconMenu%!((24*1)+8)=proginfo%
 1220
 1230  PROCDrawMenu(MainMenu%,"Ludo,Save,New Game")
 1240  MainMenu%!16=8*16+12
 1250  MainMenu%!((24*1)+8)=savebox%
 1260
 1270ENDPROC
 1280:
 1290DEFPROCDrawMenu(menu%,menu$)
 1300  menu%?12=7:menu%?13=2:menu%?14=7:menu%?15=0
 1310  menu%!16=INSTR(menu$,",")*16+12:menu%!20=44:menu%!24=0:ptr%=menu%+28
 1320  $menu%=LEFT$(menu$,INSTR(menu$,",")-1):menu$+=",":entries%=0
 1330  WHILE menu$<>""
 1340    menu$=MID$(menu$,INSTR(menu$,",")+1)
 1350    IF menu$<>"" THEN
 1360      !ptr%=0:ptr%!4=-1
 1370      ptr%!8=&7000021
 1380      $(ptr%+12)=LEFT$(menu$,INSTR(menu$,",")-1)
 1390      ptr%+=24:entries%+=1
 1400    ENDIF
 1410  ENDWHILE
 1420  ptr%!-24=ptr%!-24 OR &80
 1430ENDPROC
 1440:
 1450DEFPROCMouseClick
 1460  CASE block%!12 OF
 1470    WHEN -2       : PROCIconMouse  :REM If button pressed over icon bar icon
 1480    WHEN players%
 1490      IF (block%!8 AND 2)=0 AND block%!16=12 THEN PROCplayers
 1500                                    REM If button pressed over player window
 1510    WHEN main%    : PROCmain       :REM If button pressed over main window
 1520    WHEN dice%    : IF PlayerType(turn)=Human THEN PROCdice
 1530                                    REM If button pressed over dice window
 1540    WHEN savebox% : PROCsave       :REM If button pressed over save window
 1550  ENDCASE
 1560ENDPROC
 1570:
 1580DEFPROCIconMouse
 1590REM If Menu button pressed draw icon bar menu
 1600REM if Select or Adjust pressed draw main window
 1610
 1620  IF block%!8 AND 2 THEN
 1630    x%=!block%
 1640    SYS "Wimp_CreateMenu",,IconMenu%,x%-64,96+132:menflag%=1
 1650  ELSE
 1660    IF started=FALSE THEN
 1670      PROCOpenWindow(players%)
 1680    ELSE
 1690      PROCOpenWindow(main%)
 1700      IF AllHome<NumPlayers THEN PROCOpenWindow(dice%)
 1710      IF AllHome>0 THEN PROCOpenWindow(results%)
 1720    ENDIF
 1730  ENDIF
 1740ENDPROC
 1750:
 1760DEFPROCplayers
 1770
 1780  NumPlayers=0
 1790  FOR player=0 TO 3
 1800    name$(player)=FNGetIconText(players%,player)
 1810    PlayerType(player)=FNPlayerState(player)
 1820    IF PlayerType(player)<>0 THEN NumPlayers+=1
 1830  NEXT player
 1840  IF NumPlayers=0 THEN PROCError("You must have at least one player !"):ENDPROC
 1850  PROCInitBoard
 1860  started=TRUE
 1870  turn=red
 1880  IF PlayerType(turn)=FALSE THEN REPEAT:turn+=1:UNTIL PlayerType(turn)<>FALSE
 1890  PROCCloseWindow(players%)
 1900  PROCOpenWindow(main%)
 1910  PROCChangeIcon(dice%,1,name$(turn)+", Please click","")
 1920  PROCChangeIcon(dice%,2,"on the die to roll.","")
 1930  PROCOpenWindow(dice%)
 1940ENDPROC
 1950:
 1960DEFFNGetIconText(block%!0,block%!4)
 1970  SYS "Wimp_GetIconState",,block%
 1980  =$(block%!28)
 1990:
 2000DEFFNPlayerState(player)
 2010REM Find out which player type
 2020REM 0 = No Player
 2030REM 1 = Human Player
 2040REM 2 = Computer Player
 2050  block%!0=players%
 2060  block%!4=player+4
 2070  SYS "Wimp_GetIconState",,block%
 2080  IF (block%!24 AND &200000) THEN =1
 2090  block%!4=player+8
 2100  SYS "Wimp_GetIconState",,block%
 2110  IF (block%!24 AND &200000) THEN =2
 2120  =0
 2130:
 2140DEFPROCmain
 2150REM check which button pressed over main window, do whatever.
 2160
 2170REM If menu button pressed create menu
 2180  IF block%!8 AND 2 THEN
 2190    SYS "Wimp_CreateMenu",,MainMenu%,block%!0-64,block%!4:menflag%=2
 2200
 2210REM Check if counter clicked on
 2220REM If so then call move routine
 2230  ELSE
 2240    IF been=FALSE AND AllHome<NumPlayers AND PlayerType(turn)=Human THEN PROCgo
 2250  ENDIF
 2260ENDPROC
 2270
 2280DEFPROCdice
 2290  IF (((block%!8 AND 2)=0 AND block%!16=0) OR PlayerType(turn)=Computer) AND been=TRUE THEN
 2300
 2310    FOR loop=1 TO RND(7)+4
 2320      PROCPollIdle(10)
 2330      dice=RND(6)
 2340      PROCChangeIcon(dice%,0,"","sdice"+STR$(dice))
 2350    NEXT loop
 2360
 2370    IF FNInPlay(turn)=FALSE AND dice<>6 THEN
 2380
 2390      REPEAT
 2400        turn+=1
 2410        IF turn=4 THEN turn=red
 2420      UNTIL FNAllHome(turn)=FALSE AND PlayerType(turn)<>0
 2430
 2440      IF FNInPlay(turn)=FALSE AND dice<>6 THEN
 2450        been=TRUE
 2460      ENDIF
 2470      PROCChangeIcon(dice%,1,name$(turn)+", Please click","")
 2480      PROCChangeIcon(dice%,2,"on the dice to roll.","")
 2490    ELSE
 2500      been=FALSE
 2510      PROCChangeIcon(dice%,1,name$(turn)+", Please click","")
 2520      PROCChangeIcon(dice%,2,"on the piece to move.","")
 2530    ENDIF
 2540
 2550  ENDIF
 2560ENDPROC
 2570:
 2580DEFFNInPlay(colour)
 2590  count=0
 2600  FOR loop=0 TO 3
 2610    CASE colour OF
 2620      WHEN red : IF red(loop)=0 OR red(loop)=58 THEN count+=1
 2630      WHEN blue : IF blue(loop)=0 OR blue(loop)=58 THEN count+=1
 2640      WHEN yellow : IF yellow(loop)=0 OR yellow(loop)=58 THEN count+=1
 2650      WHEN green : IF green(loop)=0 OR green(loop)=58 THEN count+=1
 2660    ENDCASE
 2670  NEXT loop
 2680  IF count=4 THEN
 2690    =FALSE
 2700  ELSE
 2710    =TRUE
 2720:
 2730DEFFNAllHome(colour)
 2740  count=0
 2750  FOR loop=0 TO 3
 2760    CASE colour OF
 2770      WHEN red : IF red(loop)=58 THEN count+=1
 2780      WHEN blue : IF blue(loop)=58 THEN count+=1
 2790      WHEN yellow : IF yellow(loop)=58 THEN count+=1
 2800      WHEN green : IF green(loop)=58 THEN count+=1
 2810    ENDCASE
 2820  NEXT loop
 2830  IF count=4 THEN
 2840    =TRUE
 2850  ELSE
 2860    =FALSE
 2870:
 2880DEF PROCgo
 2890  IF turn=red THEN
 2900    FOR counter=0 TO 3
 2910      IF (icon(red,red(counter))=block%!16 OR (red(counter)=0 AND dice=6 AND block%!16=counter+77)) AND been=FALSE THEN PROCmove(red,counter,dice)
 2920    NEXT counter
 2930  ENDIF
 2940
 2950  IF turn=blue THEN
 2960    FOR counter=0 TO 3
 2970      IF (icon(blue,blue(counter))=block%!16 OR (blue(counter)=0 AND dice=6 AND block%!16=counter+81)) AND been=FALSE THEN PROCmove(blue,counter,dice)
 2980    NEXT counter
 2990  ENDIF
 3000
 3010  IF turn=yellow THEN
 3020    FOR counter=0 TO 3
 3030      IF (icon(yellow,yellow(counter))=block%!16 OR (yellow(counter)=0 AND dice=6 AND block%!16=counter+85)) AND been=FALSE THEN PROCmove(yellow,counter,dice)
 3040    NEXT counter
 3050  ENDIF
 3060
 3070  IF turn=green THEN
 3080    FOR counter=0 TO 3
 3090      IF (icon(green,green(counter))=block%!16 OR (green(counter)=0 AND dice=6 AND block%!16=counter+89)) AND been=FALSE THEN PROCmove(green,counter,dice)
 3100    NEXT counter
 3110  ENDIF
 3120ENDPROC
 3130:
 3140DEFPROCcomputer
 3150
 3160REM * * MOVE RED COMPUTER PLAYER * *
 3170
 3180  IF turn=red AND PlayerType(turn)=Computer THEN
 3190
 3200REM Find how many pieces are in play.
 3210
 3220    count=0
 3230    FOR counter=0 TO 3
 3240       IF red(counter)>0 AND red(counter)<53 THEN count+=1
 3250    NEXT counter
 3260
 3270REM If less than 2 pieces are in play then, if possible, move another out.
 3280
 3290    FOR counter=0 TO 3
 3300      IF count<2 AND dice=6 AND red(counter)=0 AND been=FALSE THEN PROCmove(red,counter,dice)
 3310    NEXT counter
 3320
 3330REM If not possible then, if possible, move a piece that will take an opponents piece
 3340
 3350    FOR counter=0 TO 3
 3360      IF red(counter)>0 AND red(counter)<53 THEN
 3370        FOR loop=0 TO 3
 3380          IF icon(red,red(counter)+dice)=icon(blue,blue(loop)) AND been=FALSE THEN
 3390            PROCmove(red,counter,dice)
 3400          ELSE
 3410            IF icon(red,red(counter)+dice)=icon(yellow,yellow(loop)) AND been=FALSE THEN
 3420              PROCmove(red,counter,dice)
 3430            ELSE
 3440              IF icon(red,red(counter)+dice)=icon(green,green(loop)) AND been=FALSE THEN PROCmove(red,counter,dice)
 3450            ENDIF
 3460          ENDIF
 3470        NEXT loop
 3480      ENDIF
 3490    NEXT counter
 3500
 3510REM If not possible then move a piece to safety
 3520
 3530    FOR counter=0 TO 3
 3540      IF red(counter)>0 AND red(counter)<53 AND (red(counter)+dice)>52 AND been=FALSE THEN PROCmove(red,counter,dice)
 3550    NEXT counter
 3560
 3570REM Otherwise move any piece possible
 3580
 3590    FOR counter=0 TO 3
 3600      IF red(counter)>0 AND red(counter)<58 AND been=FALSE THEN PROCmove(red,counter,dice)
 3610    NEXT counter
 3620
 3630  ENDIF
 3640
 3650REM * * MOVE BLUE COMPUTER PLAYER * *
 3660
 3670  IF turn=blue AND PlayerType(turn)=Computer THEN
 3680
 3690REM Find how many pieces are in play.
 3700
 3710    count=0
 3720    FOR counter=0 TO 3
 3730       IF blue(counter)>0 AND blue(counter)<53 THEN count+=1
 3740    NEXT counter
 3750
 3760REM If less than 2 pieces are in play then, if possible, move another out.
 3770
 3780    FOR counter=0 TO 3
 3790      IF count<2 AND dice=6 AND blue(counter)=0 AND been=FALSE THEN PROCmove(blue,counter,dice)
 3800    NEXT counter
 3810
 3820REM If not possible then, if possible, move a piece that will take an opponents piece
 3830
 3840    FOR counter=0 TO 3
 3850      IF blue(counter)>0 AND blue(counter)<53 THEN
 3860        FOR loop=0 TO 3
 3870          IF icon(blue,blue(counter)+dice)=icon(red,red(loop)) AND been=FALSE THEN
 3880            PROCmove(blue,counter,dice)
 3890          ELSE
 3900            IF icon(blue,blue(counter)+dice)=icon(yellow,yellow(loop)) AND been=FALSE THEN
 3910              PROCmove(blue,counter,dice)
 3920            ELSE
 3930              IF icon(blue,blue(counter)+dice)=icon(green,green(loop)) AND been=FALSE THEN PROCmove(blue,counter,dice)
 3940            ENDIF
 3950          ENDIF
 3960        NEXT loop
 3970      ENDIF
 3980    NEXT counter
 3990
 4000REM If not possible then move a piece to safety
 4010
 4020    FOR counter=0 TO 3
 4030      IF blue(counter)>0 AND blue(counter)<53 AND (blue(counter)+dice)>52 AND been=FALSE THEN PROCmove(blue,counter,dice)
 4040    NEXT counter
 4050
 4060REM Otherwise move any piece possible
 4070
 4080    FOR counter=0 TO 3
 4090      IF blue(counter)>0 AND blue(counter)<58 AND been=FALSE THEN PROCmove(blue,counter,dice)
 4100    NEXT counter
 4110
 4120  ENDIF
 4130
 4140REM * * MOVE YELLOW COMPUTER PLAYER * *
 4150
 4160  IF turn=yellow AND PlayerType(turn)=Computer THEN
 4170
 4180REM Find how many pieces are in play.
 4190
 4200    count=0
 4210    FOR counter=0 TO 3
 4220       IF yellow(counter)>0 AND yellow(counter)<53 THEN count+=1
 4230    NEXT counter
 4240
 4250REM If less than 2 pieces are in play then, if possible, move another out.
 4260
 4270    FOR counter=0 TO 3
 4280      IF count<2 AND dice=6 AND yellow(counter)=0 AND been=FALSE THEN PROCmove(yellow,counter,dice)
 4290    NEXT counter
 4300
 4310REM If not possible then, if possible, move a piece that will take an opponents piece
 4320
 4330    FOR counter=0 TO 3
 4340      IF yellow(counter)>0 AND yellow(counter)<53 THEN
 4350        FOR loop=0 TO 3
 4360          IF icon(yellow,yellow(counter)+dice)=icon(red,red(loop)) AND been=FALSE THEN
 4370            PROCmove(yellow,counter,dice)
 4380          ELSE
 4390            IF icon(yellow,yellow(counter)+dice)=icon(blue,blue(loop)) AND been=FALSE THEN
 4400              PROCmove(yellow,counter,dice)
 4410            ELSE
 4420              IF icon(yellow,yellow(counter)+dice)=icon(green,green(loop)) AND been=FALSE THEN PROCmove(yellow,counter,dice)
 4430            ENDIF
 4440          ENDIF
 4450        NEXT loop
 4460      ENDIF
 4470    NEXT counter
 4480
 4490REM If not possible then move a piece to safety
 4500
 4510    FOR counter=0 TO 3
 4520      IF yellow(counter)>0 AND yellow(counter)<53 AND (yellow(counter)+dice)>52 AND been=FALSE THEN PROCmove(yellow,counter,dice)
 4530    NEXT counter
 4540
 4550REM Otherwise move any piece possible
 4560
 4570    FOR counter=0 TO 3
 4580      IF yellow(counter)>0 AND yellow(counter)<58 AND been=FALSE THEN PROCmove(yellow,counter,dice)
 4590    NEXT counter
 4600
 4610  ENDIF
 4620
 4630REM * * MOVE GREEN COMPUTER PLAYER * *
 4640
 4650  IF turn=green AND PlayerType(turn)=Computer THEN
 4660
 4670REM Find how many pieces are in play.
 4680
 4690    count=0
 4700    FOR counter=0 TO 3
 4710       IF green(counter)>0 AND green(counter)<53 THEN count+=1
 4720    NEXT counter
 4730
 4740REM If less than 2 pieces are in play then, if possible, move another out.
 4750
 4760    FOR counter=0 TO 3
 4770      IF count<2 AND dice=6 AND green(counter)=0 AND been=FALSE THEN PROCmove(green,counter,dice)
 4780    NEXT counter
 4790
 4800REM If not possible then, if possible, move a piece that will take an opponents piece
 4810
 4820    FOR counter=0 TO 3
 4830      IF green(counter)>0 AND green(counter)<53 THEN
 4840        FOR loop=0 TO 3
 4850          IF icon(green,green(counter)+dice)=icon(red,red(loop)) AND been=FALSE THEN
 4860            PROCmove(green,counter,dice)
 4870          ELSE
 4880            IF icon(green,green(counter)+dice)=icon(blue,blue(loop)) AND been=FALSE THEN
 4890              PROCmove(green,counter,dice)
 4900            ELSE
 4910              IF icon(green,green(counter)+dice)=icon(yellow,yellow(loop)) AND been=FALSE THEN PROCmove(green,counter,dice)
 4920            ENDIF
 4930          ENDIF
 4940        NEXT loop
 4950      ENDIF
 4960    NEXT counter
 4970
 4980REM If not possible then move a piece to safety
 4990
 5000    FOR counter=0 TO 3
 5010      IF green(counter)>0 AND green(counter)<53 AND (green(counter)+dice)>52 AND been=FALSE THEN PROCmove(green,counter,dice)
 5020    NEXT counter
 5030
 5040REM Otherwise move any piece possible
 5050
 5060    FOR counter=0 TO 3
 5070      IF green(counter)>0 AND green(counter)<58 AND been=FALSE THEN PROCmove(green,counter,dice)
 5080    NEXT counter
 5090
 5100  ENDIF
 5110
 5120ENDPROC
 5130:
 5140DEFPROCmove(colour,counter,places)
 5150
 5160REM * * MOVE RED COUNTER * *
 5170
 5180  IF colour=red THEN
 5190    IF red(counter)=0 THEN
 5200      PROCChangeIcon(main%,counter+77,"","")
 5210      red(counter)=1
 5220    ELSE
 5230      count=0
 5240      FOR loop=0 TO 3
 5250        IF red(loop)=red(counter) THEN count+=1
 5260      NEXT loop
 5270      IF count=1 THEN
 5280        PROCChangeIcon(main%,icon(red,red(counter)),"","")
 5290      ELSE
 5300        PROCChangeIcon(main%,icon(red,red(counter)),STR$(count-1),"sred")
 5310      ENDIF
 5320      red(counter)+=places
 5330    ENDIF
 5340
 5350    IF red(counter)>58 THEN red(counter)=58-(red(counter)-58)
 5360
 5370    FOR loop=0 TO 3
 5380      IF icon(blue,blue(loop))=icon(red,red(counter)) THEN
 5390        blue(loop)=0
 5400        PROCChangeIcon(main%,loop+81,"1","sblue")
 5410      ENDIF
 5420
 5430      IF icon(yellow,yellow(loop))=icon(red,red(counter)) THEN
 5440        yellow(loop)=0
 5450        PROCChangeIcon(main%,loop+85,"1","syellow")
 5460      ENDIF
 5470
 5480      IF icon(green,green(loop))=icon(red,red(counter)) THEN
 5490        green(loop)=0
 5500        PROCChangeIcon(main%,loop+89,"1","sgreen")
 5510      ENDIF
 5520    NEXT loop
 5530
 5540    count=0
 5550    FOR loop=0 TO 3
 5560      IF red(loop)=red(counter) THEN count+=1
 5570    NEXT loop
 5580
 5590    PROCChangeIcon(main%,icon(red,red(counter)),STR$(count),"sred")
 5600  ENDIF
 5610
 5620REM * * MOVE BLUE COUNTER * *
 5630
 5640  IF colour=blue THEN
 5650    IF blue(counter)=0 THEN
 5660      PROCChangeIcon(main%,counter+81,"","")
 5670      blue(counter)=1
 5680    ELSE
 5690      count=0
 5700      FOR loop=0 TO 3
 5710        IF blue(loop)=blue(counter) THEN count+=1
 5720      NEXT loop
 5730      IF count=1 THEN
 5740        PROCChangeIcon(main%,icon(blue,blue(counter)),"","")
 5750      ELSE
 5760        PROCChangeIcon(main%,icon(blue,blue(counter)),STR$(count-1),"sblue")
 5770      ENDIF
 5780      blue(counter)+=places
 5790    ENDIF
 5800
 5810    IF blue(counter)>58 THEN blue(counter)=58-(blue(counter)-58)
 5820
 5830    FOR loop=0 TO 3
 5840      IF icon(red,red(loop))=icon(blue,blue(counter)) THEN
 5850        red(loop)=0
 5860        PROCChangeIcon(main%,loop+77,"1","sred")
 5870      ENDIF
 5880
 5890      IF icon(yellow,yellow(loop))=icon(blue,blue(counter)) THEN
 5900        yellow(loop)=0
 5910        PROCChangeIcon(main%,loop+85,"1","syellow")
 5920      ENDIF
 5930
 5940      IF icon(green,green(loop))=icon(blue,blue(counter)) THEN
 5950        green(loop)=0
 5960        PROCChangeIcon(main%,loop+89,"1","sgreen")
 5970      ENDIF
 5980    NEXT loop
 5990
 6000    count=0
 6010    FOR loop=0 TO 3
 6020      IF blue(loop)=blue(counter) THEN count+=1
 6030    NEXT loop
 6040
 6050    PROCChangeIcon(main%,icon(blue,blue(counter)),STR$(count),"sblue")
 6060  ENDIF
 6070
 6080REM * * MOVE YELLOW COUNTER * *
 6090
 6100IF colour=yellow THEN
 6110    IF yellow(counter)=0 THEN
 6120      PROCChangeIcon(main%,counter+85,"","")
 6130      yellow(counter)=1
 6140    ELSE
 6150      count=0
 6160      FOR loop=0 TO 3
 6170        IF yellow(loop)=yellow(counter) THEN count+=1
 6180      NEXT loop
 6190      IF count=1 THEN
 6200        PROCChangeIcon(main%,icon(yellow,yellow(counter)),"","")
 6210      ELSE
 6220        PROCChangeIcon(main%,icon(yellow,yellow(counter)),STR$(count-1),"syellow")
 6230      ENDIF
 6240      yellow(counter)+=places
 6250    ENDIF
 6260
 6270    IF yellow(counter)>58 THEN yellow(counter)=58-(yellow(counter)-58)
 6280
 6290    FOR loop=0 TO 3
 6300      IF icon(red,red(loop))=icon(yellow,yellow(counter)) THEN
 6310        red(loop)=0
 6320        PROCChangeIcon(main%,loop+77,"1","sred")
 6330      ENDIF
 6340
 6350      IF icon(blue,blue(loop))=icon(yellow,yellow(counter)) THEN
 6360        blue(loop)=0
 6370        PROCChangeIcon(main%,loop+81,"1","sblue")
 6380      ENDIF
 6390
 6400      IF icon(green,green(loop))=icon(yellow,yellow(counter)) THEN
 6410        green(loop)=0
 6420        PROCChangeIcon(main%,loop+89,"1","sgreen")
 6430      ENDIF
 6440    NEXT loop
 6450
 6460    count=0
 6470    FOR loop=0 TO 3
 6480      IF yellow(loop)=yellow(counter) THEN count+=1
 6490    NEXT loop
 6500
 6510    PROCChangeIcon(main%,icon(yellow,yellow(counter)),STR$(count),"syellow")
 6520  ENDIF
 6530
 6540REM * * MOVE GREEN COUNTER * *
 6550
 6560IF colour=green THEN
 6570    IF green(counter)=0 THEN
 6580      PROCChangeIcon(main%,counter+89,"","")
 6590      green(counter)=1
 6600    ELSE
 6610      count=0
 6620      FOR loop=0 TO 3
 6630        IF green(loop)=green(counter) THEN count+=1
 6640      NEXT loop
 6650      IF count=1 THEN
 6660        PROCChangeIcon(main%,icon(green,green(counter)),"","")
 6670      ELSE
 6680        PROCChangeIcon(main%,icon(green,green(counter)),STR$(count-1),"sgreen")
 6690      ENDIF
 6700      green(counter)+=places
 6710    ENDIF
 6720
 6730    IF green(counter)>58 THEN green(counter)=58-(green(counter)-58)
 6740
 6750    FOR loop=0 TO 3
 6760      IF icon(red,red(loop))=icon(green,green(counter)) THEN
 6770        red(loop)=0
 6780        PROCChangeIcon(main%,loop+77,"1","sred")
 6790      ENDIF
 6800
 6810      IF icon(blue,blue(loop))=icon(green,green(counter)) THEN
 6820        blue(loop)=0
 6830        PROCChangeIcon(main%,loop+81,"1","sblue")
 6840      ENDIF
 6850
 6860      IF icon(yellow,yellow(loop))=icon(green,green(counter)) THEN
 6870        yellow(loop)=0
 6880        PROCChangeIcon(main%,loop+85,"1","syellow")
 6890      ENDIF
 6900    NEXT loop
 6910    count=0
 6920
 6930    FOR loop=0 TO 3
 6940      IF green(loop)=green(counter) THEN count+=1
 6950    NEXT loop
 6960
 6970    PROCChangeIcon(main%,icon(green,green(counter)),STR$(count),"sgreen")
 6980  ENDIF
 6990
 7000  IF FNAllHome(colour)=TRUE THEN
 7010    AllHome+=1
 7020    PROCChangeIcon(results%,AllHome-1,name$(colour),"")
 7030    PROCOpenWindow(results%)
 7040  ENDIF
 7050
 7060  IF AllHome=NumPlayers THEN
 7070    PROCCloseWindow(dice%)
 7080  ELSE
 7090    IF dice<>6 THEN
 7100      REPEAT
 7110        turn+=1
 7120        IF turn=4 THEN turn=red
 7130      UNTIL FNAllHome(turn)=FALSE AND PlayerType(turn)<>0
 7140    ENDIF
 7150    PROCChangeIcon(dice%,1,name$(turn)+", Please click","")
 7160    PROCChangeIcon(dice%,2,"on the dice to roll.","")
 7170    been=TRUE
 7180  ENDIF
 7190ENDPROC
 7200:
 7210DEFPROCMenuSelect
 7220
 7230REM Check which entry selected in icon bar menu
 7240  IF menflag%=1 THEN
 7250    CASE block%!0 OF
 7260      WHEN 1 : PROCNewGame
 7270               PROCOpenWindow(players%)
 7280      WHEN 2 : END
 7290    ENDCASE
 7300  ENDIF
 7310:
 7320REM check which item in menu selected
 7330
 7340  IF menflag%=2
 7350    CASE block%!0 OF
 7360      WHEN 1 : PROCNewGame
 7370               PROCOpenWindow(players%)
 7380    ENDCASE
 7390  ENDIF
 7400:
 7410  SYS "Wimp_GetPointerInfo",,block%
 7420  IF block%!8=1 THEN
 7430    CASE menflag% OF
 7440      WHEN 1 : SYS "Wimp_CreateMenu",,IconMenu%
 7450      WHEN 2 : SYS "Wimp_CreateMenu",,MainMenu%
 7460    ENDCASE
 7470  ELSE
 7480    SYS "Wimp_CreateMenu",,-1
 7490    menflag%=0
 7500  ENDIF
 7510ENDPROC
 7520:
 7530DEFPROCChangeIcon(whan%,ihan%,text$,indir$)
 7540REM change sprite of icon
 7550
 7560  block%!0=whan%:block%!4=ihan%
 7570  SYS "Wimp_GetIconState",,block%
 7580  block%!8=0:block%!12=0
 7590  $(block%!28)=text$+CHR$(13)
 7600  $(block%!32)=indir$+CHR$(13)
 7610  SYS "Wimp_SetIconState",,block%
 7620ENDPROC
 7630:
 7640DEF FNtext(whan%,ihan%)
 7650  block%!0=whan%:block%!4=ihan%
 7660  SYS "Wimp_GetIconState",,block%
 7670=$(block%!28)
 7680:
 7690DEF PROCMessage
 7700    source%=block%!4:ref%=block%!8
 7710    CASE block%!16 OF
 7720    WHEN 0 : quit%=TRUE
 7730    WHEN 2 : PROCSaveFile(FNgname(block%+44))
 7740    WHEN 3 : PROCLoadFile
 7750    WHEN 5 : PROCClickLoad
 7760  ENDCASE
 7770ENDPROC
 7780:
 7790DEF PROCreply(type%,reason%)
 7800  block%!0=256
 7810  block%!12=ref%
 7820  block%!16=reason%
 7830  SYS"Wimp_SendMessage",type%,block%,source%
 7840ENDPROC
 7850:
 7860DEFFNgname(a%):LOCALf$:f$=""
 7870  WHILE ?a%>=32
 7880    f$+=CHR$?a%:a%+=1
 7890  ENDWHILE
 7900=f$
 7910:
 7920DEF PROCsave
 7930  CASE block%!16 OF
 7940    WHEN 1 : PROCCreateDragBox(savebox%,1)
 7950    WHEN 3 : PROCQuickSave
 7960  ENDCASE
 7970ENDPROC
 7980:
 7990DEFPROCQuickSave
 8000  fname$=FNtext(savebox%,2)
 8010  IF INSTR(fname$,".") THEN
 8020    PROCSaveFile(fname$)
 8030  ELSE
 8040    PROCError("To save the game either drag the file icon to a directory viewer, or enter a file name (including full path name).")
 8050  ENDIF
 8060ENDPROC
 8070:
 8080DEFPROCCreateDragBox(window%,icon%)
 8090    block%!0=window%
 8100    SYS"Wimp_GetWindowState",,block%
 8110    ox=block%!4-block%!20
 8120    oy=block%!16-block%!24
 8130    block%!4=icon%
 8140    SYS"Wimp_GetIconState",,block%
 8150    !block%=window%
 8160    block%!4=5
 8170    block%!8+=ox
 8180    block%!12+=oy
 8190    block%!16+=ox
 8200    block%!20+=oy
 8210    block%!24=0
 8220    block%!28=0
 8230    block%!32=&7FFFFFFF
 8240    block%!36=&7FFFFFFF
 8250    SYS"Wimp_DragBox",,block%
 8260
 8270    IF drag%=TRUE THEN
 8280      SYS"DragASprite_Start",&CA,1,"file_777",block%+8,0
 8290    ENDIF
 8300  ENDIF
 8310ENDPROC
 8320:
 8330DEFPROCDragSave(fname$)
 8340  SYS"Wimp_GetPointerInfo",,block%
 8350  IF block%!12=savebox% THEN ENDPROC
 8360  block%!20=block%!12:block%!12=0
 8370  block%!24=block%!16:block%!16=1
 8380  block%!28=block%!0:block%!0=64
 8390  block%!32=block%!4:block%!36=0
 8400  block%!40=&777:$(block%+44)=FNleaf(fname$)+CHR$0
 8410  SYS"Wimp_SendMessage",17,block%,block%!20,block%!24
 8420ENDPROC
 8430:
 8440DEFFNleaf(path$)
 8450  WHILE INSTR(path$,".")
 8460    path$=MID$(path$,INSTR(path$,".")+1)
 8470  ENDWHILE
 8480=path$
 8490:
 8500DEFPROCSaveFile(fname$)
 8510  LOCAL ERROR : ON ERROR LOCAL : PROCError("To save the game either drag the file icon to a directory viewer, or enter a file name (including full path name)."):ENDPROC
 8520  file%=OPENOUT(fname$)
 8530    PRINT#file%,NumPlayers
 8540    PRINT#file%,AllHome
 8550    PRINT#file%,dice
 8560    PRINT#file%,turn
 8570    PRINT#file%,been
 8580
 8590    FOR colour=0 TO 3
 8600      PRINT#file%,PlayerType(colour)
 8610      PRINT#file%,name$(colour)
 8620    NEXT colour
 8630
 8640    FOR counter=0 TO 3
 8650      PRINT#file%,red(counter)
 8660      PRINT#file%,blue(counter)
 8670      PRINT#file%,yellow(counter)
 8680      PRINT#file%,green(counter)
 8690    NEXT counter
 8700  CLOSE#file%
 8710  SYS"OS_File",18,fname$,&777
 8720  SYS"Wimp_CreateMenu",,-1
 8730  PROCCloseWindow(savebox%)
 8740  PROCreply(17,3)
 8750  PROCChangeIcon(savebox%,2,fname$,"")
 8760ENDPROC
 8770:
 8780DEFPROCClickLoad
 8790  IF block%!40=&777 THEN
 8800    PROCreply(17,4)
 8810    PROCLoadFile
 8820  ENDIF
 8830ENDPROC
 8840:
 8850DEFPROCLoadFile
 8860  IF block%!40=&777 THEN
 8870    fname$=FNgname(block%+44)
 8880    PROCChangeIcon(savebox%,2,fname$,"")
 8890    PROCClearBoard
 8900    file%=OPENIN(fname$)
 8910
 8920      INPUT#file%,NumPlayers
 8930      INPUT#file%,AllHome
 8940      INPUT#file%,dice
 8950      INPUT#file%,turn
 8960      INPUT#file%,been
 8970
 8980      FOR colour=0 TO 3
 8990        INPUT#file%,PlayerType(colour)
 9000        INPUT#file%,name$(colour)
 9010      NEXT colour
 9020
 9030      FOR counter=0 TO 3
 9040        INPUT#file%,red(counter)
 9050        INPUT#file%,blue(counter)
 9060        INPUT#file%,yellow(counter)
 9070        INPUT#file%,green(counter)
 9080      NEXT counter
 9090    CLOSE#file%
 9100    started=TRUE
 9110    PROCInitBoard
 9120    PROCOpenWindow(main%)
 9130    IF AllHome<NumPlayers THEN PROCOpenWindow(dice%)
 9140    IF AllHome>0 THEN PROCOpenWindow(results%)
 9150  ENDIF
 9160ENDPROC
 9170:
 9180DEFPROCOpenWindow(block%!0)
 9190  SYS "Wimp_GetWindowState",,block%
 9200  SYS "Wimp_OpenWindow",,block%
 9210ENDPROC
 9220:
 9230DEFPROCCloseWindow(block%!0)
 9240  SYS "Wimp_GetWindowState",,block%
 9250  SYS "Wimp_CloseWindow",,block%
 9260ENDPROC
 9270:
 9280DEFPROCRedraw
 9290  SYS "Wimp_RedrawWindow",,block% TO more%
 9300  xo%=block%!4-block%!20:yo%=block%!16-block%!24
 9310
 9320  WHILE more%
 9330    REM put user redraw code in this loop
 9340
 9350    SYS "Wimp_GetRectangle",,block% TO more%
 9360  ENDWHILE
 9370ENDPROC
 9380:
 9390DEFPROCPollLoop
 9400REM Check what is happening
 9410
 9420  REPEAT
 9430    SYS "Wimp_Poll",,block% TO reason%
 9440    CASE reason% OF
 9450      WHEN 1:PROCRedraw
 9460      WHEN 2:SYS "Wimp_OpenWindow",,block%
 9470      WHEN 3:SYS "Wimp_CloseWindow",,block%
 9480      WHEN 6:PROCMouseClick
 9490      WHEN 7:PROCDragSave(FNtext(savebox%,2))
 9500      WHEN 8:PROCKeyClick
 9510      WHEN 9:PROCMenuSelect
 9520      WHEN 17,18:PROCMessage
 9530    ENDCASE
 9540
 9550    IF PlayerType(turn)=Computer AND AllHome<NumPlayers AND started=TRUE AND been=TRUE THEN
 9560      PROCPollIdle(100)
 9570      PROCdice
 9580    ENDIF
 9590
 9600    IF PlayerType(turn)=Computer AND AllHome<NumPlayers AND started=TRUE AND been=FALSE THEN
 9610      PROCPollIdle(100)
 9620      PROCcomputer
 9630    ENDIF
 9640
 9650  UNTIL FALSE
 9660ENDPROC
 9670
 9680DEFPROCPollIdle(time)
 9690  TIME=0
 9700  REPEAT
 9710    SYS "Wimp_PollIdle",,block%,time TO reason%
 9720    CASE reason% OF
 9730      WHEN 1:PROCRedraw
 9740      WHEN 2:SYS "Wimp_OpenWindow",,block%
 9750      WHEN 3:SYS "Wimp_CloseWindow",,block%
 9760      WHEN 6:PROCMouseClick
 9770      WHEN 7:PROCDragSave(FNtext(savebox%,2))
 9780      WHEN 8:PROCKeyClick
 9790      WHEN 9:PROCMenuSelect
 9800      WHEN 17,18:PROCMessage
 9810    ENDCASE
 9820  UNTIL TIME>time
 9830ENDPROC
 9840
 9850:
 9860DEFPROCKeyClick
 9870  SYS"Wimp_ProcessKey",block%!24
 9880  CASE block%!0 OF
 9890    WHEN players% : IF block%!24=&D THEN PROCplayers
 9900    WHEN savebox% : IF block%!24=&D THEN PROCQuickSave
 9910  ENDCASE
 9920ENDPROC
 9930
 9940DEFPROCNewGame
 9950  REM Stuff to initialise game
 9960
 9970  SYS "Wimp_CreateMenu",,-1
 9980  menflag%=0
 9990
10000  PROCCloseWindow(main%)
10010  PROCCloseWindow(dice%)
10020  PROCCloseWindow(results%)
10030
10040  PROCClearBoard
10050
10060  FOR counter=0 TO 3
10070    red(counter)=0
10080    blue(counter)=0
10090    yellow(counter)=0
10100    green(counter)=0
10110  NEXT counter
10120
10130  PROCChangeIcon(main%,0,"","scenter")
10140  turn=red
10150  been=TRUE:dice=1
10160
10170  started=FALSE
10180  AllHome=0
10190ENDPROC
10200
10210DEFPROCClearBoard
10220  FOR counter=0 TO 3
10230
10240    IF red(counter)=0 THEN
10250      PROCChangeIcon(main%,77+counter,"","")
10260    ELSE
10270      PROCChangeIcon(main%,icon(red,red(counter)),"","")
10280    ENDIF
10290
10300    IF blue(counter)=0 THEN
10310      PROCChangeIcon(main%,81+counter,"","")
10320    ELSE
10330      PROCChangeIcon(main%,icon(blue,blue(counter)),"","")
10340    ENDIF
10350
10360    IF yellow(counter)=0 THEN
10370      PROCChangeIcon(main%,85+counter,"","")
10380    ELSE
10390      PROCChangeIcon(main%,icon(yellow,yellow(counter)),"","")
10400    ENDIF
10410
10420    IF green(counter)=0 THEN
10430      PROCChangeIcon(main%,89+counter,"","")
10440    ELSE
10450      PROCChangeIcon(main%,icon(green,green(counter)),"","")
10460    ENDIF
10470    ENDIF
10480
10490  NEXT counter
10500ENDPROC
10510
10520DEFPROCInitBoard
10530  FOR counter=0 TO 3
10540
10550    IF PlayerType(red)<>FALSE THEN
10560      IF red(counter)=0 THEN
10570        PROCChangeIcon(main%,77+counter,"1","sred")
10580      ELSE
10590        PROCChangeIcon(main%,icon(red,red(counter)),"1","sred")
10600      ENDIF
10610    ENDIF
10620
10630    IF PlayerType(blue)<>FALSE THEN
10640      IF blue(counter)=0 THEN
10650        PROCChangeIcon(main%,81+counter,"1","sblue")
10660      ELSE
10670        PROCChangeIcon(main%,icon(blue,blue(counter)),"1","sblue")
10680      ENDIF
10690    ENDIF
10700
10710    IF PlayerType(yellow)<>FALSE THEN
10720      IF yellow(counter)=0 THEN
10730        PROCChangeIcon(main%,85+counter,"1","syellow")
10740      ELSE
10750        PROCChangeIcon(main%,icon(yellow,yellow(counter)),"1","syellow")
10760      ENDIF
10770    ENDIF
10780
10790    IF PlayerType(green)<>FALSE THEN
10800      IF green(counter)=0 THEN
10810        PROCChangeIcon(main%,89+counter,"1","sgreen")
10820      ELSE
10830        PROCChangeIcon(main%,icon(green,green(counter)),"1","sgreen")
10840      ENDIF
10850    ENDIF
10860  NEXT counter
10870  PROCChangeIcon(dice%,0,"","sdice"+STR$(dice))
10880  IF been=TRUE THEN
10890     PROCChangeIcon(dice%,1,name$(turn)+", Please click","")
10900     PROCChangeIcon(dice%,2,"on the dice to roll.","")
10910  ELSE
10920    PROCChangeIcon(dice%,1,name$(turn)+", Please click","")
10930    PROCChangeIcon(dice%,2,"on the piece to move.","")
10940  ENDIF
10950ENDPROC

� <Ludo$Dir>.!RunImage
� Desktop Ludo Game
� � A.L. Stoner
(� v1.21 (25/03/94)
2:
<%� � �Error(�$+" at line "+�(�)):�
F:
P	�Init
Z
�LoadData
d�LoadTemplates
n�CreateMenus
x�IconbarIcon
��NewGame
�
�PollLoop
�:
��
�:
���Error(error$)
�   ș "Wimp_CommandWindow",-1
�*  !errblk%=�: $(errblk%+4)=error$+�(0)
�/  ș "Wimp_ReportError",errblk%,1,app_name$
��
�:
�
��Init
�1  � block% &8000, errblk% &100, buffer% &1600
%  � indbuff% &600, handles% &2000
&  � IconMenu% &200, MainMenu% &200
  � spritearea 9*1024
"
,'  � icon(3,58)  : � colour,position
6#  red=0:blue=1:yellow=2:green=3
@
J*  � pos=1 � 58:icon(red,pos)=pos:� pos
T
^/  � pos=01 � 39:icon(blue,pos)=pos+13:� pos
h/  � pos=40 � 52:icon(blue,pos)=pos-39:� pos
r.  � pos=53 � 58:icon(blue,pos)=pos+6:� pos
|
�1  � pos=01 � 26:icon(yellow,pos)=pos+26:� pos
�1  � pos=27 � 52:icon(yellow,pos)=pos-26:� pos
�1  � pos=53 � 58:icon(yellow,pos)=pos+12:� pos
�
�0  � pos=01 � 13:icon(green,pos)=pos+39:� pos
�0  � pos=14 � 52:icon(green,pos)=pos-13:� pos
�0  � pos=53 � 58:icon(green,pos)=pos+18:� pos
�
�  � red(3)
�  � blue(3)
�  � yellow(3)
�  � green(3)
�
  � name$(3)
  � PlayerType(3)
  Human=1:Computer=2
&  NumPlayers=4:AllHome=0
0
:
  drag%=�
D
N  app_name$="Desktop Ludo"
X  $block%="TASK"
bA  ș "Wimp_Initialise",200,!block%,app_name$ � version%,task%
l  grey%=&400000
v  black%=&FFBFFFFF
�
  on=1
�  off=0
��
�:
���LoadData
�
�%� routine to load any data needed
�
�4  spritearea!0=(9*1024)  : � size of sprite area
�7  spritearea!8=16        : � offset to first sprite
�D  ș "OS_SpriteOp",256+9,spritearea  : � set up user sprite area
�=  ș "OS_SpriteOp",256+10,spritearea,"<Ludo$Dir>.Sprites"
�
�
:
��LoadTemplates
 � Load window templates
*
44  ș "Wimp_OpenTemplate",,"<Ludo$Dir>.Templates"
>"  players%=�twindow("Players")
H  main%=�twindow("Main")
R  dice%=�twindow("Dice")
\"  results%=�twindow("Results")
f$  proginfo%=�twindow("ProgInfo")
p"  savebox%=�twindow("SaveBox")
z  ș "Wimp_CloseTemplate"
��
�:
�ݤtwindow(win$)
�� create windows
�
�  buffend%=buffer%+&1600
�I  ș "Wimp_LoadTemplate",,block%,buffer%,buffend%,-1,win$ � ,,buffer%
�@  block%!64=spritearea   : � use user sprite area for window
�+  ș "Wimp_CreateWindow",,block% � han%
�	=han%
�:
���IconbarIcon
�� Put Icon on Icon Bar

  � ssx%,ssy%,ssm%,px%,py%
9  ș "Wimp_SpriteOp",40,,"!Ludo" � ,,,ssx%,ssy%,,ssm%
$=  ș "OS_ReadModeVariable",ssm%,4 � ,,px%: ssx%=ssx%<<px%
.=  ș "OS_ReadModeVariable",ssm%,5 � ,,py%: ssy%=ssy%<<py%
8  :
B'  block%!0=-1:block%!4=0:block%!8=0
L2  block%!12=block%!4+ssx%+10:block%!16=20+ssy%
V  block%!20=&3002
`  $(block%+24)="!Ludo"
j-  ș "Wimp_CreateIcon",,block% � ihandle%
t�
~:
���CreateMenus
�� Create Menus
�
�4  �DrawMenu(IconMenu%,"Ludo,Info,New Game,Quit")
�  IconMenu%!16=8*16+12
�$  IconMenu%!((24*1)+8)=proginfo%
�
�/  �DrawMenu(MainMenu%,"Ludo,Save,New Game")
�  MainMenu%!16=8*16+12
�#  MainMenu%!((24*1)+8)=savebox%
�
��
:

��DrawMenu(menu%,menu$)
1  menu%?12=7:menu%?13=2:menu%?14=7:menu%?15=0
E  menu%!16=�menu$,",")*16+12:menu%!20=44:menu%!24=0:ptr%=menu%+28
(8  $menu%=�menu$,�menu$,",")-1):menu$+=",":entries%=0
2  ȕ menu$<>""
<#    menu$=�menu$,�menu$,",")+1)
F    � menu$<>"" �
P      !ptr%=0:ptr%!4=-1
Z      ptr%!8=&7000021
d*      $(ptr%+12)=�menu$,�menu$,",")-1)
n      ptr%+=24:entries%+=1
x	    �
�  �
�  ptr%!-24=ptr%!-24 � &80
��
�:
���MouseClick
�  Ȏ block%!12 �
�H    � -2       : �IconMouse  :� If button pressed over icon bar icon
�    � players%
�6      � (block%!8 � 2)=0 � block%!16=12 � �players
�N                                    � If button pressed over player window
�F    � main%    : �main       :� If button pressed over main window
�5    � dice%    : � PlayerType(turn)=Human � �dice
�L                                    � If button pressed over dice window
F    � savebox% : �save       :� If button pressed over save window
  �
�
":
,��IconMouse
6/� If Menu button pressed draw icon bar menu
@2� if Select or Adjust pressed draw main window
J
T  � block%!8 � 2 �
^    x%=!block%
h?    ș "Wimp_CreateMenu",,IconMenu%,x%-64,96+132:menflag%=1
r  �
|    � started=� �
�      �OpenWindow(players%)
�	    �
�      �OpenWindow(main%)
�3      � AllHome<NumPlayers � �OpenWindow(dice%)
�-      � AllHome>0 � �OpenWindow(results%)
�	    �
�  �
��
�:
�
��players
�
�  NumPlayers=0
�  � player=0 � 3
3    name$(player)=�GetIconText(players%,player)
/    PlayerType(player)=�PlayerState(player)
/    � PlayerType(player)<>0 � NumPlayers+=1
&  � player
0F  � NumPlayers=0 � �Error("You must have at least one player !"):�
:  �InitBoard
D  started=�
N  turn=red
X<  � PlayerType(turn)=� � �:turn+=1:� PlayerType(turn)<>�
b  �CloseWindow(players%)
l  �OpenWindow(main%)
v:  �ChangeIcon(dice%,1,name$(turn)+", Please click","")
�3  �ChangeIcon(dice%,2,"on the die to roll.","")
�  �OpenWindow(dice%)
��
�:
�$ݤGetIconText(block%!0,block%!4)
�$  ș "Wimp_GetIconState",,block%
�  =$(block%!28)
�:
�ݤPlayerState(player)
� � Find out which player type
�� 0 = No Player
�� 1 = Human Player
�� 2 = Computer Player
  block%!0=players%
  block%!4=player+4
$  ș "Wimp_GetIconState",,block%
 "  � (block%!24 � &200000) � =1
*  block%!4=player+8
4$  ș "Wimp_GetIconState",,block%
>"  � (block%!24 � &200000) � =2
H  =0
R:
\
��main
f?� check which button pressed over main window, do whatever.
p
z(� If menu button pressed create menu
�  � block%!8 � 2 �
�G    ș "Wimp_CreateMenu",,MainMenu%,block%!0-64,block%!4:menflag%=2
�
�!� Check if counter clicked on
�"� If so then call move routine
�  �
�D    � been=� � AllHome<NumPlayers � PlayerType(turn)=Human � �go
�  �
��
�
�
��dice
�Q  � (((block%!8 � 2)=0 � block%!16=0) � PlayerType(turn)=Computer) � been=� �
�
	    � loop=1 � �(7)+4
	      �PollIdle(10)
	      dice=�(6)
	$1      �ChangeIcon(dice%,0,"","sdice"+�(dice))
	.    � loop
	8
	B%    � �InPlay(turn)=� � dice<>6 �
	L
	V      �
	`        turn+=1
	j        � turn=4 � turn=red
	t2      � �AllHome(turn)=� � PlayerType(turn)<>0
	~
	�'      � �InPlay(turn)=� � dice<>6 �
	�        been=�
	�      �
	�>      �ChangeIcon(dice%,1,name$(turn)+", Please click","")
	�8      �ChangeIcon(dice%,2,"on the dice to roll.","")
	�	    �
	�      been=�
	�>      �ChangeIcon(dice%,1,name$(turn)+", Please click","")
	�9      �ChangeIcon(dice%,2,"on the piece to move.","")
	�	    �
	�
	�  �
�

:
ݤInPlay(colour)

  count=0
(  � loop=0 � 3
2    Ȏ colour �
<9      � red : � red(loop)=0 � red(loop)=58 � count+=1
F<      � blue : � blue(loop)=0 � blue(loop)=58 � count+=1
PB      � yellow : � yellow(loop)=0 � yellow(loop)=58 � count+=1
Z?      � green : � green(loop)=0 � green(loop)=58 � count+=1
d	    �
n  � loop
x  � count=4 �
�
    =�
�  �
�
    =�
�:
�ݤAllHome(colour)
�
  count=0
�  � loop=0 � 3
�    Ȏ colour �
�+      � red : � red(loop)=58 � count+=1
�-      � blue : � blue(loop)=58 � count+=1
�1      � yellow : � yellow(loop)=58 � count+=1
�/      � green : � green(loop)=58 � count+=1
�	    �
  � loop
  � count=4 �

    =�
"  �
,
    =�
6:
@	� �go
J  � turn=red �
T    � counter=0 � 3
^�      � (icon(red,red(counter))=block%!16 � (red(counter)=0 � dice=6 � block%!16=counter+77)) � been=� � �move(red,counter,dice)
h    � counter
r  �
|
�  � turn=blue �
�    � counter=0 � 3
��      � (icon(blue,blue(counter))=block%!16 � (blue(counter)=0 � dice=6 � block%!16=counter+81)) � been=� � �move(blue,counter,dice)
�    � counter
�  �
�
�  � turn=yellow �
�    � counter=0 � 3
֐      � (icon(yellow,yellow(counter))=block%!16 � (yellow(counter)=0 � dice=6 � block%!16=counter+85)) � been=� � �move(yellow,counter,dice)
�    � counter
�  �
�
�  � turn=green �
    � counter=0 � 3
�      � (icon(green,green(counter))=block%!16 � (green(counter)=0 � dice=6 � block%!16=counter+89)) � been=� � �move(green,counter,dice)
    � counter
&  �
0�
::
D��computer
N
X&� * * MOVE RED COMPUTER PLAYER * *
b
l.  � turn=red � PlayerType(turn)=Computer �
v
�'� Find how many pieces are in play.
�
�    count=0
�    � counter=0 � 3
�8       � red(counter)>0 � red(counter)<53 � count+=1
�    � counter
�
�L� If less than 2 pieces are in play then, if possible, move another out.
�
�    � counter=0 � 3
�P      � count<2 � dice=6 � red(counter)=0 � been=� � �move(red,counter,dice)
�    � counter
�

W� If not possible then, if possible, move a piece that will take an opponents piece



    � counter=0 � 3

 .      � red(counter)>0 � red(counter)<53 �

*        � loop=0 � 3

4L          � icon(red,red(counter)+dice)=icon(blue,blue(loop)) � been=� �

>'            �move(red,counter,dice)

H          �

RR            � icon(red,red(counter)+dice)=icon(yellow,yellow(loop)) � been=� �

\)              �move(red,counter,dice)

f            �

pj              � icon(red,red(counter)+dice)=icon(green,green(loop)) � been=� � �move(red,counter,dice)

z            �

�          �

�        � loop

�      �

�    � counter

�

�1� If not possible then move a piece to safety

�

�    � counter=0 � 3

�h      � red(counter)>0 � red(counter)<53 � (red(counter)+dice)>52 � been=� � �move(red,counter,dice)

�    � counter

�

�'� Otherwise move any piece possible

�
    � counter=0 � 3
O      � red(counter)>0 � red(counter)<58 � been=� � �move(red,counter,dice)
    � counter
$
.  �
8
B'� * * MOVE BLUE COMPUTER PLAYER * *
L
V/  � turn=blue � PlayerType(turn)=Computer �
`
j'� Find how many pieces are in play.
t
~    count=0
�    � counter=0 � 3
�:       � blue(counter)>0 � blue(counter)<53 � count+=1
�    � counter
�
�L� If less than 2 pieces are in play then, if possible, move another out.
�
�    � counter=0 � 3
�R      � count<2 � dice=6 � blue(counter)=0 � been=� � �move(blue,counter,dice)
�    � counter
�
�W� If not possible then, if possible, move a piece that will take an opponents piece
�
    � counter=0 � 3

0      � blue(counter)>0 � blue(counter)<53 �
        � loop=0 � 3
L          � icon(blue,blue(counter)+dice)=icon(red,red(loop)) � been=� �
((            �move(blue,counter,dice)
2          �
<T            � icon(blue,blue(counter)+dice)=icon(yellow,yellow(loop)) � been=� �
F*              �move(blue,counter,dice)
P            �
Zm              � icon(blue,blue(counter)+dice)=icon(green,green(loop)) � been=� � �move(blue,counter,dice)
d            �
n          �
x        � loop
�      �
�    � counter
�
�1� If not possible then move a piece to safety
�
�    � counter=0 � 3
�l      � blue(counter)>0 � blue(counter)<53 � (blue(counter)+dice)>52 � been=� � �move(blue,counter,dice)
�    � counter
�
�'� Otherwise move any piece possible
�
�    � counter=0 � 3
�R      � blue(counter)>0 � blue(counter)<58 � been=� � �move(blue,counter,dice)
    � counter

  �
"
,)� * * MOVE YELLOW COMPUTER PLAYER * *
6
@1  � turn=yellow � PlayerType(turn)=Computer �
J
T'� Find how many pieces are in play.
^
h    count=0
r    � counter=0 � 3
|>       � yellow(counter)>0 � yellow(counter)<53 � count+=1
�    � counter
�
�L� If less than 2 pieces are in play then, if possible, move another out.
�
�    � counter=0 � 3
�V      � count<2 � dice=6 � yellow(counter)=0 � been=� � �move(yellow,counter,dice)
�    � counter
�
�W� If not possible then, if possible, move a piece that will take an opponents piece
�
�    � counter=0 � 3
�4      � yellow(counter)>0 � yellow(counter)<53 �
�        � loop=0 � 3
P          � icon(yellow,yellow(counter)+dice)=icon(red,red(loop)) � been=� �
*            �move(yellow,counter,dice)
          �
&T            � icon(yellow,yellow(counter)+dice)=icon(blue,blue(loop)) � been=� �
0,              �move(yellow,counter,dice)
:            �
Ds              � icon(yellow,yellow(counter)+dice)=icon(green,green(loop)) � been=� � �move(yellow,counter,dice)
N            �
X          �
b        � loop
l      �
v    � counter
�
�1� If not possible then move a piece to safety
�
�    � counter=0 � 3
�t      � yellow(counter)>0 � yellow(counter)<53 � (yellow(counter)+dice)>52 � been=� � �move(yellow,counter,dice)
�    � counter
�
�'� Otherwise move any piece possible
�
�    � counter=0 � 3
�X      � yellow(counter)>0 � yellow(counter)<58 � been=� � �move(yellow,counter,dice)
�    � counter
�
  �

(� * * MOVE GREEN COMPUTER PLAYER * *
 
*0  � turn=green � PlayerType(turn)=Computer �
4
>'� Find how many pieces are in play.
H
R    count=0
\    � counter=0 � 3
f<       � green(counter)>0 � green(counter)<53 � count+=1
p    � counter
z
�L� If less than 2 pieces are in play then, if possible, move another out.
�
�    � counter=0 � 3
�T      � count<2 � dice=6 � green(counter)=0 � been=� � �move(green,counter,dice)
�    � counter
�
�W� If not possible then, if possible, move a piece that will take an opponents piece
�
�    � counter=0 � 3
�2      � green(counter)>0 � green(counter)<53 �
�        � loop=0 � 3
�N          � icon(green,green(counter)+dice)=icon(red,red(loop)) � been=� �
�)            �move(green,counter,dice)
          �
R            � icon(green,green(counter)+dice)=icon(blue,blue(loop)) � been=� �
+              �move(green,counter,dice)
$            �
.r              � icon(green,green(counter)+dice)=icon(yellow,yellow(loop)) � been=� � �move(green,counter,dice)
8            �
B          �
L        � loop
V      �
`    � counter
j
t1� If not possible then move a piece to safety
~
�    � counter=0 � 3
�p      � green(counter)>0 � green(counter)<53 � (green(counter)+dice)>52 � been=� � �move(green,counter,dice)
�    � counter
�
�'� Otherwise move any piece possible
�
�    � counter=0 � 3
�U      � green(counter)>0 � green(counter)<58 � been=� � �move(green,counter,dice)
�    � counter
�
�  �
�
�

:
!��move(colour,counter,places)

(� * * MOVE RED COUNTER * *
2
<  � colour=red �
F    � red(counter)=0 �
P-      �ChangeIcon(main%,counter+77,"","")
Z      red(counter)=1
d	    �
n      count=0
x      � loop=0 � 3
�/        � red(loop)=red(counter) � count+=1
�      � loop
�      � count=1 �
�;        �ChangeIcon(main%,icon(red,red(counter)),"","")
�      �
�G        �ChangeIcon(main%,icon(red,red(counter)),�(count-1),"sred")
�      �
�      red(counter)+=places
�	    �
�
�=    � red(counter)>58 � red(counter)=58-(red(counter)-58)
�
�    � loop=0 � 3
:      � icon(blue,blue(loop))=icon(red,red(counter)) �
        blue(loop)=0
2        �ChangeIcon(main%,loop+81,"1","sblue")
"      �
,
6>      � icon(yellow,yellow(loop))=icon(red,red(counter)) �
@        yellow(loop)=0
J4        �ChangeIcon(main%,loop+85,"1","syellow")
T      �
^
h<      � icon(green,green(loop))=icon(red,red(counter)) �
r        green(loop)=0
|3        �ChangeIcon(main%,loop+89,"1","sgreen")
�      �
�    � loop
�
�    count=0
�    � loop=0 � 3
�-      � red(loop)=red(counter) � count+=1
�    � loop
�
�A    �ChangeIcon(main%,icon(red,red(counter)),�(count),"sred")
�  �
�
�� * * MOVE BLUE COUNTER * *
�
  � colour=blue �
    � blue(counter)=0 �
-      �ChangeIcon(main%,counter+81,"","")
&      blue(counter)=1
0	    �
:      count=0
D      � loop=0 � 3
N1        � blue(loop)=blue(counter) � count+=1
X      � loop
b      � count=1 �
l=        �ChangeIcon(main%,icon(blue,blue(counter)),"","")
v      �
�J        �ChangeIcon(main%,icon(blue,blue(counter)),�(count-1),"sblue")
�      �
�      blue(counter)+=places
�	    �
�
�@    � blue(counter)>58 � blue(counter)=58-(blue(counter)-58)
�
�    � loop=0 � 3
�:      � icon(red,red(loop))=icon(blue,blue(counter)) �
�        red(loop)=0
�1        �ChangeIcon(main%,loop+77,"1","sred")
�      �
�
@      � icon(yellow,yellow(loop))=icon(blue,blue(counter)) �
        yellow(loop)=0
4        �ChangeIcon(main%,loop+85,"1","syellow")
       �
*
4>      � icon(green,green(loop))=icon(blue,blue(counter)) �
>        green(loop)=0
H3        �ChangeIcon(main%,loop+89,"1","sgreen")
R      �
\    � loop
f
p    count=0
z    � loop=0 � 3
�/      � blue(loop)=blue(counter) � count+=1
�    � loop
�
�D    �ChangeIcon(main%,icon(blue,blue(counter)),�(count),"sblue")
�  �
�
�!� * * MOVE YELLOW COUNTER * *
�
�� colour=yellow �
�    � yellow(counter)=0 �
�-      �ChangeIcon(main%,counter+85,"","")
�      yellow(counter)=1
�	    �
      count=0
      � loop=0 � 3
5        � yellow(loop)=yellow(counter) � count+=1
$      � loop
.      � count=1 �
8A        �ChangeIcon(main%,icon(yellow,yellow(counter)),"","")
B      �
LP        �ChangeIcon(main%,icon(yellow,yellow(counter)),�(count-1),"syellow")
V      �
`!      yellow(counter)+=places
j	    �
t
~F    � yellow(counter)>58 � yellow(counter)=58-(yellow(counter)-58)
�
�    � loop=0 � 3
�>      � icon(red,red(loop))=icon(yellow,yellow(counter)) �
�        red(loop)=0
�1        �ChangeIcon(main%,loop+77,"1","sred")
�      �
�
�@      � icon(blue,blue(loop))=icon(yellow,yellow(counter)) �
�        blue(loop)=0
�2        �ChangeIcon(main%,loop+81,"1","sblue")
�      �
�
B      � icon(green,green(loop))=icon(yellow,yellow(counter)) �

        green(loop)=0
3        �ChangeIcon(main%,loop+89,"1","sgreen")
      �
(    � loop
2
<    count=0
F    � loop=0 � 3
P3      � yellow(loop)=yellow(counter) � count+=1
Z    � loop
d
nJ    �ChangeIcon(main%,icon(yellow,yellow(counter)),�(count),"syellow")
x  �
�
� � * * MOVE GREEN COUNTER * *
�
�� colour=green �
�    � green(counter)=0 �
�-      �ChangeIcon(main%,counter+89,"","")
�      green(counter)=1
�	    �
�      count=0
�      � loop=0 � 3
�3        � green(loop)=green(counter) � count+=1
�      � loop
�      � count=1 �
?        �ChangeIcon(main%,icon(green,green(counter)),"","")
      �
M        �ChangeIcon(main%,icon(green,green(counter)),�(count-1),"sgreen")
"      �
,       green(counter)+=places
6	    �
@
JC    � green(counter)>58 � green(counter)=58-(green(counter)-58)
T
^    � loop=0 � 3
h<      � icon(red,red(loop))=icon(green,green(counter)) �
r        red(loop)=0
|1        �ChangeIcon(main%,loop+77,"1","sred")
�      �
�
�>      � icon(blue,blue(loop))=icon(green,green(counter)) �
�        blue(loop)=0
�2        �ChangeIcon(main%,loop+81,"1","sblue")
�      �
�
�B      � icon(yellow,yellow(loop))=icon(green,green(counter)) �
�        yellow(loop)=0
�4        �ChangeIcon(main%,loop+85,"1","syellow")
�      �
�    � loop
�    count=0

    � loop=0 � 3
1      � green(loop)=green(counter) � count+=1
&    � loop
0
:G    �ChangeIcon(main%,icon(green,green(counter)),�(count),"sgreen")
D  �
N
X  � �AllHome(colour)=� �
b    AllHome+=1
l8    �ChangeIcon(results%,AllHome-1,name$(colour),"")
v    �OpenWindow(results%)
�  �
�
�  � AllHome=NumPlayers �
�    �CloseWindow(dice%)
�  �
�    � dice<>6 �
�      �
�        turn+=1
�        � turn=4 � turn=red
�2      � �AllHome(turn)=� � PlayerType(turn)<>0
�	    �
�<    �ChangeIcon(dice%,1,name$(turn)+", Please click","")
�6    �ChangeIcon(dice%,2,"on the dice to roll.","")
    been=�
  �
�
 :
*��MenuSelect
4
>1� Check which entry selected in icon bar menu
H  � menflag%=1 �
R    Ȏ block%!0 �
\      � 1 : �NewGame
f(               �OpenWindow(players%)
p      � 2 : �
z	    �
�  �
�:
�'� check which item in menu selected
�
�  � menflag%=2
�    Ȏ block%!0 �
�      � 1 : �NewGame
�(               �OpenWindow(players%)
�	    �
�  �
�:
�&  ș "Wimp_GetPointerInfo",,block%
�  � block%!8=1 �
    Ȏ menflag% �
/      � 1 : ș "Wimp_CreateMenu",,IconMenu%
/      � 2 : ș "Wimp_CreateMenu",,MainMenu%
$	    �
.  �
8     ș "Wimp_CreateMenu",,-1
B    menflag%=0
L  �
V�
`:
j*��ChangeIcon(whan%,ihan%,text$,indir$)
t� change sprite of icon
~
�#  block%!0=whan%:block%!4=ihan%
�$  ș "Wimp_GetIconState",,block%
�  block%!8=0:block%!12=0
�  $(block%!28)=text$+�(13)
�  $(block%!32)=indir$+�(13)
�$  ș "Wimp_SetIconState",,block%
��
�:
�� �text(whan%,ihan%)
�#  block%!0=whan%:block%!4=ihan%
�$  ș "Wimp_GetIconState",,block%
�=$(block%!28)
:

� �Message
&    source%=block%!4:ref%=block%!8
    Ȏ block%!16 �
(    � 0 : quit%=�
2*    � 2 : �SaveFile(�gname(block%+44))
<    � 3 : �LoadFile
F    � 5 : �ClickLoad
P  �
Z�
d:
n� �reply(type%,reason%)
x  block%!0=256
�  block%!12=ref%
�  block%!16=reason%
�/  ș"Wimp_SendMessage",type%,block%,source%
��
�:
�ݤgname(a%):�f$:f$=""
�  ȕ ?a%>=32
�    f$+=�?a%:a%+=1
�  �
�=f$
�:
�� �save
�  Ȏ block%!16 �
(    � 1 : �CreateDragBox(savebox%,1)
    � 3 : �QuickSave
  �
"�
,:
6��QuickSave
@  fname$=�text(savebox%,2)
J  � �fname$,".") �
T    �SaveFile(fname$)
^  �
h�    �Error("To save the game either drag the file icon to a directory viewer, or enter a file name (including full path name).")
r  �
|�
�:
�"��CreateDragBox(window%,icon%)
�    block%!0=window%
�'    ș"Wimp_GetWindowState",,block%
�    ox=block%!4-block%!20
�    oy=block%!16-block%!24
�    block%!4=icon%
�%    ș"Wimp_GetIconState",,block%
�    !block%=window%
�    block%!4=5
�    block%!8+=ox
�    block%!12+=oy
�    block%!16+=ox
     block%!20+=oy
     block%!24=0
     block%!28=0
 &    block%!32=&7FFFFFFF
 0    block%!36=&7FFFFFFF
 :     ș"Wimp_DragBox",,block%
 D
 N    � drag%=� �
 X;      ș"DragASprite_Start",&CA,1,"file_777",block%+8,0
 b	    �
 l  �
 v�
 �:
 ���DragSave(fname$)
 �%  ș"Wimp_GetPointerInfo",,block%
 �  � block%!12=savebox% � �
 �%  block%!20=block%!12:block%!12=0
 �%  block%!24=block%!16:block%!16=1
 �$  block%!28=block%!0:block%!0=64
 �$  block%!32=block%!4:block%!36=0
 �2  block%!40=&777:$(block%+44)=�leaf(fname$)+�0
 �8  ș"Wimp_SendMessage",17,block%,block%!20,block%!24
 ��
 �:
 �ݤleaf(path$)
!  ȕ �path$,".")
!#    path$=�path$,�path$,".")+1)
!  �
! 
=path$
!*:
!4��SaveFile(fname$)
!>�  � � : � � � : �Error("To save the game either drag the file icon to a directory viewer, or enter a file name (including full path name)."):�
!H  file%=�(fname$)
!R    �#file%,NumPlayers
!\    �#file%,AllHome
!f    �#file%,dice
!p    �#file%,turn
!z    �#file%,been
!�
!�    � colour=0 � 3
!�$      �#file%,PlayerType(colour)
!�      �#file%,name$(colour)
!�    � colour
!�
!�    � counter=0 � 3
!�      �#file%,red(counter)
!�      �#file%,blue(counter)
!�!      �#file%,yellow(counter)
!�       �#file%,green(counter)
!�    � counter
!�
  �#file%
"   ș"OS_File",18,fname$,&777
"  ș"Wimp_CreateMenu",,-1
"  �CloseWindow(savebox%)
"$  �reply(17,3)
".'  �ChangeIcon(savebox%,2,fname$,"")
"8�
"B:
"L��ClickLoad
"V  � block%!40=&777 �
"`    �reply(17,4)
"j    �LoadFile
"t  �
"~�
"�:
"���LoadFile
"�  � block%!40=&777 �
"�     fname$=�gname(block%+44)
"�)    �ChangeIcon(savebox%,2,fname$,"")
"�    �ClearBoard
"�    file%=�(fname$)
"�
"�      �#file%,NumPlayers
"�      �#file%,AllHome
"�      �#file%,dice
"�      �#file%,turn
#      �#file%,been
#

#      � colour=0 � 3
#&        �#file%,PlayerType(colour)
#(!        �#file%,name$(colour)
#2      � colour
#<
#F      � counter=0 � 3
#P         �#file%,red(counter)
#Z!        �#file%,blue(counter)
#d#        �#file%,yellow(counter)
#n"        �#file%,green(counter)
#x      � counter
#�    �#file%
#�    started=�
#�    �InitBoard
#�    �OpenWindow(main%)
#�1    � AllHome<NumPlayers � �OpenWindow(dice%)
#�+    � AllHome>0 � �OpenWindow(results%)
#�  �
#��
#�:
#���OpenWindow(block%!0)
#�&  ș "Wimp_GetWindowState",,block%
#�"  ș "Wimp_OpenWindow",,block%
#��
$:
$��CloseWindow(block%!0)
$&  ș "Wimp_GetWindowState",,block%
$"#  ș "Wimp_CloseWindow",,block%
$,�
$6:
$@��Redraw
$J,  ș "Wimp_RedrawWindow",,block% � more%
$T4  xo%=block%!4-block%!20:yo%=block%!16-block%!24
$^
$h  ȕ more%
$r+    � put user redraw code in this loop
$|
$�.    ș "Wimp_GetRectangle",,block% � more%
$�  �
$��
$�:
$���PollLoop
$�� Check what is happening
$�
$�  �
$�(    ș "Wimp_Poll",,block% � reason%
$�    Ȏ reason% �
$�      � 1:�Redraw
$�*      � 2:ș "Wimp_OpenWindow",,block%
$�+      � 3:ș "Wimp_CloseWindow",,block%
%      � 6:�MouseClick
%*      � 7:�DragSave(�text(savebox%,2))
%      � 8:�KeyClick
%&      � 9:�MenuSelect
%0      � 17,18:�Message
%:	    �
%D
%NO    � PlayerType(turn)=Computer � AllHome<NumPlayers � started=� � been=� �
%X      �PollIdle(100)
%b      �dice
%l	    �
%v
%�O    � PlayerType(turn)=Computer � AllHome<NumPlayers � started=� � been=� �
%�      �PollIdle(100)
%�      �computer
%�	    �
%�
%�	  � �
%��
%�
%���PollIdle(time)
%�	  �=0
%�  �
%�1    ș "Wimp_PollIdle",,block%,time � reason%
%�    Ȏ reason% �
&      � 1:�Redraw
&*      � 2:ș "Wimp_OpenWindow",,block%
&+      � 3:ș "Wimp_CloseWindow",,block%
&       � 6:�MouseClick
&**      � 7:�DragSave(�text(savebox%,2))
&4      � 8:�KeyClick
&>      � 9:�MenuSelect
&H      � 17,18:�Message
&R	    �
&\  � �>time
&f�
&p
&z:
&���KeyClick
&�#  ș"Wimp_ProcessKey",block%!24
&�  Ȏ block%!0 �
&�.    � players% : � block%!24=&D � �players
&�0    � savebox% : � block%!24=&D � �QuickSave
&�  �
&��
&�
&�
��NewGame
&�   � Stuff to initialise game
&�
&�  ș "Wimp_CreateMenu",,-1
&�  menflag%=0
'
'  �CloseWindow(main%)
'  �CloseWindow(dice%)
'$  �CloseWindow(results%)
'.
'8  �ClearBoard
'B
'L  � counter=0 � 3
'V    red(counter)=0
'`    blue(counter)=0
'j    yellow(counter)=0
't    green(counter)=0
'~  � counter
'�
'�'  �ChangeIcon(main%,0,"","scenter")
'�  turn=red
'�  been=�:dice=1
'�
'�  started=�
'�  AllHome=0
'��
'�
'���ClearBoard
'�  � counter=0 � 3
'�
(    � red(counter)=0 �
(
-      �ChangeIcon(main%,77+counter,"","")
(	    �
(9      �ChangeIcon(main%,icon(red,red(counter)),"","")
((	    �
(2
(<    � blue(counter)=0 �
(F-      �ChangeIcon(main%,81+counter,"","")
(P	    �
(Z;      �ChangeIcon(main%,icon(blue,blue(counter)),"","")
(d	    �
(n
(x    � yellow(counter)=0 �
(�-      �ChangeIcon(main%,85+counter,"","")
(�	    �
(�?      �ChangeIcon(main%,icon(yellow,yellow(counter)),"","")
(�	    �
(�
(�    � green(counter)=0 �
(�-      �ChangeIcon(main%,89+counter,"","")
(�	    �
(�=      �ChangeIcon(main%,icon(green,green(counter)),"","")
(�	    �
(�	    �
(�
(�  � counter
)�
)
)��InitBoard
)"  � counter=0 � 3
),
)6    � PlayerType(red)<>� �
)@      � red(counter)=0 �
)J4        �ChangeIcon(main%,77+counter,"1","sred")
)T      �
)^@        �ChangeIcon(main%,icon(red,red(counter)),"1","sred")
)h      �
)r	    �
)|
)�    � PlayerType(blue)<>� �
)�      � blue(counter)=0 �
)�5        �ChangeIcon(main%,81+counter,"1","sblue")
)�      �
)�C        �ChangeIcon(main%,icon(blue,blue(counter)),"1","sblue")
)�      �
)�	    �
)�
)�!    � PlayerType(yellow)<>� �
)�      � yellow(counter)=0 �
)�7        �ChangeIcon(main%,85+counter,"1","syellow")
)�      �
)�I        �ChangeIcon(main%,icon(yellow,yellow(counter)),"1","syellow")
*      �
*	    �
*
*&     � PlayerType(green)<>� �
*0      � green(counter)=0 �
*:6        �ChangeIcon(main%,89+counter,"1","sgreen")
*D      �
*NF        �ChangeIcon(main%,icon(green,green(counter)),"1","sgreen")
*X      �
*b	    �
*l  � counter
*v-  �ChangeIcon(dice%,0,"","sdice"+�(dice))
*�  � been=� �
*�=     �ChangeIcon(dice%,1,name$(turn)+", Please click","")
*�7     �ChangeIcon(dice%,2,"on the dice to roll.","")
*�  �
*�<    �ChangeIcon(dice%,1,name$(turn)+", Please click","")
*�7    �ChangeIcon(dice%,2,"on the piece to move.","")
*�  �
*��
�
00000000  0d 00 0a 1a f4 20 3c 4c  75 64 6f 24 44 69 72 3e  |..... <Ludo$Dir>|
00000010  2e 21 52 75 6e 49 6d 61  67 65 0d 00 14 17 f4 20  |.!RunImage..... |
00000020  44 65 73 6b 74 6f 70 20  4c 75 64 6f 20 47 61 6d  |Desktop Ludo Gam|
00000030  65 0d 00 1e 13 f4 20 a9  20 41 2e 4c 2e 20 53 74  |e..... . A.L. St|
00000040  6f 6e 65 72 0d 00 28 16  f4 20 76 31 2e 32 31 20  |oner..(.. v1.21 |
00000050  28 32 35 2f 30 33 2f 39  34 29 0d 00 32 05 3a 0d  |(25/03/94)..2.:.|
00000060  00 3c 25 ee 20 85 20 f2  45 72 72 6f 72 28 f6 24  |.<%. . .Error(.$|
00000070  2b 22 20 61 74 20 6c 69  6e 65 20 22 2b c3 28 9e  |+" at line "+.(.|
00000080  29 29 3a e0 0d 00 46 05  3a 0d 00 50 09 f2 49 6e  |)):...F.:..P..In|
00000090  69 74 0d 00 5a 0d f2 4c  6f 61 64 44 61 74 61 0d  |it..Z..LoadData.|
000000a0  00 64 12 f2 4c 6f 61 64  54 65 6d 70 6c 61 74 65  |.d..LoadTemplate|
000000b0  73 0d 00 6e 10 f2 43 72  65 61 74 65 4d 65 6e 75  |s..n..CreateMenu|
000000c0  73 0d 00 78 10 f2 49 63  6f 6e 62 61 72 49 63 6f  |s..x..IconbarIco|
000000d0  6e 0d 00 82 0c f2 4e 65  77 47 61 6d 65 0d 00 8c  |n.....NewGame...|
000000e0  0d f2 50 6f 6c 6c 4c 6f  6f 70 0d 00 96 05 3a 0d  |..PollLoop....:.|
000000f0  00 a0 05 e0 0d 00 aa 05  3a 0d 00 b4 13 dd f2 45  |........:......E|
00000100  72 72 6f 72 28 65 72 72  6f 72 24 29 0d 00 be 20  |rror(error$)... |
00000110  20 20 c8 99 20 22 57 69  6d 70 5f 43 6f 6d 6d 61  |  .. "Wimp_Comma|
00000120  6e 64 57 69 6e 64 6f 77  22 2c 2d 31 0d 00 c8 2a  |ndWindow",-1...*|
00000130  20 20 21 65 72 72 62 6c  6b 25 3d 9f 3a 20 24 28  |  !errblk%=.: $(|
00000140  65 72 72 62 6c 6b 25 2b  34 29 3d 65 72 72 6f 72  |errblk%+4)=error|
00000150  24 2b bd 28 30 29 0d 00  d2 2f 20 20 c8 99 20 22  |$+.(0).../  .. "|
00000160  57 69 6d 70 5f 52 65 70  6f 72 74 45 72 72 6f 72  |Wimp_ReportError|
00000170  22 2c 65 72 72 62 6c 6b  25 2c 31 2c 61 70 70 5f  |",errblk%,1,app_|
00000180  6e 61 6d 65 24 0d 00 dc  05 e1 0d 00 e6 05 3a 0d  |name$.........:.|
00000190  00 f0 0a dd f2 49 6e 69  74 0d 00 fa 31 20 20 de  |.....Init...1  .|
000001a0  20 62 6c 6f 63 6b 25 20  26 38 30 30 30 2c 20 65  | block% &8000, e|
000001b0  72 72 62 6c 6b 25 20 26  31 30 30 2c 20 62 75 66  |rrblk% &100, buf|
000001c0  66 65 72 25 20 26 31 36  30 30 0d 01 04 25 20 20  |fer% &1600...%  |
000001d0  de 20 69 6e 64 62 75 66  66 25 20 26 36 30 30 2c  |. indbuff% &600,|
000001e0  20 68 61 6e 64 6c 65 73  25 20 26 32 30 30 30 0d  | handles% &2000.|
000001f0  01 0e 26 20 20 de 20 49  63 6f 6e 4d 65 6e 75 25  |..&  . IconMenu%|
00000200  20 26 32 30 30 2c 20 4d  61 69 6e 4d 65 6e 75 25  | &200, MainMenu%|
00000210  20 26 32 30 30 0d 01 18  19 20 20 de 20 73 70 72  | &200....  . spr|
00000220  69 74 65 61 72 65 61 20  39 2a 31 30 32 34 0d 01  |itearea 9*1024..|
00000230  22 04 0d 01 2c 27 20 20  de 20 69 63 6f 6e 28 33  |"...,'  . icon(3|
00000240  2c 35 38 29 20 20 3a 20  f4 20 63 6f 6c 6f 75 72  |,58)  : . colour|
00000250  2c 70 6f 73 69 74 69 6f  6e 0d 01 36 23 20 20 72  |,position..6#  r|
00000260  65 64 3d 30 3a 62 6c 75  65 3d 31 3a 79 65 6c 6c  |ed=0:blue=1:yell|
00000270  6f 77 3d 32 3a 67 72 65  65 6e 3d 33 0d 01 40 04  |ow=2:green=3..@.|
00000280  0d 01 4a 2a 20 20 e3 20  70 6f 73 3d 31 20 b8 20  |..J*  . pos=1 . |
00000290  35 38 3a 69 63 6f 6e 28  72 65 64 2c 70 6f 73 29  |58:icon(red,pos)|
000002a0  3d 70 6f 73 3a ed 20 70  6f 73 0d 01 54 04 0d 01  |=pos:. pos..T...|
000002b0  5e 2f 20 20 e3 20 70 6f  73 3d 30 31 20 b8 20 33  |^/  . pos=01 . 3|
000002c0  39 3a 69 63 6f 6e 28 62  6c 75 65 2c 70 6f 73 29  |9:icon(blue,pos)|
000002d0  3d 70 6f 73 2b 31 33 3a  ed 20 70 6f 73 0d 01 68  |=pos+13:. pos..h|
000002e0  2f 20 20 e3 20 70 6f 73  3d 34 30 20 b8 20 35 32  |/  . pos=40 . 52|
000002f0  3a 69 63 6f 6e 28 62 6c  75 65 2c 70 6f 73 29 3d  |:icon(blue,pos)=|
00000300  70 6f 73 2d 33 39 3a ed  20 70 6f 73 0d 01 72 2e  |pos-39:. pos..r.|
00000310  20 20 e3 20 70 6f 73 3d  35 33 20 b8 20 35 38 3a  |  . pos=53 . 58:|
00000320  69 63 6f 6e 28 62 6c 75  65 2c 70 6f 73 29 3d 70  |icon(blue,pos)=p|
00000330  6f 73 2b 36 3a ed 20 70  6f 73 0d 01 7c 04 0d 01  |os+6:. pos..|...|
00000340  86 31 20 20 e3 20 70 6f  73 3d 30 31 20 b8 20 32  |.1  . pos=01 . 2|
00000350  36 3a 69 63 6f 6e 28 79  65 6c 6c 6f 77 2c 70 6f  |6:icon(yellow,po|
00000360  73 29 3d 70 6f 73 2b 32  36 3a ed 20 70 6f 73 0d  |s)=pos+26:. pos.|
00000370  01 90 31 20 20 e3 20 70  6f 73 3d 32 37 20 b8 20  |..1  . pos=27 . |
00000380  35 32 3a 69 63 6f 6e 28  79 65 6c 6c 6f 77 2c 70  |52:icon(yellow,p|
00000390  6f 73 29 3d 70 6f 73 2d  32 36 3a ed 20 70 6f 73  |os)=pos-26:. pos|
000003a0  0d 01 9a 31 20 20 e3 20  70 6f 73 3d 35 33 20 b8  |...1  . pos=53 .|
000003b0  20 35 38 3a 69 63 6f 6e  28 79 65 6c 6c 6f 77 2c  | 58:icon(yellow,|
000003c0  70 6f 73 29 3d 70 6f 73  2b 31 32 3a ed 20 70 6f  |pos)=pos+12:. po|
000003d0  73 0d 01 a4 04 0d 01 ae  30 20 20 e3 20 70 6f 73  |s.......0  . pos|
000003e0  3d 30 31 20 b8 20 31 33  3a 69 63 6f 6e 28 67 72  |=01 . 13:icon(gr|
000003f0  65 65 6e 2c 70 6f 73 29  3d 70 6f 73 2b 33 39 3a  |een,pos)=pos+39:|
00000400  ed 20 70 6f 73 0d 01 b8  30 20 20 e3 20 70 6f 73  |. pos...0  . pos|
00000410  3d 31 34 20 b8 20 35 32  3a 69 63 6f 6e 28 67 72  |=14 . 52:icon(gr|
00000420  65 65 6e 2c 70 6f 73 29  3d 70 6f 73 2d 31 33 3a  |een,pos)=pos-13:|
00000430  ed 20 70 6f 73 0d 01 c2  30 20 20 e3 20 70 6f 73  |. pos...0  . pos|
00000440  3d 35 33 20 b8 20 35 38  3a 69 63 6f 6e 28 67 72  |=53 . 58:icon(gr|
00000450  65 65 6e 2c 70 6f 73 29  3d 70 6f 73 2b 31 38 3a  |een,pos)=pos+18:|
00000460  ed 20 70 6f 73 0d 01 cc  04 0d 01 d6 0e 20 20 de  |. pos........  .|
00000470  20 72 65 64 28 33 29 0d  01 e0 0f 20 20 de 20 62  | red(3)....  . b|
00000480  6c 75 65 28 33 29 0d 01  ea 11 20 20 de 20 79 65  |lue(3)....  . ye|
00000490  6c 6c 6f 77 28 33 29 0d  01 f4 10 20 20 de 20 67  |llow(3)....  . g|
000004a0  72 65 65 6e 28 33 29 0d  01 fe 04 0d 02 08 10 20  |reen(3)........ |
000004b0  20 de 20 6e 61 6d 65 24  28 33 29 0d 02 12 15 20  | . name$(3).... |
000004c0  20 de 20 50 6c 61 79 65  72 54 79 70 65 28 33 29  | . PlayerType(3)|
000004d0  0d 02 1c 18 20 20 48 75  6d 61 6e 3d 31 3a 43 6f  |....  Human=1:Co|
000004e0  6d 70 75 74 65 72 3d 32  0d 02 26 1c 20 20 4e 75  |mputer=2..&.  Nu|
000004f0  6d 50 6c 61 79 65 72 73  3d 34 3a 41 6c 6c 48 6f  |mPlayers=4:AllHo|
00000500  6d 65 3d 30 0d 02 30 04  0d 02 3a 0d 20 20 64 72  |me=0..0...:.  dr|
00000510  61 67 25 3d b9 0d 02 44  04 0d 02 4e 1e 20 20 61  |ag%=...D...N.  a|
00000520  70 70 5f 6e 61 6d 65 24  3d 22 44 65 73 6b 74 6f  |pp_name$="Deskto|
00000530  70 20 4c 75 64 6f 22 0d  02 58 14 20 20 24 62 6c  |p Ludo"..X.  $bl|
00000540  6f 63 6b 25 3d 22 54 41  53 4b 22 0d 02 62 41 20  |ock%="TASK"..bA |
00000550  20 c8 99 20 22 57 69 6d  70 5f 49 6e 69 74 69 61  | .. "Wimp_Initia|
00000560  6c 69 73 65 22 2c 32 30  30 2c 21 62 6c 6f 63 6b  |lise",200,!block|
00000570  25 2c 61 70 70 5f 6e 61  6d 65 24 20 b8 20 76 65  |%,app_name$ . ve|
00000580  72 73 69 6f 6e 25 2c 74  61 73 6b 25 0d 02 6c 13  |rsion%,task%..l.|
00000590  20 20 67 72 65 79 25 3d  26 34 30 30 30 30 30 0d  |  grey%=&400000.|
000005a0  02 76 16 20 20 62 6c 61  63 6b 25 3d 26 46 46 42  |.v.  black%=&FFB|
000005b0  46 46 46 46 46 0d 02 80  0a 20 20 6f 6e 3d 31 0d  |FFFFF....  on=1.|
000005c0  02 8a 0b 20 20 6f 66 66  3d 30 0d 02 94 05 e1 0d  |...  off=0......|
000005d0  02 9e 05 3a 0d 02 a8 0e  dd f2 4c 6f 61 64 44 61  |...:......LoadDa|
000005e0  74 61 0d 02 b2 04 0d 02  bc 25 f4 20 72 6f 75 74  |ta.......%. rout|
000005f0  69 6e 65 20 74 6f 20 6c  6f 61 64 20 61 6e 79 20  |ine to load any |
00000600  64 61 74 61 20 6e 65 65  64 65 64 0d 02 c6 04 0d  |data needed.....|
00000610  02 d0 34 20 20 73 70 72  69 74 65 61 72 65 61 21  |..4  spritearea!|
00000620  30 3d 28 39 2a 31 30 32  34 29 20 20 3a 20 f4 20  |0=(9*1024)  : . |
00000630  73 69 7a 65 20 6f 66 20  73 70 72 69 74 65 20 61  |size of sprite a|
00000640  72 65 61 0d 02 da 37 20  20 73 70 72 69 74 65 61  |rea...7  spritea|
00000650  72 65 61 21 38 3d 31 36  20 20 20 20 20 20 20 20  |rea!8=16        |
00000660  3a 20 f4 20 6f 66 66 73  65 74 20 74 6f 20 66 69  |: . offset to fi|
00000670  72 73 74 20 73 70 72 69  74 65 0d 02 e4 44 20 20  |rst sprite...D  |
00000680  c8 99 20 22 4f 53 5f 53  70 72 69 74 65 4f 70 22  |.. "OS_SpriteOp"|
00000690  2c 32 35 36 2b 39 2c 73  70 72 69 74 65 61 72 65  |,256+9,spriteare|
000006a0  61 20 20 3a 20 f4 20 73  65 74 20 75 70 20 75 73  |a  : . set up us|
000006b0  65 72 20 73 70 72 69 74  65 20 61 72 65 61 0d 02  |er sprite area..|
000006c0  ee 3d 20 20 c8 99 20 22  4f 53 5f 53 70 72 69 74  |.=  .. "OS_Sprit|
000006d0  65 4f 70 22 2c 32 35 36  2b 31 30 2c 73 70 72 69  |eOp",256+10,spri|
000006e0  74 65 61 72 65 61 2c 22  3c 4c 75 64 6f 24 44 69  |tearea,"<Ludo$Di|
000006f0  72 3e 2e 53 70 72 69 74  65 73 22 0d 02 f8 04 0d  |r>.Sprites".....|
00000700  03 02 05 e1 0d 03 0c 05  3a 0d 03 16 13 dd f2 4c  |........:......L|
00000710  6f 61 64 54 65 6d 70 6c  61 74 65 73 0d 03 20 1b  |oadTemplates.. .|
00000720  f4 20 4c 6f 61 64 20 77  69 6e 64 6f 77 20 74 65  |. Load window te|
00000730  6d 70 6c 61 74 65 73 0d  03 2a 04 0d 03 34 34 20  |mplates..*...44 |
00000740  20 c8 99 20 22 57 69 6d  70 5f 4f 70 65 6e 54 65  | .. "Wimp_OpenTe|
00000750  6d 70 6c 61 74 65 22 2c  2c 22 3c 4c 75 64 6f 24  |mplate",,"<Ludo$|
00000760  44 69 72 3e 2e 54 65 6d  70 6c 61 74 65 73 22 0d  |Dir>.Templates".|
00000770  03 3e 22 20 20 70 6c 61  79 65 72 73 25 3d a4 74  |.>"  players%=.t|
00000780  77 69 6e 64 6f 77 28 22  50 6c 61 79 65 72 73 22  |window("Players"|
00000790  29 0d 03 48 1c 20 20 6d  61 69 6e 25 3d a4 74 77  |)..H.  main%=.tw|
000007a0  69 6e 64 6f 77 28 22 4d  61 69 6e 22 29 0d 03 52  |indow("Main")..R|
000007b0  1c 20 20 64 69 63 65 25  3d a4 74 77 69 6e 64 6f  |.  dice%=.twindo|
000007c0  77 28 22 44 69 63 65 22  29 0d 03 5c 22 20 20 72  |w("Dice")..\"  r|
000007d0  65 73 75 6c 74 73 25 3d  a4 74 77 69 6e 64 6f 77  |esults%=.twindow|
000007e0  28 22 52 65 73 75 6c 74  73 22 29 0d 03 66 24 20  |("Results")..f$ |
000007f0  20 70 72 6f 67 69 6e 66  6f 25 3d a4 74 77 69 6e  | proginfo%=.twin|
00000800  64 6f 77 28 22 50 72 6f  67 49 6e 66 6f 22 29 0d  |dow("ProgInfo").|
00000810  03 70 22 20 20 73 61 76  65 62 6f 78 25 3d a4 74  |.p"  savebox%=.t|
00000820  77 69 6e 64 6f 77 28 22  53 61 76 65 42 6f 78 22  |window("SaveBox"|
00000830  29 0d 03 7a 1d 20 20 c8  99 20 22 57 69 6d 70 5f  |)..z.  .. "Wimp_|
00000840  43 6c 6f 73 65 54 65 6d  70 6c 61 74 65 22 0d 03  |CloseTemplate"..|
00000850  84 05 e1 0d 03 8e 05 3a  0d 03 98 13 dd a4 74 77  |.......:......tw|
00000860  69 6e 64 6f 77 28 77 69  6e 24 29 0d 03 a2 14 f4  |indow(win$).....|
00000870  20 63 72 65 61 74 65 20  77 69 6e 64 6f 77 73 0d  | create windows.|
00000880  03 ac 04 0d 03 b6 1c 20  20 62 75 66 66 65 6e 64  |.......  buffend|
00000890  25 3d 62 75 66 66 65 72  25 2b 26 31 36 30 30 0d  |%=buffer%+&1600.|
000008a0  03 c0 49 20 20 c8 99 20  22 57 69 6d 70 5f 4c 6f  |..I  .. "Wimp_Lo|
000008b0  61 64 54 65 6d 70 6c 61  74 65 22 2c 2c 62 6c 6f  |adTemplate",,blo|
000008c0  63 6b 25 2c 62 75 66 66  65 72 25 2c 62 75 66 66  |ck%,buffer%,buff|
000008d0  65 6e 64 25 2c 2d 31 2c  77 69 6e 24 20 b8 20 2c  |end%,-1,win$ . ,|
000008e0  2c 62 75 66 66 65 72 25  0d 03 ca 40 20 20 62 6c  |,buffer%...@  bl|
000008f0  6f 63 6b 25 21 36 34 3d  73 70 72 69 74 65 61 72  |ock%!64=spritear|
00000900  65 61 20 20 20 3a 20 f4  20 75 73 65 20 75 73 65  |ea   : . use use|
00000910  72 20 73 70 72 69 74 65  20 61 72 65 61 20 66 6f  |r sprite area fo|
00000920  72 20 77 69 6e 64 6f 77  0d 03 d4 2b 20 20 c8 99  |r window...+  ..|
00000930  20 22 57 69 6d 70 5f 43  72 65 61 74 65 57 69 6e  | "Wimp_CreateWin|
00000940  64 6f 77 22 2c 2c 62 6c  6f 63 6b 25 20 b8 20 68  |dow",,block% . h|
00000950  61 6e 25 0d 03 de 09 3d  68 61 6e 25 0d 03 e8 05  |an%....=han%....|
00000960  3a 0d 03 f2 11 dd f2 49  63 6f 6e 62 61 72 49 63  |:......IconbarIc|
00000970  6f 6e 0d 03 fc 1a f4 20  50 75 74 20 49 63 6f 6e  |on..... Put Icon|
00000980  20 6f 6e 20 49 63 6f 6e  20 42 61 72 0d 04 06 04  | on Icon Bar....|
00000990  0d 04 10 1e 20 20 ea 20  73 73 78 25 2c 73 73 79  |....  . ssx%,ssy|
000009a0  25 2c 73 73 6d 25 2c 70  78 25 2c 70 79 25 0d 04  |%,ssm%,px%,py%..|
000009b0  1a 39 20 20 c8 99 20 22  57 69 6d 70 5f 53 70 72  |.9  .. "Wimp_Spr|
000009c0  69 74 65 4f 70 22 2c 34  30 2c 2c 22 21 4c 75 64  |iteOp",40,,"!Lud|
000009d0  6f 22 20 b8 20 2c 2c 2c  73 73 78 25 2c 73 73 79  |o" . ,,,ssx%,ssy|
000009e0  25 2c 2c 73 73 6d 25 0d  04 24 3d 20 20 c8 99 20  |%,,ssm%..$=  .. |
000009f0  22 4f 53 5f 52 65 61 64  4d 6f 64 65 56 61 72 69  |"OS_ReadModeVari|
00000a00  61 62 6c 65 22 2c 73 73  6d 25 2c 34 20 b8 20 2c  |able",ssm%,4 . ,|
00000a10  2c 70 78 25 3a 20 73 73  78 25 3d 73 73 78 25 3c  |,px%: ssx%=ssx%<|
00000a20  3c 70 78 25 0d 04 2e 3d  20 20 c8 99 20 22 4f 53  |<px%...=  .. "OS|
00000a30  5f 52 65 61 64 4d 6f 64  65 56 61 72 69 61 62 6c  |_ReadModeVariabl|
00000a40  65 22 2c 73 73 6d 25 2c  35 20 b8 20 2c 2c 70 79  |e",ssm%,5 . ,,py|
00000a50  25 3a 20 73 73 79 25 3d  73 73 79 25 3c 3c 70 79  |%: ssy%=ssy%<<py|
00000a60  25 0d 04 38 07 20 20 3a  0d 04 42 27 20 20 62 6c  |%..8.  :..B'  bl|
00000a70  6f 63 6b 25 21 30 3d 2d  31 3a 62 6c 6f 63 6b 25  |ock%!0=-1:block%|
00000a80  21 34 3d 30 3a 62 6c 6f  63 6b 25 21 38 3d 30 0d  |!4=0:block%!8=0.|
00000a90  04 4c 32 20 20 62 6c 6f  63 6b 25 21 31 32 3d 62  |.L2  block%!12=b|
00000aa0  6c 6f 63 6b 25 21 34 2b  73 73 78 25 2b 31 30 3a  |lock%!4+ssx%+10:|
00000ab0  62 6c 6f 63 6b 25 21 31  36 3d 32 30 2b 73 73 79  |block%!16=20+ssy|
00000ac0  25 0d 04 56 15 20 20 62  6c 6f 63 6b 25 21 32 30  |%..V.  block%!20|
00000ad0  3d 26 33 30 30 32 0d 04  60 1a 20 20 24 28 62 6c  |=&3002..`.  $(bl|
00000ae0  6f 63 6b 25 2b 32 34 29  3d 22 21 4c 75 64 6f 22  |ock%+24)="!Ludo"|
00000af0  0d 04 6a 2d 20 20 c8 99  20 22 57 69 6d 70 5f 43  |..j-  .. "Wimp_C|
00000b00  72 65 61 74 65 49 63 6f  6e 22 2c 2c 62 6c 6f 63  |reateIcon",,bloc|
00000b10  6b 25 20 b8 20 69 68 61  6e 64 6c 65 25 0d 04 74  |k% . ihandle%..t|
00000b20  05 e1 0d 04 7e 05 3a 0d  04 88 11 dd f2 43 72 65  |....~.:......Cre|
00000b30  61 74 65 4d 65 6e 75 73  0d 04 92 12 f4 20 43 72  |ateMenus..... Cr|
00000b40  65 61 74 65 20 4d 65 6e  75 73 0d 04 9c 04 0d 04  |eate Menus......|
00000b50  a6 34 20 20 f2 44 72 61  77 4d 65 6e 75 28 49 63  |.4  .DrawMenu(Ic|
00000b60  6f 6e 4d 65 6e 75 25 2c  22 4c 75 64 6f 2c 49 6e  |onMenu%,"Ludo,In|
00000b70  66 6f 2c 4e 65 77 20 47  61 6d 65 2c 51 75 69 74  |fo,New Game,Quit|
00000b80  22 29 0d 04 b0 1a 20 20  49 63 6f 6e 4d 65 6e 75  |")....  IconMenu|
00000b90  25 21 31 36 3d 38 2a 31  36 2b 31 32 0d 04 ba 24  |%!16=8*16+12...$|
00000ba0  20 20 49 63 6f 6e 4d 65  6e 75 25 21 28 28 32 34  |  IconMenu%!((24|
00000bb0  2a 31 29 2b 38 29 3d 70  72 6f 67 69 6e 66 6f 25  |*1)+8)=proginfo%|
00000bc0  0d 04 c4 04 0d 04 ce 2f  20 20 f2 44 72 61 77 4d  |......./  .DrawM|
00000bd0  65 6e 75 28 4d 61 69 6e  4d 65 6e 75 25 2c 22 4c  |enu(MainMenu%,"L|
00000be0  75 64 6f 2c 53 61 76 65  2c 4e 65 77 20 47 61 6d  |udo,Save,New Gam|
00000bf0  65 22 29 0d 04 d8 1a 20  20 4d 61 69 6e 4d 65 6e  |e")....  MainMen|
00000c00  75 25 21 31 36 3d 38 2a  31 36 2b 31 32 0d 04 e2  |u%!16=8*16+12...|
00000c10  23 20 20 4d 61 69 6e 4d  65 6e 75 25 21 28 28 32  |#  MainMenu%!((2|
00000c20  34 2a 31 29 2b 38 29 3d  73 61 76 65 62 6f 78 25  |4*1)+8)=savebox%|
00000c30  0d 04 ec 04 0d 04 f6 05  e1 0d 05 00 05 3a 0d 05  |.............:..|
00000c40  0a 1b dd f2 44 72 61 77  4d 65 6e 75 28 6d 65 6e  |....DrawMenu(men|
00000c50  75 25 2c 6d 65 6e 75 24  29 0d 05 14 31 20 20 6d  |u%,menu$)...1  m|
00000c60  65 6e 75 25 3f 31 32 3d  37 3a 6d 65 6e 75 25 3f  |enu%?12=7:menu%?|
00000c70  31 33 3d 32 3a 6d 65 6e  75 25 3f 31 34 3d 37 3a  |13=2:menu%?14=7:|
00000c80  6d 65 6e 75 25 3f 31 35  3d 30 0d 05 1e 45 20 20  |menu%?15=0...E  |
00000c90  6d 65 6e 75 25 21 31 36  3d a7 6d 65 6e 75 24 2c  |menu%!16=.menu$,|
00000ca0  22 2c 22 29 2a 31 36 2b  31 32 3a 6d 65 6e 75 25  |",")*16+12:menu%|
00000cb0  21 32 30 3d 34 34 3a 6d  65 6e 75 25 21 32 34 3d  |!20=44:menu%!24=|
00000cc0  30 3a 70 74 72 25 3d 6d  65 6e 75 25 2b 32 38 0d  |0:ptr%=menu%+28.|
00000cd0  05 28 38 20 20 24 6d 65  6e 75 25 3d c0 6d 65 6e  |.(8  $menu%=.men|
00000ce0  75 24 2c a7 6d 65 6e 75  24 2c 22 2c 22 29 2d 31  |u$,.menu$,",")-1|
00000cf0  29 3a 6d 65 6e 75 24 2b  3d 22 2c 22 3a 65 6e 74  |):menu$+=",":ent|
00000d00  72 69 65 73 25 3d 30 0d  05 32 12 20 20 c8 95 20  |ries%=0..2.  .. |
00000d10  6d 65 6e 75 24 3c 3e 22  22 0d 05 3c 23 20 20 20  |menu$<>""..<#   |
00000d20  20 6d 65 6e 75 24 3d c1  6d 65 6e 75 24 2c a7 6d  | menu$=.menu$,.m|
00000d30  65 6e 75 24 2c 22 2c 22  29 2b 31 29 0d 05 46 15  |enu$,",")+1)..F.|
00000d40  20 20 20 20 e7 20 6d 65  6e 75 24 3c 3e 22 22 20  |    . menu$<>"" |
00000d50  8c 0d 05 50 1b 20 20 20  20 20 20 21 70 74 72 25  |...P.      !ptr%|
00000d60  3d 30 3a 70 74 72 25 21  34 3d 2d 31 0d 05 5a 19  |=0:ptr%!4=-1..Z.|
00000d70  20 20 20 20 20 20 70 74  72 25 21 38 3d 26 37 30  |      ptr%!8=&70|
00000d80  30 30 30 32 31 0d 05 64  2a 20 20 20 20 20 20 24  |00021..d*      $|
00000d90  28 70 74 72 25 2b 31 32  29 3d c0 6d 65 6e 75 24  |(ptr%+12)=.menu$|
00000da0  2c a7 6d 65 6e 75 24 2c  22 2c 22 29 2d 31 29 0d  |,.menu$,",")-1).|
00000db0  05 6e 1e 20 20 20 20 20  20 70 74 72 25 2b 3d 32  |.n.      ptr%+=2|
00000dc0  34 3a 65 6e 74 72 69 65  73 25 2b 3d 31 0d 05 78  |4:entries%+=1..x|
00000dd0  09 20 20 20 20 cd 0d 05  82 07 20 20 ce 0d 05 8c  |.    .....  ....|
00000de0  1d 20 20 70 74 72 25 21  2d 32 34 3d 70 74 72 25  |.  ptr%!-24=ptr%|
00000df0  21 2d 32 34 20 84 20 26  38 30 0d 05 96 05 e1 0d  |!-24 . &80......|
00000e00  05 a0 05 3a 0d 05 aa 10  dd f2 4d 6f 75 73 65 43  |...:......MouseC|
00000e10  6c 69 63 6b 0d 05 b4 14  20 20 c8 8e 20 62 6c 6f  |lick....  .. blo|
00000e20  63 6b 25 21 31 32 20 ca  0d 05 be 48 20 20 20 20  |ck%!12 ....H    |
00000e30  c9 20 2d 32 20 20 20 20  20 20 20 3a 20 f2 49 63  |. -2       : .Ic|
00000e40  6f 6e 4d 6f 75 73 65 20  20 3a f4 20 49 66 20 62  |onMouse  :. If b|
00000e50  75 74 74 6f 6e 20 70 72  65 73 73 65 64 20 6f 76  |utton pressed ov|
00000e60  65 72 20 69 63 6f 6e 20  62 61 72 20 69 63 6f 6e  |er icon bar icon|
00000e70  0d 05 c8 12 20 20 20 20  c9 20 70 6c 61 79 65 72  |....    . player|
00000e80  73 25 0d 05 d2 36 20 20  20 20 20 20 e7 20 28 62  |s%...6      . (b|
00000e90  6c 6f 63 6b 25 21 38 20  80 20 32 29 3d 30 20 80  |lock%!8 . 2)=0 .|
00000ea0  20 62 6c 6f 63 6b 25 21  31 36 3d 31 32 20 8c 20  | block%!16=12 . |
00000eb0  f2 70 6c 61 79 65 72 73  0d 05 dc 4e 20 20 20 20  |.players...N    |
00000ec0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
*
00000ee0  f4 20 49 66 20 62 75 74  74 6f 6e 20 70 72 65 73  |. If button pres|
00000ef0  73 65 64 20 6f 76 65 72  20 70 6c 61 79 65 72 20  |sed over player |
00000f00  77 69 6e 64 6f 77 0d 05  e6 46 20 20 20 20 c9 20  |window...F    . |
00000f10  6d 61 69 6e 25 20 20 20  20 3a 20 f2 6d 61 69 6e  |main%    : .main|
00000f20  20 20 20 20 20 20 20 3a  f4 20 49 66 20 62 75 74  |       :. If but|
00000f30  74 6f 6e 20 70 72 65 73  73 65 64 20 6f 76 65 72  |ton pressed over|
00000f40  20 6d 61 69 6e 20 77 69  6e 64 6f 77 0d 05 f0 35  | main window...5|
00000f50  20 20 20 20 c9 20 64 69  63 65 25 20 20 20 20 3a  |    . dice%    :|
00000f60  20 e7 20 50 6c 61 79 65  72 54 79 70 65 28 74 75  | . PlayerType(tu|
00000f70  72 6e 29 3d 48 75 6d 61  6e 20 8c 20 f2 64 69 63  |rn)=Human . .dic|
00000f80  65 0d 05 fa 4c 20 20 20  20 20 20 20 20 20 20 20  |e...L           |
00000f90  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000fa0  20 20 20 20 20 20 20 20  20 f4 20 49 66 20 62 75  |         . If bu|
00000fb0  74 74 6f 6e 20 70 72 65  73 73 65 64 20 6f 76 65  |tton pressed ove|
00000fc0  72 20 64 69 63 65 20 77  69 6e 64 6f 77 0d 06 04  |r dice window...|
00000fd0  46 20 20 20 20 c9 20 73  61 76 65 62 6f 78 25 20  |F    . savebox% |
00000fe0  3a 20 f2 73 61 76 65 20  20 20 20 20 20 20 3a f4  |: .save       :.|
00000ff0  20 49 66 20 62 75 74 74  6f 6e 20 70 72 65 73 73  | If button press|
00001000  65 64 20 6f 76 65 72 20  73 61 76 65 20 77 69 6e  |ed over save win|
00001010  64 6f 77 0d 06 0e 07 20  20 cb 0d 06 18 05 e1 0d  |dow....  .......|
00001020  06 22 05 3a 0d 06 2c 0f  dd f2 49 63 6f 6e 4d 6f  |.".:..,...IconMo|
00001030  75 73 65 0d 06 36 2f f4  20 49 66 20 4d 65 6e 75  |use..6/. If Menu|
00001040  20 62 75 74 74 6f 6e 20  70 72 65 73 73 65 64 20  | button pressed |
00001050  64 72 61 77 20 69 63 6f  6e 20 62 61 72 20 6d 65  |draw icon bar me|
00001060  6e 75 0d 06 40 32 f4 20  69 66 20 53 65 6c 65 63  |nu..@2. if Selec|
00001070  74 20 6f 72 20 41 64 6a  75 73 74 20 70 72 65 73  |t or Adjust pres|
00001080  73 65 64 20 64 72 61 77  20 6d 61 69 6e 20 77 69  |sed draw main wi|
00001090  6e 64 6f 77 0d 06 4a 04  0d 06 54 16 20 20 e7 20  |ndow..J...T.  . |
000010a0  62 6c 6f 63 6b 25 21 38  20 80 20 32 20 8c 0d 06  |block%!8 . 2 ...|
000010b0  5e 12 20 20 20 20 78 25  3d 21 62 6c 6f 63 6b 25  |^.    x%=!block%|
000010c0  0d 06 68 3f 20 20 20 20  c8 99 20 22 57 69 6d 70  |..h?    .. "Wimp|
000010d0  5f 43 72 65 61 74 65 4d  65 6e 75 22 2c 2c 49 63  |_CreateMenu",,Ic|
000010e0  6f 6e 4d 65 6e 75 25 2c  78 25 2d 36 34 2c 39 36  |onMenu%,x%-64,96|
000010f0  2b 31 33 32 3a 6d 65 6e  66 6c 61 67 25 3d 31 0d  |+132:menflag%=1.|
00001100  06 72 07 20 20 cc 0d 06  7c 15 20 20 20 20 e7 20  |.r.  ...|.    . |
00001110  73 74 61 72 74 65 64 3d  a3 20 8c 0d 06 86 1f 20  |started=. ..... |
00001120  20 20 20 20 20 f2 4f 70  65 6e 57 69 6e 64 6f 77  |     .OpenWindow|
00001130  28 70 6c 61 79 65 72 73  25 29 0d 06 90 09 20 20  |(players%)....  |
00001140  20 20 cc 0d 06 9a 1c 20  20 20 20 20 20 f2 4f 70  |  .....      .Op|
00001150  65 6e 57 69 6e 64 6f 77  28 6d 61 69 6e 25 29 0d  |enWindow(main%).|
00001160  06 a4 33 20 20 20 20 20  20 e7 20 41 6c 6c 48 6f  |..3      . AllHo|
00001170  6d 65 3c 4e 75 6d 50 6c  61 79 65 72 73 20 8c 20  |me<NumPlayers . |
00001180  f2 4f 70 65 6e 57 69 6e  64 6f 77 28 64 69 63 65  |.OpenWindow(dice|
00001190  25 29 0d 06 ae 2d 20 20  20 20 20 20 e7 20 41 6c  |%)...-      . Al|
000011a0  6c 48 6f 6d 65 3e 30 20  8c 20 f2 4f 70 65 6e 57  |lHome>0 . .OpenW|
000011b0  69 6e 64 6f 77 28 72 65  73 75 6c 74 73 25 29 0d  |indow(results%).|
000011c0  06 b8 09 20 20 20 20 cd  0d 06 c2 07 20 20 cd 0d  |...    .....  ..|
000011d0  06 cc 05 e1 0d 06 d6 05  3a 0d 06 e0 0d dd f2 70  |........:......p|
000011e0  6c 61 79 65 72 73 0d 06  ea 04 0d 06 f4 12 20 20  |layers........  |
000011f0  4e 75 6d 50 6c 61 79 65  72 73 3d 30 0d 06 fe 14  |NumPlayers=0....|
00001200  20 20 e3 20 70 6c 61 79  65 72 3d 30 20 b8 20 33  |  . player=0 . 3|
00001210  0d 07 08 33 20 20 20 20  6e 61 6d 65 24 28 70 6c  |...3    name$(pl|
00001220  61 79 65 72 29 3d a4 47  65 74 49 63 6f 6e 54 65  |ayer)=.GetIconTe|
00001230  78 74 28 70 6c 61 79 65  72 73 25 2c 70 6c 61 79  |xt(players%,play|
00001240  65 72 29 0d 07 12 2f 20  20 20 20 50 6c 61 79 65  |er).../    Playe|
00001250  72 54 79 70 65 28 70 6c  61 79 65 72 29 3d a4 50  |rType(player)=.P|
00001260  6c 61 79 65 72 53 74 61  74 65 28 70 6c 61 79 65  |layerState(playe|
00001270  72 29 0d 07 1c 2f 20 20  20 20 e7 20 50 6c 61 79  |r).../    . Play|
00001280  65 72 54 79 70 65 28 70  6c 61 79 65 72 29 3c 3e  |erType(player)<>|
00001290  30 20 8c 20 4e 75 6d 50  6c 61 79 65 72 73 2b 3d  |0 . NumPlayers+=|
000012a0  31 0d 07 26 0e 20 20 ed  20 70 6c 61 79 65 72 0d  |1..&.  . player.|
000012b0  07 30 46 20 20 e7 20 4e  75 6d 50 6c 61 79 65 72  |.0F  . NumPlayer|
000012c0  73 3d 30 20 8c 20 f2 45  72 72 6f 72 28 22 59 6f  |s=0 . .Error("Yo|
000012d0  75 20 6d 75 73 74 20 68  61 76 65 20 61 74 20 6c  |u must have at l|
000012e0  65 61 73 74 20 6f 6e 65  20 70 6c 61 79 65 72 20  |east one player |
000012f0  21 22 29 3a e1 0d 07 3a  10 20 20 f2 49 6e 69 74  |!"):...:.  .Init|
00001300  42 6f 61 72 64 0d 07 44  0f 20 20 73 74 61 72 74  |Board..D.  start|
00001310  65 64 3d b9 0d 07 4e 0e  20 20 74 75 72 6e 3d 72  |ed=...N.  turn=r|
00001320  65 64 0d 07 58 3c 20 20  e7 20 50 6c 61 79 65 72  |ed..X<  . Player|
00001330  54 79 70 65 28 74 75 72  6e 29 3d a3 20 8c 20 f5  |Type(turn)=. . .|
00001340  3a 74 75 72 6e 2b 3d 31  3a fd 20 50 6c 61 79 65  |:turn+=1:. Playe|
00001350  72 54 79 70 65 28 74 75  72 6e 29 3c 3e a3 0d 07  |rType(turn)<>...|
00001360  62 1c 20 20 f2 43 6c 6f  73 65 57 69 6e 64 6f 77  |b.  .CloseWindow|
00001370  28 70 6c 61 79 65 72 73  25 29 0d 07 6c 18 20 20  |(players%)..l.  |
00001380  f2 4f 70 65 6e 57 69 6e  64 6f 77 28 6d 61 69 6e  |.OpenWindow(main|
00001390  25 29 0d 07 76 3a 20 20  f2 43 68 61 6e 67 65 49  |%)..v:  .ChangeI|
000013a0  63 6f 6e 28 64 69 63 65  25 2c 31 2c 6e 61 6d 65  |con(dice%,1,name|
000013b0  24 28 74 75 72 6e 29 2b  22 2c 20 50 6c 65 61 73  |$(turn)+", Pleas|
000013c0  65 20 63 6c 69 63 6b 22  2c 22 22 29 0d 07 80 33  |e click","")...3|
000013d0  20 20 f2 43 68 61 6e 67  65 49 63 6f 6e 28 64 69  |  .ChangeIcon(di|
000013e0  63 65 25 2c 32 2c 22 6f  6e 20 74 68 65 20 64 69  |ce%,2,"on the di|
000013f0  65 20 74 6f 20 72 6f 6c  6c 2e 22 2c 22 22 29 0d  |e to roll.","").|
00001400  07 8a 18 20 20 f2 4f 70  65 6e 57 69 6e 64 6f 77  |...  .OpenWindow|
00001410  28 64 69 63 65 25 29 0d  07 94 05 e1 0d 07 9e 05  |(dice%).........|
00001420  3a 0d 07 a8 24 dd a4 47  65 74 49 63 6f 6e 54 65  |:...$..GetIconTe|
00001430  78 74 28 62 6c 6f 63 6b  25 21 30 2c 62 6c 6f 63  |xt(block%!0,bloc|
00001440  6b 25 21 34 29 0d 07 b2  24 20 20 c8 99 20 22 57  |k%!4)...$  .. "W|
00001450  69 6d 70 5f 47 65 74 49  63 6f 6e 53 74 61 74 65  |imp_GetIconState|
00001460  22 2c 2c 62 6c 6f 63 6b  25 0d 07 bc 13 20 20 3d  |",,block%....  =|
00001470  24 28 62 6c 6f 63 6b 25  21 32 38 29 0d 07 c6 05  |$(block%!28)....|
00001480  3a 0d 07 d0 19 dd a4 50  6c 61 79 65 72 53 74 61  |:......PlayerSta|
00001490  74 65 28 70 6c 61 79 65  72 29 0d 07 da 20 f4 20  |te(player)... . |
000014a0  46 69 6e 64 20 6f 75 74  20 77 68 69 63 68 20 70  |Find out which p|
000014b0  6c 61 79 65 72 20 74 79  70 65 0d 07 e4 13 f4 20  |layer type..... |
000014c0  30 20 3d 20 4e 6f 20 50  6c 61 79 65 72 0d 07 ee  |0 = No Player...|
000014d0  16 f4 20 31 20 3d 20 48  75 6d 61 6e 20 50 6c 61  |.. 1 = Human Pla|
000014e0  79 65 72 0d 07 f8 19 f4  20 32 20 3d 20 43 6f 6d  |yer..... 2 = Com|
000014f0  70 75 74 65 72 20 50 6c  61 79 65 72 0d 08 02 17  |puter Player....|
00001500  20 20 62 6c 6f 63 6b 25  21 30 3d 70 6c 61 79 65  |  block%!0=playe|
00001510  72 73 25 0d 08 0c 17 20  20 62 6c 6f 63 6b 25 21  |rs%....  block%!|
00001520  34 3d 70 6c 61 79 65 72  2b 34 0d 08 16 24 20 20  |4=player+4...$  |
00001530  c8 99 20 22 57 69 6d 70  5f 47 65 74 49 63 6f 6e  |.. "Wimp_GetIcon|
00001540  53 74 61 74 65 22 2c 2c  62 6c 6f 63 6b 25 0d 08  |State",,block%..|
00001550  20 22 20 20 e7 20 28 62  6c 6f 63 6b 25 21 32 34  | "  . (block%!24|
00001560  20 80 20 26 32 30 30 30  30 30 29 20 8c 20 3d 31  | . &200000) . =1|
00001570  0d 08 2a 17 20 20 62 6c  6f 63 6b 25 21 34 3d 70  |..*.  block%!4=p|
00001580  6c 61 79 65 72 2b 38 0d  08 34 24 20 20 c8 99 20  |layer+8..4$  .. |
00001590  22 57 69 6d 70 5f 47 65  74 49 63 6f 6e 53 74 61  |"Wimp_GetIconSta|
000015a0  74 65 22 2c 2c 62 6c 6f  63 6b 25 0d 08 3e 22 20  |te",,block%..>" |
000015b0  20 e7 20 28 62 6c 6f 63  6b 25 21 32 34 20 80 20  | . (block%!24 . |
000015c0  26 32 30 30 30 30 30 29  20 8c 20 3d 32 0d 08 48  |&200000) . =2..H|
000015d0  08 20 20 3d 30 0d 08 52  05 3a 0d 08 5c 0a dd f2  |.  =0..R.:..\...|
000015e0  6d 61 69 6e 0d 08 66 3f  f4 20 63 68 65 63 6b 20  |main..f?. check |
000015f0  77 68 69 63 68 20 62 75  74 74 6f 6e 20 70 72 65  |which button pre|
00001600  73 73 65 64 20 6f 76 65  72 20 6d 61 69 6e 20 77  |ssed over main w|
00001610  69 6e 64 6f 77 2c 20 64  6f 20 77 68 61 74 65 76  |indow, do whatev|
00001620  65 72 2e 0d 08 70 04 0d  08 7a 28 f4 20 49 66 20  |er...p...z(. If |
00001630  6d 65 6e 75 20 62 75 74  74 6f 6e 20 70 72 65 73  |menu button pres|
00001640  73 65 64 20 63 72 65 61  74 65 20 6d 65 6e 75 0d  |sed create menu.|
00001650  08 84 16 20 20 e7 20 62  6c 6f 63 6b 25 21 38 20  |...  . block%!8 |
00001660  80 20 32 20 8c 0d 08 8e  47 20 20 20 20 c8 99 20  |. 2 ....G    .. |
00001670  22 57 69 6d 70 5f 43 72  65 61 74 65 4d 65 6e 75  |"Wimp_CreateMenu|
00001680  22 2c 2c 4d 61 69 6e 4d  65 6e 75 25 2c 62 6c 6f  |",,MainMenu%,blo|
00001690  63 6b 25 21 30 2d 36 34  2c 62 6c 6f 63 6b 25 21  |ck%!0-64,block%!|
000016a0  34 3a 6d 65 6e 66 6c 61  67 25 3d 32 0d 08 98 04  |4:menflag%=2....|
000016b0  0d 08 a2 21 f4 20 43 68  65 63 6b 20 69 66 20 63  |...!. Check if c|
000016c0  6f 75 6e 74 65 72 20 63  6c 69 63 6b 65 64 20 6f  |ounter clicked o|
000016d0  6e 0d 08 ac 22 f4 20 49  66 20 73 6f 20 74 68 65  |n...". If so the|
000016e0  6e 20 63 61 6c 6c 20 6d  6f 76 65 20 72 6f 75 74  |n call move rout|
000016f0  69 6e 65 0d 08 b6 07 20  20 cc 0d 08 c0 44 20 20  |ine....  ....D  |
00001700  20 20 e7 20 62 65 65 6e  3d a3 20 80 20 41 6c 6c  |  . been=. . All|
00001710  48 6f 6d 65 3c 4e 75 6d  50 6c 61 79 65 72 73 20  |Home<NumPlayers |
00001720  80 20 50 6c 61 79 65 72  54 79 70 65 28 74 75 72  |. PlayerType(tur|
00001730  6e 29 3d 48 75 6d 61 6e  20 8c 20 f2 67 6f 0d 08  |n)=Human . .go..|
00001740  ca 07 20 20 cd 0d 08 d4  05 e1 0d 08 de 04 0d 08  |..  ............|
00001750  e8 0a dd f2 64 69 63 65  0d 08 f2 51 20 20 e7 20  |....dice...Q  . |
00001760  28 28 28 62 6c 6f 63 6b  25 21 38 20 80 20 32 29  |(((block%!8 . 2)|
00001770  3d 30 20 80 20 62 6c 6f  63 6b 25 21 31 36 3d 30  |=0 . block%!16=0|
00001780  29 20 84 20 50 6c 61 79  65 72 54 79 70 65 28 74  |) . PlayerType(t|
00001790  75 72 6e 29 3d 43 6f 6d  70 75 74 65 72 29 20 80  |urn)=Computer) .|
000017a0  20 62 65 65 6e 3d b9 20  8c 0d 08 fc 04 0d 09 06  | been=. ........|
000017b0  19 20 20 20 20 e3 20 6c  6f 6f 70 3d 31 20 b8 20  |.    . loop=1 . |
000017c0  b3 28 37 29 2b 34 0d 09  10 17 20 20 20 20 20 20  |.(7)+4....      |
000017d0  f2 50 6f 6c 6c 49 64 6c  65 28 31 30 29 0d 09 1a  |.PollIdle(10)...|
000017e0  13 20 20 20 20 20 20 64  69 63 65 3d b3 28 36 29  |.      dice=.(6)|
000017f0  0d 09 24 31 20 20 20 20  20 20 f2 43 68 61 6e 67  |..$1      .Chang|
00001800  65 49 63 6f 6e 28 64 69  63 65 25 2c 30 2c 22 22  |eIcon(dice%,0,""|
00001810  2c 22 73 64 69 63 65 22  2b c3 28 64 69 63 65 29  |,"sdice"+.(dice)|
00001820  29 0d 09 2e 0e 20 20 20  20 ed 20 6c 6f 6f 70 0d  |)....    . loop.|
00001830  09 38 04 0d 09 42 25 20  20 20 20 e7 20 a4 49 6e  |.8...B%    . .In|
00001840  50 6c 61 79 28 74 75 72  6e 29 3d a3 20 80 20 64  |Play(turn)=. . d|
00001850  69 63 65 3c 3e 36 20 8c  0d 09 4c 04 0d 09 56 0b  |ice<>6 ...L...V.|
00001860  20 20 20 20 20 20 f5 0d  09 60 13 20 20 20 20 20  |      ...`.     |
00001870  20 20 20 74 75 72 6e 2b  3d 31 0d 09 6a 1f 20 20  |   turn+=1..j.  |
00001880  20 20 20 20 20 20 e7 20  74 75 72 6e 3d 34 20 8c  |      . turn=4 .|
00001890  20 74 75 72 6e 3d 72 65  64 0d 09 74 32 20 20 20  | turn=red..t2   |
000018a0  20 20 20 fd 20 a4 41 6c  6c 48 6f 6d 65 28 74 75  |   . .AllHome(tu|
000018b0  72 6e 29 3d a3 20 80 20  50 6c 61 79 65 72 54 79  |rn)=. . PlayerTy|
000018c0  70 65 28 74 75 72 6e 29  3c 3e 30 0d 09 7e 04 0d  |pe(turn)<>0..~..|
000018d0  09 88 27 20 20 20 20 20  20 e7 20 a4 49 6e 50 6c  |..'      . .InPl|
000018e0  61 79 28 74 75 72 6e 29  3d a3 20 80 20 64 69 63  |ay(turn)=. . dic|
000018f0  65 3c 3e 36 20 8c 0d 09  92 12 20 20 20 20 20 20  |e<>6 .....      |
00001900  20 20 62 65 65 6e 3d b9  0d 09 9c 0b 20 20 20 20  |  been=.....    |
00001910  20 20 cd 0d 09 a6 3e 20  20 20 20 20 20 f2 43 68  |  ....>      .Ch|
00001920  61 6e 67 65 49 63 6f 6e  28 64 69 63 65 25 2c 31  |angeIcon(dice%,1|
00001930  2c 6e 61 6d 65 24 28 74  75 72 6e 29 2b 22 2c 20  |,name$(turn)+", |
00001940  50 6c 65 61 73 65 20 63  6c 69 63 6b 22 2c 22 22  |Please click",""|
00001950  29 0d 09 b0 38 20 20 20  20 20 20 f2 43 68 61 6e  |)...8      .Chan|
00001960  67 65 49 63 6f 6e 28 64  69 63 65 25 2c 32 2c 22  |geIcon(dice%,2,"|
00001970  6f 6e 20 74 68 65 20 64  69 63 65 20 74 6f 20 72  |on the dice to r|
00001980  6f 6c 6c 2e 22 2c 22 22  29 0d 09 ba 09 20 20 20  |oll.","")....   |
00001990  20 cc 0d 09 c4 10 20 20  20 20 20 20 62 65 65 6e  | .....      been|
000019a0  3d a3 0d 09 ce 3e 20 20  20 20 20 20 f2 43 68 61  |=....>      .Cha|
000019b0  6e 67 65 49 63 6f 6e 28  64 69 63 65 25 2c 31 2c  |ngeIcon(dice%,1,|
000019c0  6e 61 6d 65 24 28 74 75  72 6e 29 2b 22 2c 20 50  |name$(turn)+", P|
000019d0  6c 65 61 73 65 20 63 6c  69 63 6b 22 2c 22 22 29  |lease click","")|
000019e0  0d 09 d8 39 20 20 20 20  20 20 f2 43 68 61 6e 67  |...9      .Chang|
000019f0  65 49 63 6f 6e 28 64 69  63 65 25 2c 32 2c 22 6f  |eIcon(dice%,2,"o|
00001a00  6e 20 74 68 65 20 70 69  65 63 65 20 74 6f 20 6d  |n the piece to m|
00001a10  6f 76 65 2e 22 2c 22 22  29 0d 09 e2 09 20 20 20  |ove.","")....   |
00001a20  20 cd 0d 09 ec 04 0d 09  f6 07 20 20 cd 0d 0a 00  | .........  ....|
00001a30  05 e1 0d 0a 0a 05 3a 0d  0a 14 14 dd a4 49 6e 50  |......:......InP|
00001a40  6c 61 79 28 63 6f 6c 6f  75 72 29 0d 0a 1e 0d 20  |lay(colour).... |
00001a50  20 63 6f 75 6e 74 3d 30  0d 0a 28 12 20 20 e3 20  | count=0..(.  . |
00001a60  6c 6f 6f 70 3d 30 20 b8  20 33 0d 0a 32 13 20 20  |loop=0 . 3..2.  |
00001a70  20 20 c8 8e 20 63 6f 6c  6f 75 72 20 ca 0d 0a 3c  |  .. colour ...<|
00001a80  39 20 20 20 20 20 20 c9  20 72 65 64 20 3a 20 e7  |9      . red : .|
00001a90  20 72 65 64 28 6c 6f 6f  70 29 3d 30 20 84 20 72  | red(loop)=0 . r|
00001aa0  65 64 28 6c 6f 6f 70 29  3d 35 38 20 8c 20 63 6f  |ed(loop)=58 . co|
00001ab0  75 6e 74 2b 3d 31 0d 0a  46 3c 20 20 20 20 20 20  |unt+=1..F<      |
00001ac0  c9 20 62 6c 75 65 20 3a  20 e7 20 62 6c 75 65 28  |. blue : . blue(|
00001ad0  6c 6f 6f 70 29 3d 30 20  84 20 62 6c 75 65 28 6c  |loop)=0 . blue(l|
00001ae0  6f 6f 70 29 3d 35 38 20  8c 20 63 6f 75 6e 74 2b  |oop)=58 . count+|
00001af0  3d 31 0d 0a 50 42 20 20  20 20 20 20 c9 20 79 65  |=1..PB      . ye|
00001b00  6c 6c 6f 77 20 3a 20 e7  20 79 65 6c 6c 6f 77 28  |llow : . yellow(|
00001b10  6c 6f 6f 70 29 3d 30 20  84 20 79 65 6c 6c 6f 77  |loop)=0 . yellow|
00001b20  28 6c 6f 6f 70 29 3d 35  38 20 8c 20 63 6f 75 6e  |(loop)=58 . coun|
00001b30  74 2b 3d 31 0d 0a 5a 3f  20 20 20 20 20 20 c9 20  |t+=1..Z?      . |
00001b40  67 72 65 65 6e 20 3a 20  e7 20 67 72 65 65 6e 28  |green : . green(|
00001b50  6c 6f 6f 70 29 3d 30 20  84 20 67 72 65 65 6e 28  |loop)=0 . green(|
00001b60  6c 6f 6f 70 29 3d 35 38  20 8c 20 63 6f 75 6e 74  |loop)=58 . count|
00001b70  2b 3d 31 0d 0a 64 09 20  20 20 20 cb 0d 0a 6e 0c  |+=1..d.    ...n.|
00001b80  20 20 ed 20 6c 6f 6f 70  0d 0a 78 11 20 20 e7 20  |  . loop..x.  . |
00001b90  63 6f 75 6e 74 3d 34 20  8c 0d 0a 82 0a 20 20 20  |count=4 .....   |
00001ba0  20 3d a3 0d 0a 8c 07 20  20 cc 0d 0a 96 0a 20 20  | =.....  .....  |
00001bb0  20 20 3d b9 0d 0a a0 05  3a 0d 0a aa 15 dd a4 41  |  =.....:......A|
00001bc0  6c 6c 48 6f 6d 65 28 63  6f 6c 6f 75 72 29 0d 0a  |llHome(colour)..|
00001bd0  b4 0d 20 20 63 6f 75 6e  74 3d 30 0d 0a be 12 20  |..  count=0.... |
00001be0  20 e3 20 6c 6f 6f 70 3d  30 20 b8 20 33 0d 0a c8  | . loop=0 . 3...|
00001bf0  13 20 20 20 20 c8 8e 20  63 6f 6c 6f 75 72 20 ca  |.    .. colour .|
00001c00  0d 0a d2 2b 20 20 20 20  20 20 c9 20 72 65 64 20  |...+      . red |
00001c10  3a 20 e7 20 72 65 64 28  6c 6f 6f 70 29 3d 35 38  |: . red(loop)=58|
00001c20  20 8c 20 63 6f 75 6e 74  2b 3d 31 0d 0a dc 2d 20  | . count+=1...- |
00001c30  20 20 20 20 20 c9 20 62  6c 75 65 20 3a 20 e7 20  |     . blue : . |
00001c40  62 6c 75 65 28 6c 6f 6f  70 29 3d 35 38 20 8c 20  |blue(loop)=58 . |
00001c50  63 6f 75 6e 74 2b 3d 31  0d 0a e6 31 20 20 20 20  |count+=1...1    |
00001c60  20 20 c9 20 79 65 6c 6c  6f 77 20 3a 20 e7 20 79  |  . yellow : . y|
00001c70  65 6c 6c 6f 77 28 6c 6f  6f 70 29 3d 35 38 20 8c  |ellow(loop)=58 .|
00001c80  20 63 6f 75 6e 74 2b 3d  31 0d 0a f0 2f 20 20 20  | count+=1.../   |
00001c90  20 20 20 c9 20 67 72 65  65 6e 20 3a 20 e7 20 67  |   . green : . g|
00001ca0  72 65 65 6e 28 6c 6f 6f  70 29 3d 35 38 20 8c 20  |reen(loop)=58 . |
00001cb0  63 6f 75 6e 74 2b 3d 31  0d 0a fa 09 20 20 20 20  |count+=1....    |
00001cc0  cb 0d 0b 04 0c 20 20 ed  20 6c 6f 6f 70 0d 0b 0e  |.....  . loop...|
00001cd0  11 20 20 e7 20 63 6f 75  6e 74 3d 34 20 8c 0d 0b  |.  . count=4 ...|
00001ce0  18 0a 20 20 20 20 3d b9  0d 0b 22 07 20 20 cc 0d  |..    =...".  ..|
00001cf0  0b 2c 0a 20 20 20 20 3d  a3 0d 0b 36 05 3a 0d 0b  |.,.    =...6.:..|
00001d00  40 09 dd 20 f2 67 6f 0d  0b 4a 12 20 20 e7 20 74  |@.. .go..J.  . t|
00001d10  75 72 6e 3d 72 65 64 20  8c 0d 0b 54 17 20 20 20  |urn=red ...T.   |
00001d20  20 e3 20 63 6f 75 6e 74  65 72 3d 30 20 b8 20 33  | . counter=0 . 3|
00001d30  0d 0b 5e 84 20 20 20 20  20 20 e7 20 28 69 63 6f  |..^.      . (ico|
00001d40  6e 28 72 65 64 2c 72 65  64 28 63 6f 75 6e 74 65  |n(red,red(counte|
00001d50  72 29 29 3d 62 6c 6f 63  6b 25 21 31 36 20 84 20  |r))=block%!16 . |
00001d60  28 72 65 64 28 63 6f 75  6e 74 65 72 29 3d 30 20  |(red(counter)=0 |
00001d70  80 20 64 69 63 65 3d 36  20 80 20 62 6c 6f 63 6b  |. dice=6 . block|
00001d80  25 21 31 36 3d 63 6f 75  6e 74 65 72 2b 37 37 29  |%!16=counter+77)|
00001d90  29 20 80 20 62 65 65 6e  3d a3 20 8c 20 f2 6d 6f  |) . been=. . .mo|
00001da0  76 65 28 72 65 64 2c 63  6f 75 6e 74 65 72 2c 64  |ve(red,counter,d|
00001db0  69 63 65 29 0d 0b 68 11  20 20 20 20 ed 20 63 6f  |ice)..h.    . co|
00001dc0  75 6e 74 65 72 0d 0b 72  07 20 20 cd 0d 0b 7c 04  |unter..r.  ...|.|
00001dd0  0d 0b 86 13 20 20 e7 20  74 75 72 6e 3d 62 6c 75  |....  . turn=blu|
00001de0  65 20 8c 0d 0b 90 17 20  20 20 20 e3 20 63 6f 75  |e .....    . cou|
00001df0  6e 74 65 72 3d 30 20 b8  20 33 0d 0b 9a 88 20 20  |nter=0 . 3....  |
00001e00  20 20 20 20 e7 20 28 69  63 6f 6e 28 62 6c 75 65  |    . (icon(blue|
00001e10  2c 62 6c 75 65 28 63 6f  75 6e 74 65 72 29 29 3d  |,blue(counter))=|
00001e20  62 6c 6f 63 6b 25 21 31  36 20 84 20 28 62 6c 75  |block%!16 . (blu|
00001e30  65 28 63 6f 75 6e 74 65  72 29 3d 30 20 80 20 64  |e(counter)=0 . d|
00001e40  69 63 65 3d 36 20 80 20  62 6c 6f 63 6b 25 21 31  |ice=6 . block%!1|
00001e50  36 3d 63 6f 75 6e 74 65  72 2b 38 31 29 29 20 80  |6=counter+81)) .|
00001e60  20 62 65 65 6e 3d a3 20  8c 20 f2 6d 6f 76 65 28  | been=. . .move(|
00001e70  62 6c 75 65 2c 63 6f 75  6e 74 65 72 2c 64 69 63  |blue,counter,dic|
00001e80  65 29 0d 0b a4 11 20 20  20 20 ed 20 63 6f 75 6e  |e)....    . coun|
00001e90  74 65 72 0d 0b ae 07 20  20 cd 0d 0b b8 04 0d 0b  |ter....  .......|
00001ea0  c2 15 20 20 e7 20 74 75  72 6e 3d 79 65 6c 6c 6f  |..  . turn=yello|
00001eb0  77 20 8c 0d 0b cc 17 20  20 20 20 e3 20 63 6f 75  |w .....    . cou|
00001ec0  6e 74 65 72 3d 30 20 b8  20 33 0d 0b d6 90 20 20  |nter=0 . 3....  |
00001ed0  20 20 20 20 e7 20 28 69  63 6f 6e 28 79 65 6c 6c  |    . (icon(yell|
00001ee0  6f 77 2c 79 65 6c 6c 6f  77 28 63 6f 75 6e 74 65  |ow,yellow(counte|
00001ef0  72 29 29 3d 62 6c 6f 63  6b 25 21 31 36 20 84 20  |r))=block%!16 . |
00001f00  28 79 65 6c 6c 6f 77 28  63 6f 75 6e 74 65 72 29  |(yellow(counter)|
00001f10  3d 30 20 80 20 64 69 63  65 3d 36 20 80 20 62 6c  |=0 . dice=6 . bl|
00001f20  6f 63 6b 25 21 31 36 3d  63 6f 75 6e 74 65 72 2b  |ock%!16=counter+|
00001f30  38 35 29 29 20 80 20 62  65 65 6e 3d a3 20 8c 20  |85)) . been=. . |
00001f40  f2 6d 6f 76 65 28 79 65  6c 6c 6f 77 2c 63 6f 75  |.move(yellow,cou|
00001f50  6e 74 65 72 2c 64 69 63  65 29 0d 0b e0 11 20 20  |nter,dice)....  |
00001f60  20 20 ed 20 63 6f 75 6e  74 65 72 0d 0b ea 07 20  |  . counter.... |
00001f70  20 cd 0d 0b f4 04 0d 0b  fe 14 20 20 e7 20 74 75  | .........  . tu|
00001f80  72 6e 3d 67 72 65 65 6e  20 8c 0d 0c 08 17 20 20  |rn=green .....  |
00001f90  20 20 e3 20 63 6f 75 6e  74 65 72 3d 30 20 b8 20  |  . counter=0 . |
00001fa0  33 0d 0c 12 8c 20 20 20  20 20 20 e7 20 28 69 63  |3....      . (ic|
00001fb0  6f 6e 28 67 72 65 65 6e  2c 67 72 65 65 6e 28 63  |on(green,green(c|
00001fc0  6f 75 6e 74 65 72 29 29  3d 62 6c 6f 63 6b 25 21  |ounter))=block%!|
00001fd0  31 36 20 84 20 28 67 72  65 65 6e 28 63 6f 75 6e  |16 . (green(coun|
00001fe0  74 65 72 29 3d 30 20 80  20 64 69 63 65 3d 36 20  |ter)=0 . dice=6 |
00001ff0  80 20 62 6c 6f 63 6b 25  21 31 36 3d 63 6f 75 6e  |. block%!16=coun|
00002000  74 65 72 2b 38 39 29 29  20 80 20 62 65 65 6e 3d  |ter+89)) . been=|
00002010  a3 20 8c 20 f2 6d 6f 76  65 28 67 72 65 65 6e 2c  |. . .move(green,|
00002020  63 6f 75 6e 74 65 72 2c  64 69 63 65 29 0d 0c 1c  |counter,dice)...|
00002030  11 20 20 20 20 ed 20 63  6f 75 6e 74 65 72 0d 0c  |.    . counter..|
00002040  26 07 20 20 cd 0d 0c 30  05 e1 0d 0c 3a 05 3a 0d  |&.  ...0....:.:.|
00002050  0c 44 0e dd f2 63 6f 6d  70 75 74 65 72 0d 0c 4e  |.D...computer..N|
00002060  04 0d 0c 58 26 f4 20 2a  20 2a 20 4d 4f 56 45 20  |...X&. * * MOVE |
00002070  52 45 44 20 43 4f 4d 50  55 54 45 52 20 50 4c 41  |RED COMPUTER PLA|
00002080  59 45 52 20 2a 20 2a 0d  0c 62 04 0d 0c 6c 2e 20  |YER * *..b...l. |
00002090  20 e7 20 74 75 72 6e 3d  72 65 64 20 80 20 50 6c  | . turn=red . Pl|
000020a0  61 79 65 72 54 79 70 65  28 74 75 72 6e 29 3d 43  |ayerType(turn)=C|
000020b0  6f 6d 70 75 74 65 72 20  8c 0d 0c 76 04 0d 0c 80  |omputer ...v....|
000020c0  27 f4 20 46 69 6e 64 20  68 6f 77 20 6d 61 6e 79  |'. Find how many|
000020d0  20 70 69 65 63 65 73 20  61 72 65 20 69 6e 20 70  | pieces are in p|
000020e0  6c 61 79 2e 0d 0c 8a 04  0d 0c 94 0f 20 20 20 20  |lay.........    |
000020f0  63 6f 75 6e 74 3d 30 0d  0c 9e 17 20 20 20 20 e3  |count=0....    .|
00002100  20 63 6f 75 6e 74 65 72  3d 30 20 b8 20 33 0d 0c  | counter=0 . 3..|
00002110  a8 38 20 20 20 20 20 20  20 e7 20 72 65 64 28 63  |.8       . red(c|
00002120  6f 75 6e 74 65 72 29 3e  30 20 80 20 72 65 64 28  |ounter)>0 . red(|
00002130  63 6f 75 6e 74 65 72 29  3c 35 33 20 8c 20 63 6f  |counter)<53 . co|
00002140  75 6e 74 2b 3d 31 0d 0c  b2 11 20 20 20 20 ed 20  |unt+=1....    . |
00002150  63 6f 75 6e 74 65 72 0d  0c bc 04 0d 0c c6 4c f4  |counter.......L.|
00002160  20 49 66 20 6c 65 73 73  20 74 68 61 6e 20 32 20  | If less than 2 |
00002170  70 69 65 63 65 73 20 61  72 65 20 69 6e 20 70 6c  |pieces are in pl|
00002180  61 79 20 74 68 65 6e 2c  20 69 66 20 70 6f 73 73  |ay then, if poss|
00002190  69 62 6c 65 2c 20 6d 6f  76 65 20 61 6e 6f 74 68  |ible, move anoth|
000021a0  65 72 20 6f 75 74 2e 0d  0c d0 04 0d 0c da 17 20  |er out......... |
000021b0  20 20 20 e3 20 63 6f 75  6e 74 65 72 3d 30 20 b8  |   . counter=0 .|
000021c0  20 33 0d 0c e4 50 20 20  20 20 20 20 e7 20 63 6f  | 3...P      . co|
000021d0  75 6e 74 3c 32 20 80 20  64 69 63 65 3d 36 20 80  |unt<2 . dice=6 .|
000021e0  20 72 65 64 28 63 6f 75  6e 74 65 72 29 3d 30 20  | red(counter)=0 |
000021f0  80 20 62 65 65 6e 3d a3  20 8c 20 f2 6d 6f 76 65  |. been=. . .move|
00002200  28 72 65 64 2c 63 6f 75  6e 74 65 72 2c 64 69 63  |(red,counter,dic|
00002210  65 29 0d 0c ee 11 20 20  20 20 ed 20 63 6f 75 6e  |e)....    . coun|
00002220  74 65 72 0d 0c f8 04 0d  0d 02 57 f4 20 49 66 20  |ter.......W. If |
00002230  6e 6f 74 20 70 6f 73 73  69 62 6c 65 20 74 68 65  |not possible the|
00002240  6e 2c 20 69 66 20 70 6f  73 73 69 62 6c 65 2c 20  |n, if possible, |
00002250  6d 6f 76 65 20 61 20 70  69 65 63 65 20 74 68 61  |move a piece tha|
00002260  74 20 77 69 6c 6c 20 74  61 6b 65 20 61 6e 20 6f  |t will take an o|
00002270  70 70 6f 6e 65 6e 74 73  20 70 69 65 63 65 0d 0d  |pponents piece..|
00002280  0c 04 0d 0d 16 17 20 20  20 20 e3 20 63 6f 75 6e  |......    . coun|
00002290  74 65 72 3d 30 20 b8 20  33 0d 0d 20 2e 20 20 20  |ter=0 . 3.. .   |
000022a0  20 20 20 e7 20 72 65 64  28 63 6f 75 6e 74 65 72  |   . red(counter|
000022b0  29 3e 30 20 80 20 72 65  64 28 63 6f 75 6e 74 65  |)>0 . red(counte|
000022c0  72 29 3c 35 33 20 8c 0d  0d 2a 18 20 20 20 20 20  |r)<53 ...*.     |
000022d0  20 20 20 e3 20 6c 6f 6f  70 3d 30 20 b8 20 33 0d  |   . loop=0 . 3.|
000022e0  0d 34 4c 20 20 20 20 20  20 20 20 20 20 e7 20 69  |.4L          . i|
000022f0  63 6f 6e 28 72 65 64 2c  72 65 64 28 63 6f 75 6e  |con(red,red(coun|
00002300  74 65 72 29 2b 64 69 63  65 29 3d 69 63 6f 6e 28  |ter)+dice)=icon(|
00002310  62 6c 75 65 2c 62 6c 75  65 28 6c 6f 6f 70 29 29  |blue,blue(loop))|
00002320  20 80 20 62 65 65 6e 3d  a3 20 8c 0d 0d 3e 27 20  | . been=. ...>' |
00002330  20 20 20 20 20 20 20 20  20 20 20 f2 6d 6f 76 65  |           .move|
00002340  28 72 65 64 2c 63 6f 75  6e 74 65 72 2c 64 69 63  |(red,counter,dic|
00002350  65 29 0d 0d 48 0f 20 20  20 20 20 20 20 20 20 20  |e)..H.          |
00002360  cc 0d 0d 52 52 20 20 20  20 20 20 20 20 20 20 20  |...RR           |
00002370  20 e7 20 69 63 6f 6e 28  72 65 64 2c 72 65 64 28  | . icon(red,red(|
00002380  63 6f 75 6e 74 65 72 29  2b 64 69 63 65 29 3d 69  |counter)+dice)=i|
00002390  63 6f 6e 28 79 65 6c 6c  6f 77 2c 79 65 6c 6c 6f  |con(yellow,yello|
000023a0  77 28 6c 6f 6f 70 29 29  20 80 20 62 65 65 6e 3d  |w(loop)) . been=|
000023b0  a3 20 8c 0d 0d 5c 29 20  20 20 20 20 20 20 20 20  |. ...\)         |
000023c0  20 20 20 20 20 f2 6d 6f  76 65 28 72 65 64 2c 63  |     .move(red,c|
000023d0  6f 75 6e 74 65 72 2c 64  69 63 65 29 0d 0d 66 11  |ounter,dice)..f.|
000023e0  20 20 20 20 20 20 20 20  20 20 20 20 cc 0d 0d 70  |            ...p|
000023f0  6a 20 20 20 20 20 20 20  20 20 20 20 20 20 20 e7  |j              .|
00002400  20 69 63 6f 6e 28 72 65  64 2c 72 65 64 28 63 6f  | icon(red,red(co|
00002410  75 6e 74 65 72 29 2b 64  69 63 65 29 3d 69 63 6f  |unter)+dice)=ico|
00002420  6e 28 67 72 65 65 6e 2c  67 72 65 65 6e 28 6c 6f  |n(green,green(lo|
00002430  6f 70 29 29 20 80 20 62  65 65 6e 3d a3 20 8c 20  |op)) . been=. . |
00002440  f2 6d 6f 76 65 28 72 65  64 2c 63 6f 75 6e 74 65  |.move(red,counte|
00002450  72 2c 64 69 63 65 29 0d  0d 7a 11 20 20 20 20 20  |r,dice)..z.     |
00002460  20 20 20 20 20 20 20 cd  0d 0d 84 0f 20 20 20 20  |       .....    |
00002470  20 20 20 20 20 20 cd 0d  0d 8e 12 20 20 20 20 20  |      .....     |
00002480  20 20 20 ed 20 6c 6f 6f  70 0d 0d 98 0b 20 20 20  |   . loop....   |
00002490  20 20 20 cd 0d 0d a2 11  20 20 20 20 ed 20 63 6f  |   .....    . co|
000024a0  75 6e 74 65 72 0d 0d ac  04 0d 0d b6 31 f4 20 49  |unter.......1. I|
000024b0  66 20 6e 6f 74 20 70 6f  73 73 69 62 6c 65 20 74  |f not possible t|
000024c0  68 65 6e 20 6d 6f 76 65  20 61 20 70 69 65 63 65  |hen move a piece|
000024d0  20 74 6f 20 73 61 66 65  74 79 0d 0d c0 04 0d 0d  | to safety......|
000024e0  ca 17 20 20 20 20 e3 20  63 6f 75 6e 74 65 72 3d  |..    . counter=|
000024f0  30 20 b8 20 33 0d 0d d4  68 20 20 20 20 20 20 e7  |0 . 3...h      .|
00002500  20 72 65 64 28 63 6f 75  6e 74 65 72 29 3e 30 20  | red(counter)>0 |
00002510  80 20 72 65 64 28 63 6f  75 6e 74 65 72 29 3c 35  |. red(counter)<5|
00002520  33 20 80 20 28 72 65 64  28 63 6f 75 6e 74 65 72  |3 . (red(counter|
00002530  29 2b 64 69 63 65 29 3e  35 32 20 80 20 62 65 65  |)+dice)>52 . bee|
00002540  6e 3d a3 20 8c 20 f2 6d  6f 76 65 28 72 65 64 2c  |n=. . .move(red,|
00002550  63 6f 75 6e 74 65 72 2c  64 69 63 65 29 0d 0d de  |counter,dice)...|
00002560  11 20 20 20 20 ed 20 63  6f 75 6e 74 65 72 0d 0d  |.    . counter..|
00002570  e8 04 0d 0d f2 27 f4 20  4f 74 68 65 72 77 69 73  |.....'. Otherwis|
00002580  65 20 6d 6f 76 65 20 61  6e 79 20 70 69 65 63 65  |e move any piece|
00002590  20 70 6f 73 73 69 62 6c  65 0d 0d fc 04 0d 0e 06  | possible.......|
000025a0  17 20 20 20 20 e3 20 63  6f 75 6e 74 65 72 3d 30  |.    . counter=0|
000025b0  20 b8 20 33 0d 0e 10 4f  20 20 20 20 20 20 e7 20  | . 3...O      . |
000025c0  72 65 64 28 63 6f 75 6e  74 65 72 29 3e 30 20 80  |red(counter)>0 .|
000025d0  20 72 65 64 28 63 6f 75  6e 74 65 72 29 3c 35 38  | red(counter)<58|
000025e0  20 80 20 62 65 65 6e 3d  a3 20 8c 20 f2 6d 6f 76  | . been=. . .mov|
000025f0  65 28 72 65 64 2c 63 6f  75 6e 74 65 72 2c 64 69  |e(red,counter,di|
00002600  63 65 29 0d 0e 1a 11 20  20 20 20 ed 20 63 6f 75  |ce)....    . cou|
00002610  6e 74 65 72 0d 0e 24 04  0d 0e 2e 07 20 20 cd 0d  |nter..$.....  ..|
00002620  0e 38 04 0d 0e 42 27 f4  20 2a 20 2a 20 4d 4f 56  |.8...B'. * * MOV|
00002630  45 20 42 4c 55 45 20 43  4f 4d 50 55 54 45 52 20  |E BLUE COMPUTER |
00002640  50 4c 41 59 45 52 20 2a  20 2a 0d 0e 4c 04 0d 0e  |PLAYER * *..L...|
00002650  56 2f 20 20 e7 20 74 75  72 6e 3d 62 6c 75 65 20  |V/  . turn=blue |
00002660  80 20 50 6c 61 79 65 72  54 79 70 65 28 74 75 72  |. PlayerType(tur|
00002670  6e 29 3d 43 6f 6d 70 75  74 65 72 20 8c 0d 0e 60  |n)=Computer ...`|
00002680  04 0d 0e 6a 27 f4 20 46  69 6e 64 20 68 6f 77 20  |...j'. Find how |
00002690  6d 61 6e 79 20 70 69 65  63 65 73 20 61 72 65 20  |many pieces are |
000026a0  69 6e 20 70 6c 61 79 2e  0d 0e 74 04 0d 0e 7e 0f  |in play...t...~.|
000026b0  20 20 20 20 63 6f 75 6e  74 3d 30 0d 0e 88 17 20  |    count=0.... |
000026c0  20 20 20 e3 20 63 6f 75  6e 74 65 72 3d 30 20 b8  |   . counter=0 .|
000026d0  20 33 0d 0e 92 3a 20 20  20 20 20 20 20 e7 20 62  | 3...:       . b|
000026e0  6c 75 65 28 63 6f 75 6e  74 65 72 29 3e 30 20 80  |lue(counter)>0 .|
000026f0  20 62 6c 75 65 28 63 6f  75 6e 74 65 72 29 3c 35  | blue(counter)<5|
00002700  33 20 8c 20 63 6f 75 6e  74 2b 3d 31 0d 0e 9c 11  |3 . count+=1....|
00002710  20 20 20 20 ed 20 63 6f  75 6e 74 65 72 0d 0e a6  |    . counter...|
00002720  04 0d 0e b0 4c f4 20 49  66 20 6c 65 73 73 20 74  |....L. If less t|
00002730  68 61 6e 20 32 20 70 69  65 63 65 73 20 61 72 65  |han 2 pieces are|
00002740  20 69 6e 20 70 6c 61 79  20 74 68 65 6e 2c 20 69  | in play then, i|
00002750  66 20 70 6f 73 73 69 62  6c 65 2c 20 6d 6f 76 65  |f possible, move|
00002760  20 61 6e 6f 74 68 65 72  20 6f 75 74 2e 0d 0e ba  | another out....|
00002770  04 0d 0e c4 17 20 20 20  20 e3 20 63 6f 75 6e 74  |.....    . count|
00002780  65 72 3d 30 20 b8 20 33  0d 0e ce 52 20 20 20 20  |er=0 . 3...R    |
00002790  20 20 e7 20 63 6f 75 6e  74 3c 32 20 80 20 64 69  |  . count<2 . di|
000027a0  63 65 3d 36 20 80 20 62  6c 75 65 28 63 6f 75 6e  |ce=6 . blue(coun|
000027b0  74 65 72 29 3d 30 20 80  20 62 65 65 6e 3d a3 20  |ter)=0 . been=. |
000027c0  8c 20 f2 6d 6f 76 65 28  62 6c 75 65 2c 63 6f 75  |. .move(blue,cou|
000027d0  6e 74 65 72 2c 64 69 63  65 29 0d 0e d8 11 20 20  |nter,dice)....  |
000027e0  20 20 ed 20 63 6f 75 6e  74 65 72 0d 0e e2 04 0d  |  . counter.....|
000027f0  0e ec 57 f4 20 49 66 20  6e 6f 74 20 70 6f 73 73  |..W. If not poss|
00002800  69 62 6c 65 20 74 68 65  6e 2c 20 69 66 20 70 6f  |ible then, if po|
00002810  73 73 69 62 6c 65 2c 20  6d 6f 76 65 20 61 20 70  |ssible, move a p|
00002820  69 65 63 65 20 74 68 61  74 20 77 69 6c 6c 20 74  |iece that will t|
00002830  61 6b 65 20 61 6e 20 6f  70 70 6f 6e 65 6e 74 73  |ake an opponents|
00002840  20 70 69 65 63 65 0d 0e  f6 04 0d 0f 00 17 20 20  | piece........  |
00002850  20 20 e3 20 63 6f 75 6e  74 65 72 3d 30 20 b8 20  |  . counter=0 . |
00002860  33 0d 0f 0a 30 20 20 20  20 20 20 e7 20 62 6c 75  |3...0      . blu|
00002870  65 28 63 6f 75 6e 74 65  72 29 3e 30 20 80 20 62  |e(counter)>0 . b|
00002880  6c 75 65 28 63 6f 75 6e  74 65 72 29 3c 35 33 20  |lue(counter)<53 |
00002890  8c 0d 0f 14 18 20 20 20  20 20 20 20 20 e3 20 6c  |.....        . l|
000028a0  6f 6f 70 3d 30 20 b8 20  33 0d 0f 1e 4c 20 20 20  |oop=0 . 3...L   |
000028b0  20 20 20 20 20 20 20 e7  20 69 63 6f 6e 28 62 6c  |       . icon(bl|
000028c0  75 65 2c 62 6c 75 65 28  63 6f 75 6e 74 65 72 29  |ue,blue(counter)|
000028d0  2b 64 69 63 65 29 3d 69  63 6f 6e 28 72 65 64 2c  |+dice)=icon(red,|
000028e0  72 65 64 28 6c 6f 6f 70  29 29 20 80 20 62 65 65  |red(loop)) . bee|
000028f0  6e 3d a3 20 8c 0d 0f 28  28 20 20 20 20 20 20 20  |n=. ...((       |
00002900  20 20 20 20 20 f2 6d 6f  76 65 28 62 6c 75 65 2c  |     .move(blue,|
00002910  63 6f 75 6e 74 65 72 2c  64 69 63 65 29 0d 0f 32  |counter,dice)..2|
00002920  0f 20 20 20 20 20 20 20  20 20 20 cc 0d 0f 3c 54  |.          ...<T|
00002930  20 20 20 20 20 20 20 20  20 20 20 20 e7 20 69 63  |            . ic|
00002940  6f 6e 28 62 6c 75 65 2c  62 6c 75 65 28 63 6f 75  |on(blue,blue(cou|
00002950  6e 74 65 72 29 2b 64 69  63 65 29 3d 69 63 6f 6e  |nter)+dice)=icon|
00002960  28 79 65 6c 6c 6f 77 2c  79 65 6c 6c 6f 77 28 6c  |(yellow,yellow(l|
00002970  6f 6f 70 29 29 20 80 20  62 65 65 6e 3d a3 20 8c  |oop)) . been=. .|
00002980  0d 0f 46 2a 20 20 20 20  20 20 20 20 20 20 20 20  |..F*            |
00002990  20 20 f2 6d 6f 76 65 28  62 6c 75 65 2c 63 6f 75  |  .move(blue,cou|
000029a0  6e 74 65 72 2c 64 69 63  65 29 0d 0f 50 11 20 20  |nter,dice)..P.  |
000029b0  20 20 20 20 20 20 20 20  20 20 cc 0d 0f 5a 6d 20  |          ...Zm |
000029c0  20 20 20 20 20 20 20 20  20 20 20 20 20 e7 20 69  |             . i|
000029d0  63 6f 6e 28 62 6c 75 65  2c 62 6c 75 65 28 63 6f  |con(blue,blue(co|
000029e0  75 6e 74 65 72 29 2b 64  69 63 65 29 3d 69 63 6f  |unter)+dice)=ico|
000029f0  6e 28 67 72 65 65 6e 2c  67 72 65 65 6e 28 6c 6f  |n(green,green(lo|
00002a00  6f 70 29 29 20 80 20 62  65 65 6e 3d a3 20 8c 20  |op)) . been=. . |
00002a10  f2 6d 6f 76 65 28 62 6c  75 65 2c 63 6f 75 6e 74  |.move(blue,count|
00002a20  65 72 2c 64 69 63 65 29  0d 0f 64 11 20 20 20 20  |er,dice)..d.    |
00002a30  20 20 20 20 20 20 20 20  cd 0d 0f 6e 0f 20 20 20  |        ...n.   |
00002a40  20 20 20 20 20 20 20 cd  0d 0f 78 12 20 20 20 20  |       ...x.    |
00002a50  20 20 20 20 ed 20 6c 6f  6f 70 0d 0f 82 0b 20 20  |    . loop....  |
00002a60  20 20 20 20 cd 0d 0f 8c  11 20 20 20 20 ed 20 63  |    .....    . c|
00002a70  6f 75 6e 74 65 72 0d 0f  96 04 0d 0f a0 31 f4 20  |ounter.......1. |
00002a80  49 66 20 6e 6f 74 20 70  6f 73 73 69 62 6c 65 20  |If not possible |
00002a90  74 68 65 6e 20 6d 6f 76  65 20 61 20 70 69 65 63  |then move a piec|
00002aa0  65 20 74 6f 20 73 61 66  65 74 79 0d 0f aa 04 0d  |e to safety.....|
00002ab0  0f b4 17 20 20 20 20 e3  20 63 6f 75 6e 74 65 72  |...    . counter|
00002ac0  3d 30 20 b8 20 33 0d 0f  be 6c 20 20 20 20 20 20  |=0 . 3...l      |
00002ad0  e7 20 62 6c 75 65 28 63  6f 75 6e 74 65 72 29 3e  |. blue(counter)>|
00002ae0  30 20 80 20 62 6c 75 65  28 63 6f 75 6e 74 65 72  |0 . blue(counter|
00002af0  29 3c 35 33 20 80 20 28  62 6c 75 65 28 63 6f 75  |)<53 . (blue(cou|
00002b00  6e 74 65 72 29 2b 64 69  63 65 29 3e 35 32 20 80  |nter)+dice)>52 .|
00002b10  20 62 65 65 6e 3d a3 20  8c 20 f2 6d 6f 76 65 28  | been=. . .move(|
00002b20  62 6c 75 65 2c 63 6f 75  6e 74 65 72 2c 64 69 63  |blue,counter,dic|
00002b30  65 29 0d 0f c8 11 20 20  20 20 ed 20 63 6f 75 6e  |e)....    . coun|
00002b40  74 65 72 0d 0f d2 04 0d  0f dc 27 f4 20 4f 74 68  |ter.......'. Oth|
00002b50  65 72 77 69 73 65 20 6d  6f 76 65 20 61 6e 79 20  |erwise move any |
00002b60  70 69 65 63 65 20 70 6f  73 73 69 62 6c 65 0d 0f  |piece possible..|
00002b70  e6 04 0d 0f f0 17 20 20  20 20 e3 20 63 6f 75 6e  |......    . coun|
00002b80  74 65 72 3d 30 20 b8 20  33 0d 0f fa 52 20 20 20  |ter=0 . 3...R   |
00002b90  20 20 20 e7 20 62 6c 75  65 28 63 6f 75 6e 74 65  |   . blue(counte|
00002ba0  72 29 3e 30 20 80 20 62  6c 75 65 28 63 6f 75 6e  |r)>0 . blue(coun|
00002bb0  74 65 72 29 3c 35 38 20  80 20 62 65 65 6e 3d a3  |ter)<58 . been=.|
00002bc0  20 8c 20 f2 6d 6f 76 65  28 62 6c 75 65 2c 63 6f  | . .move(blue,co|
00002bd0  75 6e 74 65 72 2c 64 69  63 65 29 0d 10 04 11 20  |unter,dice).... |
00002be0  20 20 20 ed 20 63 6f 75  6e 74 65 72 0d 10 0e 04  |   . counter....|
00002bf0  0d 10 18 07 20 20 cd 0d  10 22 04 0d 10 2c 29 f4  |....  ..."...,).|
00002c00  20 2a 20 2a 20 4d 4f 56  45 20 59 45 4c 4c 4f 57  | * * MOVE YELLOW|
00002c10  20 43 4f 4d 50 55 54 45  52 20 50 4c 41 59 45 52  | COMPUTER PLAYER|
00002c20  20 2a 20 2a 0d 10 36 04  0d 10 40 31 20 20 e7 20  | * *..6...@1  . |
00002c30  74 75 72 6e 3d 79 65 6c  6c 6f 77 20 80 20 50 6c  |turn=yellow . Pl|
00002c40  61 79 65 72 54 79 70 65  28 74 75 72 6e 29 3d 43  |ayerType(turn)=C|
00002c50  6f 6d 70 75 74 65 72 20  8c 0d 10 4a 04 0d 10 54  |omputer ...J...T|
00002c60  27 f4 20 46 69 6e 64 20  68 6f 77 20 6d 61 6e 79  |'. Find how many|
00002c70  20 70 69 65 63 65 73 20  61 72 65 20 69 6e 20 70  | pieces are in p|
00002c80  6c 61 79 2e 0d 10 5e 04  0d 10 68 0f 20 20 20 20  |lay...^...h.    |
00002c90  63 6f 75 6e 74 3d 30 0d  10 72 17 20 20 20 20 e3  |count=0..r.    .|
00002ca0  20 63 6f 75 6e 74 65 72  3d 30 20 b8 20 33 0d 10  | counter=0 . 3..|
00002cb0  7c 3e 20 20 20 20 20 20  20 e7 20 79 65 6c 6c 6f  ||>       . yello|
00002cc0  77 28 63 6f 75 6e 74 65  72 29 3e 30 20 80 20 79  |w(counter)>0 . y|
00002cd0  65 6c 6c 6f 77 28 63 6f  75 6e 74 65 72 29 3c 35  |ellow(counter)<5|
00002ce0  33 20 8c 20 63 6f 75 6e  74 2b 3d 31 0d 10 86 11  |3 . count+=1....|
00002cf0  20 20 20 20 ed 20 63 6f  75 6e 74 65 72 0d 10 90  |    . counter...|
00002d00  04 0d 10 9a 4c f4 20 49  66 20 6c 65 73 73 20 74  |....L. If less t|
00002d10  68 61 6e 20 32 20 70 69  65 63 65 73 20 61 72 65  |han 2 pieces are|
00002d20  20 69 6e 20 70 6c 61 79  20 74 68 65 6e 2c 20 69  | in play then, i|
00002d30  66 20 70 6f 73 73 69 62  6c 65 2c 20 6d 6f 76 65  |f possible, move|
00002d40  20 61 6e 6f 74 68 65 72  20 6f 75 74 2e 0d 10 a4  | another out....|
00002d50  04 0d 10 ae 17 20 20 20  20 e3 20 63 6f 75 6e 74  |.....    . count|
00002d60  65 72 3d 30 20 b8 20 33  0d 10 b8 56 20 20 20 20  |er=0 . 3...V    |
00002d70  20 20 e7 20 63 6f 75 6e  74 3c 32 20 80 20 64 69  |  . count<2 . di|
00002d80  63 65 3d 36 20 80 20 79  65 6c 6c 6f 77 28 63 6f  |ce=6 . yellow(co|
00002d90  75 6e 74 65 72 29 3d 30  20 80 20 62 65 65 6e 3d  |unter)=0 . been=|
00002da0  a3 20 8c 20 f2 6d 6f 76  65 28 79 65 6c 6c 6f 77  |. . .move(yellow|
00002db0  2c 63 6f 75 6e 74 65 72  2c 64 69 63 65 29 0d 10  |,counter,dice)..|
00002dc0  c2 11 20 20 20 20 ed 20  63 6f 75 6e 74 65 72 0d  |..    . counter.|
00002dd0  10 cc 04 0d 10 d6 57 f4  20 49 66 20 6e 6f 74 20  |......W. If not |
00002de0  70 6f 73 73 69 62 6c 65  20 74 68 65 6e 2c 20 69  |possible then, i|
00002df0  66 20 70 6f 73 73 69 62  6c 65 2c 20 6d 6f 76 65  |f possible, move|
00002e00  20 61 20 70 69 65 63 65  20 74 68 61 74 20 77 69  | a piece that wi|
00002e10  6c 6c 20 74 61 6b 65 20  61 6e 20 6f 70 70 6f 6e  |ll take an oppon|
00002e20  65 6e 74 73 20 70 69 65  63 65 0d 10 e0 04 0d 10  |ents piece......|
00002e30  ea 17 20 20 20 20 e3 20  63 6f 75 6e 74 65 72 3d  |..    . counter=|
00002e40  30 20 b8 20 33 0d 10 f4  34 20 20 20 20 20 20 e7  |0 . 3...4      .|
00002e50  20 79 65 6c 6c 6f 77 28  63 6f 75 6e 74 65 72 29  | yellow(counter)|
00002e60  3e 30 20 80 20 79 65 6c  6c 6f 77 28 63 6f 75 6e  |>0 . yellow(coun|
00002e70  74 65 72 29 3c 35 33 20  8c 0d 10 fe 18 20 20 20  |ter)<53 .....   |
00002e80  20 20 20 20 20 e3 20 6c  6f 6f 70 3d 30 20 b8 20  |     . loop=0 . |
00002e90  33 0d 11 08 50 20 20 20  20 20 20 20 20 20 20 e7  |3...P          .|
00002ea0  20 69 63 6f 6e 28 79 65  6c 6c 6f 77 2c 79 65 6c  | icon(yellow,yel|
00002eb0  6c 6f 77 28 63 6f 75 6e  74 65 72 29 2b 64 69 63  |low(counter)+dic|
00002ec0  65 29 3d 69 63 6f 6e 28  72 65 64 2c 72 65 64 28  |e)=icon(red,red(|
00002ed0  6c 6f 6f 70 29 29 20 80  20 62 65 65 6e 3d a3 20  |loop)) . been=. |
00002ee0  8c 0d 11 12 2a 20 20 20  20 20 20 20 20 20 20 20  |....*           |
00002ef0  20 f2 6d 6f 76 65 28 79  65 6c 6c 6f 77 2c 63 6f  | .move(yellow,co|
00002f00  75 6e 74 65 72 2c 64 69  63 65 29 0d 11 1c 0f 20  |unter,dice).... |
00002f10  20 20 20 20 20 20 20 20  20 cc 0d 11 26 54 20 20  |         ...&T  |
00002f20  20 20 20 20 20 20 20 20  20 20 e7 20 69 63 6f 6e  |          . icon|
00002f30  28 79 65 6c 6c 6f 77 2c  79 65 6c 6c 6f 77 28 63  |(yellow,yellow(c|
00002f40  6f 75 6e 74 65 72 29 2b  64 69 63 65 29 3d 69 63  |ounter)+dice)=ic|
00002f50  6f 6e 28 62 6c 75 65 2c  62 6c 75 65 28 6c 6f 6f  |on(blue,blue(loo|
00002f60  70 29 29 20 80 20 62 65  65 6e 3d a3 20 8c 0d 11  |p)) . been=. ...|
00002f70  30 2c 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |0,              |
00002f80  f2 6d 6f 76 65 28 79 65  6c 6c 6f 77 2c 63 6f 75  |.move(yellow,cou|
00002f90  6e 74 65 72 2c 64 69 63  65 29 0d 11 3a 11 20 20  |nter,dice)..:.  |
00002fa0  20 20 20 20 20 20 20 20  20 20 cc 0d 11 44 73 20  |          ...Ds |
00002fb0  20 20 20 20 20 20 20 20  20 20 20 20 20 e7 20 69  |             . i|
00002fc0  63 6f 6e 28 79 65 6c 6c  6f 77 2c 79 65 6c 6c 6f  |con(yellow,yello|
00002fd0  77 28 63 6f 75 6e 74 65  72 29 2b 64 69 63 65 29  |w(counter)+dice)|
00002fe0  3d 69 63 6f 6e 28 67 72  65 65 6e 2c 67 72 65 65  |=icon(green,gree|
00002ff0  6e 28 6c 6f 6f 70 29 29  20 80 20 62 65 65 6e 3d  |n(loop)) . been=|
00003000  a3 20 8c 20 f2 6d 6f 76  65 28 79 65 6c 6c 6f 77  |. . .move(yellow|
00003010  2c 63 6f 75 6e 74 65 72  2c 64 69 63 65 29 0d 11  |,counter,dice)..|
00003020  4e 11 20 20 20 20 20 20  20 20 20 20 20 20 cd 0d  |N.            ..|
00003030  11 58 0f 20 20 20 20 20  20 20 20 20 20 cd 0d 11  |.X.          ...|
00003040  62 12 20 20 20 20 20 20  20 20 ed 20 6c 6f 6f 70  |b.        . loop|
00003050  0d 11 6c 0b 20 20 20 20  20 20 cd 0d 11 76 11 20  |..l.      ...v. |
00003060  20 20 20 ed 20 63 6f 75  6e 74 65 72 0d 11 80 04  |   . counter....|
00003070  0d 11 8a 31 f4 20 49 66  20 6e 6f 74 20 70 6f 73  |...1. If not pos|
00003080  73 69 62 6c 65 20 74 68  65 6e 20 6d 6f 76 65 20  |sible then move |
00003090  61 20 70 69 65 63 65 20  74 6f 20 73 61 66 65 74  |a piece to safet|
000030a0  79 0d 11 94 04 0d 11 9e  17 20 20 20 20 e3 20 63  |y........    . c|
000030b0  6f 75 6e 74 65 72 3d 30  20 b8 20 33 0d 11 a8 74  |ounter=0 . 3...t|
000030c0  20 20 20 20 20 20 e7 20  79 65 6c 6c 6f 77 28 63  |      . yellow(c|
000030d0  6f 75 6e 74 65 72 29 3e  30 20 80 20 79 65 6c 6c  |ounter)>0 . yell|
000030e0  6f 77 28 63 6f 75 6e 74  65 72 29 3c 35 33 20 80  |ow(counter)<53 .|
000030f0  20 28 79 65 6c 6c 6f 77  28 63 6f 75 6e 74 65 72  | (yellow(counter|
00003100  29 2b 64 69 63 65 29 3e  35 32 20 80 20 62 65 65  |)+dice)>52 . bee|
00003110  6e 3d a3 20 8c 20 f2 6d  6f 76 65 28 79 65 6c 6c  |n=. . .move(yell|
00003120  6f 77 2c 63 6f 75 6e 74  65 72 2c 64 69 63 65 29  |ow,counter,dice)|
00003130  0d 11 b2 11 20 20 20 20  ed 20 63 6f 75 6e 74 65  |....    . counte|
00003140  72 0d 11 bc 04 0d 11 c6  27 f4 20 4f 74 68 65 72  |r.......'. Other|
00003150  77 69 73 65 20 6d 6f 76  65 20 61 6e 79 20 70 69  |wise move any pi|
00003160  65 63 65 20 70 6f 73 73  69 62 6c 65 0d 11 d0 04  |ece possible....|
00003170  0d 11 da 17 20 20 20 20  e3 20 63 6f 75 6e 74 65  |....    . counte|
00003180  72 3d 30 20 b8 20 33 0d  11 e4 58 20 20 20 20 20  |r=0 . 3...X     |
00003190  20 e7 20 79 65 6c 6c 6f  77 28 63 6f 75 6e 74 65  | . yellow(counte|
000031a0  72 29 3e 30 20 80 20 79  65 6c 6c 6f 77 28 63 6f  |r)>0 . yellow(co|
000031b0  75 6e 74 65 72 29 3c 35  38 20 80 20 62 65 65 6e  |unter)<58 . been|
000031c0  3d a3 20 8c 20 f2 6d 6f  76 65 28 79 65 6c 6c 6f  |=. . .move(yello|
000031d0  77 2c 63 6f 75 6e 74 65  72 2c 64 69 63 65 29 0d  |w,counter,dice).|
000031e0  11 ee 11 20 20 20 20 ed  20 63 6f 75 6e 74 65 72  |...    . counter|
000031f0  0d 11 f8 04 0d 12 02 07  20 20 cd 0d 12 0c 04 0d  |........  ......|
00003200  12 16 28 f4 20 2a 20 2a  20 4d 4f 56 45 20 47 52  |..(. * * MOVE GR|
00003210  45 45 4e 20 43 4f 4d 50  55 54 45 52 20 50 4c 41  |EEN COMPUTER PLA|
00003220  59 45 52 20 2a 20 2a 0d  12 20 04 0d 12 2a 30 20  |YER * *.. ...*0 |
00003230  20 e7 20 74 75 72 6e 3d  67 72 65 65 6e 20 80 20  | . turn=green . |
00003240  50 6c 61 79 65 72 54 79  70 65 28 74 75 72 6e 29  |PlayerType(turn)|
00003250  3d 43 6f 6d 70 75 74 65  72 20 8c 0d 12 34 04 0d  |=Computer ...4..|
00003260  12 3e 27 f4 20 46 69 6e  64 20 68 6f 77 20 6d 61  |.>'. Find how ma|
00003270  6e 79 20 70 69 65 63 65  73 20 61 72 65 20 69 6e  |ny pieces are in|
00003280  20 70 6c 61 79 2e 0d 12  48 04 0d 12 52 0f 20 20  | play...H...R.  |
00003290  20 20 63 6f 75 6e 74 3d  30 0d 12 5c 17 20 20 20  |  count=0..\.   |
000032a0  20 e3 20 63 6f 75 6e 74  65 72 3d 30 20 b8 20 33  | . counter=0 . 3|
000032b0  0d 12 66 3c 20 20 20 20  20 20 20 e7 20 67 72 65  |..f<       . gre|
000032c0  65 6e 28 63 6f 75 6e 74  65 72 29 3e 30 20 80 20  |en(counter)>0 . |
000032d0  67 72 65 65 6e 28 63 6f  75 6e 74 65 72 29 3c 35  |green(counter)<5|
000032e0  33 20 8c 20 63 6f 75 6e  74 2b 3d 31 0d 12 70 11  |3 . count+=1..p.|
000032f0  20 20 20 20 ed 20 63 6f  75 6e 74 65 72 0d 12 7a  |    . counter..z|
00003300  04 0d 12 84 4c f4 20 49  66 20 6c 65 73 73 20 74  |....L. If less t|
00003310  68 61 6e 20 32 20 70 69  65 63 65 73 20 61 72 65  |han 2 pieces are|
00003320  20 69 6e 20 70 6c 61 79  20 74 68 65 6e 2c 20 69  | in play then, i|
00003330  66 20 70 6f 73 73 69 62  6c 65 2c 20 6d 6f 76 65  |f possible, move|
00003340  20 61 6e 6f 74 68 65 72  20 6f 75 74 2e 0d 12 8e  | another out....|
00003350  04 0d 12 98 17 20 20 20  20 e3 20 63 6f 75 6e 74  |.....    . count|
00003360  65 72 3d 30 20 b8 20 33  0d 12 a2 54 20 20 20 20  |er=0 . 3...T    |
00003370  20 20 e7 20 63 6f 75 6e  74 3c 32 20 80 20 64 69  |  . count<2 . di|
00003380  63 65 3d 36 20 80 20 67  72 65 65 6e 28 63 6f 75  |ce=6 . green(cou|
00003390  6e 74 65 72 29 3d 30 20  80 20 62 65 65 6e 3d a3  |nter)=0 . been=.|
000033a0  20 8c 20 f2 6d 6f 76 65  28 67 72 65 65 6e 2c 63  | . .move(green,c|
000033b0  6f 75 6e 74 65 72 2c 64  69 63 65 29 0d 12 ac 11  |ounter,dice)....|
000033c0  20 20 20 20 ed 20 63 6f  75 6e 74 65 72 0d 12 b6  |    . counter...|
000033d0  04 0d 12 c0 57 f4 20 49  66 20 6e 6f 74 20 70 6f  |....W. If not po|
000033e0  73 73 69 62 6c 65 20 74  68 65 6e 2c 20 69 66 20  |ssible then, if |
000033f0  70 6f 73 73 69 62 6c 65  2c 20 6d 6f 76 65 20 61  |possible, move a|
00003400  20 70 69 65 63 65 20 74  68 61 74 20 77 69 6c 6c  | piece that will|
00003410  20 74 61 6b 65 20 61 6e  20 6f 70 70 6f 6e 65 6e  | take an opponen|
00003420  74 73 20 70 69 65 63 65  0d 12 ca 04 0d 12 d4 17  |ts piece........|
00003430  20 20 20 20 e3 20 63 6f  75 6e 74 65 72 3d 30 20  |    . counter=0 |
00003440  b8 20 33 0d 12 de 32 20  20 20 20 20 20 e7 20 67  |. 3...2      . g|
00003450  72 65 65 6e 28 63 6f 75  6e 74 65 72 29 3e 30 20  |reen(counter)>0 |
00003460  80 20 67 72 65 65 6e 28  63 6f 75 6e 74 65 72 29  |. green(counter)|
00003470  3c 35 33 20 8c 0d 12 e8  18 20 20 20 20 20 20 20  |<53 .....       |
00003480  20 e3 20 6c 6f 6f 70 3d  30 20 b8 20 33 0d 12 f2  | . loop=0 . 3...|
00003490  4e 20 20 20 20 20 20 20  20 20 20 e7 20 69 63 6f  |N          . ico|
000034a0  6e 28 67 72 65 65 6e 2c  67 72 65 65 6e 28 63 6f  |n(green,green(co|
000034b0  75 6e 74 65 72 29 2b 64  69 63 65 29 3d 69 63 6f  |unter)+dice)=ico|
000034c0  6e 28 72 65 64 2c 72 65  64 28 6c 6f 6f 70 29 29  |n(red,red(loop))|
000034d0  20 80 20 62 65 65 6e 3d  a3 20 8c 0d 12 fc 29 20  | . been=. ....) |
000034e0  20 20 20 20 20 20 20 20  20 20 20 f2 6d 6f 76 65  |           .move|
000034f0  28 67 72 65 65 6e 2c 63  6f 75 6e 74 65 72 2c 64  |(green,counter,d|
00003500  69 63 65 29 0d 13 06 0f  20 20 20 20 20 20 20 20  |ice)....        |
00003510  20 20 cc 0d 13 10 52 20  20 20 20 20 20 20 20 20  |  ....R         |
00003520  20 20 20 e7 20 69 63 6f  6e 28 67 72 65 65 6e 2c  |   . icon(green,|
00003530  67 72 65 65 6e 28 63 6f  75 6e 74 65 72 29 2b 64  |green(counter)+d|
00003540  69 63 65 29 3d 69 63 6f  6e 28 62 6c 75 65 2c 62  |ice)=icon(blue,b|
00003550  6c 75 65 28 6c 6f 6f 70  29 29 20 80 20 62 65 65  |lue(loop)) . bee|
00003560  6e 3d a3 20 8c 0d 13 1a  2b 20 20 20 20 20 20 20  |n=. ....+       |
00003570  20 20 20 20 20 20 20 f2  6d 6f 76 65 28 67 72 65  |       .move(gre|
00003580  65 6e 2c 63 6f 75 6e 74  65 72 2c 64 69 63 65 29  |en,counter,dice)|
00003590  0d 13 24 11 20 20 20 20  20 20 20 20 20 20 20 20  |..$.            |
000035a0  cc 0d 13 2e 72 20 20 20  20 20 20 20 20 20 20 20  |....r           |
000035b0  20 20 20 e7 20 69 63 6f  6e 28 67 72 65 65 6e 2c  |   . icon(green,|
000035c0  67 72 65 65 6e 28 63 6f  75 6e 74 65 72 29 2b 64  |green(counter)+d|
000035d0  69 63 65 29 3d 69 63 6f  6e 28 79 65 6c 6c 6f 77  |ice)=icon(yellow|
000035e0  2c 79 65 6c 6c 6f 77 28  6c 6f 6f 70 29 29 20 80  |,yellow(loop)) .|
000035f0  20 62 65 65 6e 3d a3 20  8c 20 f2 6d 6f 76 65 28  | been=. . .move(|
00003600  67 72 65 65 6e 2c 63 6f  75 6e 74 65 72 2c 64 69  |green,counter,di|
00003610  63 65 29 0d 13 38 11 20  20 20 20 20 20 20 20 20  |ce)..8.         |
00003620  20 20 20 cd 0d 13 42 0f  20 20 20 20 20 20 20 20  |   ...B.        |
00003630  20 20 cd 0d 13 4c 12 20  20 20 20 20 20 20 20 ed  |  ...L.        .|
00003640  20 6c 6f 6f 70 0d 13 56  0b 20 20 20 20 20 20 cd  | loop..V.      .|
00003650  0d 13 60 11 20 20 20 20  ed 20 63 6f 75 6e 74 65  |..`.    . counte|
00003660  72 0d 13 6a 04 0d 13 74  31 f4 20 49 66 20 6e 6f  |r..j...t1. If no|
00003670  74 20 70 6f 73 73 69 62  6c 65 20 74 68 65 6e 20  |t possible then |
00003680  6d 6f 76 65 20 61 20 70  69 65 63 65 20 74 6f 20  |move a piece to |
00003690  73 61 66 65 74 79 0d 13  7e 04 0d 13 88 17 20 20  |safety..~.....  |
000036a0  20 20 e3 20 63 6f 75 6e  74 65 72 3d 30 20 b8 20  |  . counter=0 . |
000036b0  33 0d 13 92 70 20 20 20  20 20 20 e7 20 67 72 65  |3...p      . gre|
000036c0  65 6e 28 63 6f 75 6e 74  65 72 29 3e 30 20 80 20  |en(counter)>0 . |
000036d0  67 72 65 65 6e 28 63 6f  75 6e 74 65 72 29 3c 35  |green(counter)<5|
000036e0  33 20 80 20 28 67 72 65  65 6e 28 63 6f 75 6e 74  |3 . (green(count|
000036f0  65 72 29 2b 64 69 63 65  29 3e 35 32 20 80 20 62  |er)+dice)>52 . b|
00003700  65 65 6e 3d a3 20 8c 20  f2 6d 6f 76 65 28 67 72  |een=. . .move(gr|
00003710  65 65 6e 2c 63 6f 75 6e  74 65 72 2c 64 69 63 65  |een,counter,dice|
00003720  29 0d 13 9c 11 20 20 20  20 ed 20 63 6f 75 6e 74  |)....    . count|
00003730  65 72 0d 13 a6 04 0d 13  b0 27 f4 20 4f 74 68 65  |er.......'. Othe|
00003740  72 77 69 73 65 20 6d 6f  76 65 20 61 6e 79 20 70  |rwise move any p|
00003750  69 65 63 65 20 70 6f 73  73 69 62 6c 65 0d 13 ba  |iece possible...|
00003760  04 0d 13 c4 17 20 20 20  20 e3 20 63 6f 75 6e 74  |.....    . count|
00003770  65 72 3d 30 20 b8 20 33  0d 13 ce 55 20 20 20 20  |er=0 . 3...U    |
00003780  20 20 e7 20 67 72 65 65  6e 28 63 6f 75 6e 74 65  |  . green(counte|
00003790  72 29 3e 30 20 80 20 67  72 65 65 6e 28 63 6f 75  |r)>0 . green(cou|
000037a0  6e 74 65 72 29 3c 35 38  20 80 20 62 65 65 6e 3d  |nter)<58 . been=|
000037b0  a3 20 8c 20 f2 6d 6f 76  65 28 67 72 65 65 6e 2c  |. . .move(green,|
000037c0  63 6f 75 6e 74 65 72 2c  64 69 63 65 29 0d 13 d8  |counter,dice)...|
000037d0  11 20 20 20 20 ed 20 63  6f 75 6e 74 65 72 0d 13  |.    . counter..|
000037e0  e2 04 0d 13 ec 07 20 20  cd 0d 13 f6 04 0d 14 00  |......  ........|
000037f0  05 e1 0d 14 0a 05 3a 0d  14 14 21 dd f2 6d 6f 76  |......:...!..mov|
00003800  65 28 63 6f 6c 6f 75 72  2c 63 6f 75 6e 74 65 72  |e(colour,counter|
00003810  2c 70 6c 61 63 65 73 29  0d 14 1e 04 0d 14 28 1e  |,places)......(.|
00003820  f4 20 2a 20 2a 20 4d 4f  56 45 20 52 45 44 20 43  |. * * MOVE RED C|
00003830  4f 55 4e 54 45 52 20 2a  20 2a 0d 14 32 04 0d 14  |OUNTER * *..2...|
00003840  3c 14 20 20 e7 20 63 6f  6c 6f 75 72 3d 72 65 64  |<.  . colour=red|
00003850  20 8c 0d 14 46 1a 20 20  20 20 e7 20 72 65 64 28  | ...F.    . red(|
00003860  63 6f 75 6e 74 65 72 29  3d 30 20 8c 0d 14 50 2d  |counter)=0 ...P-|
00003870  20 20 20 20 20 20 f2 43  68 61 6e 67 65 49 63 6f  |      .ChangeIco|
00003880  6e 28 6d 61 69 6e 25 2c  63 6f 75 6e 74 65 72 2b  |n(main%,counter+|
00003890  37 37 2c 22 22 2c 22 22  29 0d 14 5a 18 20 20 20  |77,"","")..Z.   |
000038a0  20 20 20 72 65 64 28 63  6f 75 6e 74 65 72 29 3d  |   red(counter)=|
000038b0  31 0d 14 64 09 20 20 20  20 cc 0d 14 6e 11 20 20  |1..d.    ...n.  |
000038c0  20 20 20 20 63 6f 75 6e  74 3d 30 0d 14 78 16 20  |    count=0..x. |
000038d0  20 20 20 20 20 e3 20 6c  6f 6f 70 3d 30 20 b8 20  |     . loop=0 . |
000038e0  33 0d 14 82 2f 20 20 20  20 20 20 20 20 e7 20 72  |3.../        . r|
000038f0  65 64 28 6c 6f 6f 70 29  3d 72 65 64 28 63 6f 75  |ed(loop)=red(cou|
00003900  6e 74 65 72 29 20 8c 20  63 6f 75 6e 74 2b 3d 31  |nter) . count+=1|
00003910  0d 14 8c 10 20 20 20 20  20 20 ed 20 6c 6f 6f 70  |....      . loop|
00003920  0d 14 96 15 20 20 20 20  20 20 e7 20 63 6f 75 6e  |....      . coun|
00003930  74 3d 31 20 8c 0d 14 a0  3b 20 20 20 20 20 20 20  |t=1 ....;       |
00003940  20 f2 43 68 61 6e 67 65  49 63 6f 6e 28 6d 61 69  | .ChangeIcon(mai|
00003950  6e 25 2c 69 63 6f 6e 28  72 65 64 2c 72 65 64 28  |n%,icon(red,red(|
00003960  63 6f 75 6e 74 65 72 29  29 2c 22 22 2c 22 22 29  |counter)),"","")|
00003970  0d 14 aa 0b 20 20 20 20  20 20 cc 0d 14 b4 47 20  |....      ....G |
00003980  20 20 20 20 20 20 20 f2  43 68 61 6e 67 65 49 63  |       .ChangeIc|
00003990  6f 6e 28 6d 61 69 6e 25  2c 69 63 6f 6e 28 72 65  |on(main%,icon(re|
000039a0  64 2c 72 65 64 28 63 6f  75 6e 74 65 72 29 29 2c  |d,red(counter)),|
000039b0  c3 28 63 6f 75 6e 74 2d  31 29 2c 22 73 72 65 64  |.(count-1),"sred|
000039c0  22 29 0d 14 be 0b 20 20  20 20 20 20 cd 0d 14 c8  |")....      ....|
000039d0  1e 20 20 20 20 20 20 72  65 64 28 63 6f 75 6e 74  |.      red(count|
000039e0  65 72 29 2b 3d 70 6c 61  63 65 73 0d 14 d2 09 20  |er)+=places.... |
000039f0  20 20 20 cd 0d 14 dc 04  0d 14 e6 3d 20 20 20 20  |   ........=    |
00003a00  e7 20 72 65 64 28 63 6f  75 6e 74 65 72 29 3e 35  |. red(counter)>5|
00003a10  38 20 8c 20 72 65 64 28  63 6f 75 6e 74 65 72 29  |8 . red(counter)|
00003a20  3d 35 38 2d 28 72 65 64  28 63 6f 75 6e 74 65 72  |=58-(red(counter|
00003a30  29 2d 35 38 29 0d 14 f0  04 0d 14 fa 14 20 20 20  |)-58)........   |
00003a40  20 e3 20 6c 6f 6f 70 3d  30 20 b8 20 33 0d 15 04  | . loop=0 . 3...|
00003a50  3a 20 20 20 20 20 20 e7  20 69 63 6f 6e 28 62 6c  |:      . icon(bl|
00003a60  75 65 2c 62 6c 75 65 28  6c 6f 6f 70 29 29 3d 69  |ue,blue(loop))=i|
00003a70  63 6f 6e 28 72 65 64 2c  72 65 64 28 63 6f 75 6e  |con(red,red(coun|
00003a80  74 65 72 29 29 20 8c 0d  15 0e 18 20 20 20 20 20  |ter)) .....     |
00003a90  20 20 20 62 6c 75 65 28  6c 6f 6f 70 29 3d 30 0d  |   blue(loop)=0.|
00003aa0  15 18 32 20 20 20 20 20  20 20 20 f2 43 68 61 6e  |..2        .Chan|
00003ab0  67 65 49 63 6f 6e 28 6d  61 69 6e 25 2c 6c 6f 6f  |geIcon(main%,loo|
00003ac0  70 2b 38 31 2c 22 31 22  2c 22 73 62 6c 75 65 22  |p+81,"1","sblue"|
00003ad0  29 0d 15 22 0b 20 20 20  20 20 20 cd 0d 15 2c 04  |)..".      ...,.|
00003ae0  0d 15 36 3e 20 20 20 20  20 20 e7 20 69 63 6f 6e  |..6>      . icon|
00003af0  28 79 65 6c 6c 6f 77 2c  79 65 6c 6c 6f 77 28 6c  |(yellow,yellow(l|
00003b00  6f 6f 70 29 29 3d 69 63  6f 6e 28 72 65 64 2c 72  |oop))=icon(red,r|
00003b10  65 64 28 63 6f 75 6e 74  65 72 29 29 20 8c 0d 15  |ed(counter)) ...|
00003b20  40 1a 20 20 20 20 20 20  20 20 79 65 6c 6c 6f 77  |@.        yellow|
00003b30  28 6c 6f 6f 70 29 3d 30  0d 15 4a 34 20 20 20 20  |(loop)=0..J4    |
00003b40  20 20 20 20 f2 43 68 61  6e 67 65 49 63 6f 6e 28  |    .ChangeIcon(|
00003b50  6d 61 69 6e 25 2c 6c 6f  6f 70 2b 38 35 2c 22 31  |main%,loop+85,"1|
00003b60  22 2c 22 73 79 65 6c 6c  6f 77 22 29 0d 15 54 0b  |","syellow")..T.|
00003b70  20 20 20 20 20 20 cd 0d  15 5e 04 0d 15 68 3c 20  |      ...^...h< |
00003b80  20 20 20 20 20 e7 20 69  63 6f 6e 28 67 72 65 65  |     . icon(gree|
00003b90  6e 2c 67 72 65 65 6e 28  6c 6f 6f 70 29 29 3d 69  |n,green(loop))=i|
00003ba0  63 6f 6e 28 72 65 64 2c  72 65 64 28 63 6f 75 6e  |con(red,red(coun|
00003bb0  74 65 72 29 29 20 8c 0d  15 72 19 20 20 20 20 20  |ter)) ...r.     |
00003bc0  20 20 20 67 72 65 65 6e  28 6c 6f 6f 70 29 3d 30  |   green(loop)=0|
00003bd0  0d 15 7c 33 20 20 20 20  20 20 20 20 f2 43 68 61  |..|3        .Cha|
00003be0  6e 67 65 49 63 6f 6e 28  6d 61 69 6e 25 2c 6c 6f  |ngeIcon(main%,lo|
00003bf0  6f 70 2b 38 39 2c 22 31  22 2c 22 73 67 72 65 65  |op+89,"1","sgree|
00003c00  6e 22 29 0d 15 86 0b 20  20 20 20 20 20 cd 0d 15  |n")....      ...|
00003c10  90 0e 20 20 20 20 ed 20  6c 6f 6f 70 0d 15 9a 04  |..    . loop....|
00003c20  0d 15 a4 0f 20 20 20 20  63 6f 75 6e 74 3d 30 0d  |....    count=0.|
00003c30  15 ae 14 20 20 20 20 e3  20 6c 6f 6f 70 3d 30 20  |...    . loop=0 |
00003c40  b8 20 33 0d 15 b8 2d 20  20 20 20 20 20 e7 20 72  |. 3...-      . r|
00003c50  65 64 28 6c 6f 6f 70 29  3d 72 65 64 28 63 6f 75  |ed(loop)=red(cou|
00003c60  6e 74 65 72 29 20 8c 20  63 6f 75 6e 74 2b 3d 31  |nter) . count+=1|
00003c70  0d 15 c2 0e 20 20 20 20  ed 20 6c 6f 6f 70 0d 15  |....    . loop..|
00003c80  cc 04 0d 15 d6 41 20 20  20 20 f2 43 68 61 6e 67  |.....A    .Chang|
00003c90  65 49 63 6f 6e 28 6d 61  69 6e 25 2c 69 63 6f 6e  |eIcon(main%,icon|
00003ca0  28 72 65 64 2c 72 65 64  28 63 6f 75 6e 74 65 72  |(red,red(counter|
00003cb0  29 29 2c c3 28 63 6f 75  6e 74 29 2c 22 73 72 65  |)),.(count),"sre|
00003cc0  64 22 29 0d 15 e0 07 20  20 cd 0d 15 ea 04 0d 15  |d")....  .......|
00003cd0  f4 1f f4 20 2a 20 2a 20  4d 4f 56 45 20 42 4c 55  |... * * MOVE BLU|
00003ce0  45 20 43 4f 55 4e 54 45  52 20 2a 20 2a 0d 15 fe  |E COUNTER * *...|
00003cf0  04 0d 16 08 15 20 20 e7  20 63 6f 6c 6f 75 72 3d  |.....  . colour=|
00003d00  62 6c 75 65 20 8c 0d 16  12 1b 20 20 20 20 e7 20  |blue .....    . |
00003d10  62 6c 75 65 28 63 6f 75  6e 74 65 72 29 3d 30 20  |blue(counter)=0 |
00003d20  8c 0d 16 1c 2d 20 20 20  20 20 20 f2 43 68 61 6e  |....-      .Chan|
00003d30  67 65 49 63 6f 6e 28 6d  61 69 6e 25 2c 63 6f 75  |geIcon(main%,cou|
00003d40  6e 74 65 72 2b 38 31 2c  22 22 2c 22 22 29 0d 16  |nter+81,"","")..|
00003d50  26 19 20 20 20 20 20 20  62 6c 75 65 28 63 6f 75  |&.      blue(cou|
00003d60  6e 74 65 72 29 3d 31 0d  16 30 09 20 20 20 20 cc  |nter)=1..0.    .|
00003d70  0d 16 3a 11 20 20 20 20  20 20 63 6f 75 6e 74 3d  |..:.      count=|
00003d80  30 0d 16 44 16 20 20 20  20 20 20 e3 20 6c 6f 6f  |0..D.      . loo|
00003d90  70 3d 30 20 b8 20 33 0d  16 4e 31 20 20 20 20 20  |p=0 . 3..N1     |
00003da0  20 20 20 e7 20 62 6c 75  65 28 6c 6f 6f 70 29 3d  |   . blue(loop)=|
00003db0  62 6c 75 65 28 63 6f 75  6e 74 65 72 29 20 8c 20  |blue(counter) . |
00003dc0  63 6f 75 6e 74 2b 3d 31  0d 16 58 10 20 20 20 20  |count+=1..X.    |
00003dd0  20 20 ed 20 6c 6f 6f 70  0d 16 62 15 20 20 20 20  |  . loop..b.    |
00003de0  20 20 e7 20 63 6f 75 6e  74 3d 31 20 8c 0d 16 6c  |  . count=1 ...l|
00003df0  3d 20 20 20 20 20 20 20  20 f2 43 68 61 6e 67 65  |=        .Change|
00003e00  49 63 6f 6e 28 6d 61 69  6e 25 2c 69 63 6f 6e 28  |Icon(main%,icon(|
00003e10  62 6c 75 65 2c 62 6c 75  65 28 63 6f 75 6e 74 65  |blue,blue(counte|
00003e20  72 29 29 2c 22 22 2c 22  22 29 0d 16 76 0b 20 20  |r)),"","")..v.  |
00003e30  20 20 20 20 cc 0d 16 80  4a 20 20 20 20 20 20 20  |    ....J       |
00003e40  20 f2 43 68 61 6e 67 65  49 63 6f 6e 28 6d 61 69  | .ChangeIcon(mai|
00003e50  6e 25 2c 69 63 6f 6e 28  62 6c 75 65 2c 62 6c 75  |n%,icon(blue,blu|
00003e60  65 28 63 6f 75 6e 74 65  72 29 29 2c c3 28 63 6f  |e(counter)),.(co|
00003e70  75 6e 74 2d 31 29 2c 22  73 62 6c 75 65 22 29 0d  |unt-1),"sblue").|
00003e80  16 8a 0b 20 20 20 20 20  20 cd 0d 16 94 1f 20 20  |...      .....  |
00003e90  20 20 20 20 62 6c 75 65  28 63 6f 75 6e 74 65 72  |    blue(counter|
00003ea0  29 2b 3d 70 6c 61 63 65  73 0d 16 9e 09 20 20 20  |)+=places....   |
00003eb0  20 cd 0d 16 a8 04 0d 16  b2 40 20 20 20 20 e7 20  | ........@    . |
00003ec0  62 6c 75 65 28 63 6f 75  6e 74 65 72 29 3e 35 38  |blue(counter)>58|
00003ed0  20 8c 20 62 6c 75 65 28  63 6f 75 6e 74 65 72 29  | . blue(counter)|
00003ee0  3d 35 38 2d 28 62 6c 75  65 28 63 6f 75 6e 74 65  |=58-(blue(counte|
00003ef0  72 29 2d 35 38 29 0d 16  bc 04 0d 16 c6 14 20 20  |r)-58)........  |
00003f00  20 20 e3 20 6c 6f 6f 70  3d 30 20 b8 20 33 0d 16  |  . loop=0 . 3..|
00003f10  d0 3a 20 20 20 20 20 20  e7 20 69 63 6f 6e 28 72  |.:      . icon(r|
00003f20  65 64 2c 72 65 64 28 6c  6f 6f 70 29 29 3d 69 63  |ed,red(loop))=ic|
00003f30  6f 6e 28 62 6c 75 65 2c  62 6c 75 65 28 63 6f 75  |on(blue,blue(cou|
00003f40  6e 74 65 72 29 29 20 8c  0d 16 da 17 20 20 20 20  |nter)) .....    |
00003f50  20 20 20 20 72 65 64 28  6c 6f 6f 70 29 3d 30 0d  |    red(loop)=0.|
00003f60  16 e4 31 20 20 20 20 20  20 20 20 f2 43 68 61 6e  |..1        .Chan|
00003f70  67 65 49 63 6f 6e 28 6d  61 69 6e 25 2c 6c 6f 6f  |geIcon(main%,loo|
00003f80  70 2b 37 37 2c 22 31 22  2c 22 73 72 65 64 22 29  |p+77,"1","sred")|
00003f90  0d 16 ee 0b 20 20 20 20  20 20 cd 0d 16 f8 04 0d  |....      ......|
00003fa0  17 02 40 20 20 20 20 20  20 e7 20 69 63 6f 6e 28  |..@      . icon(|
00003fb0  79 65 6c 6c 6f 77 2c 79  65 6c 6c 6f 77 28 6c 6f  |yellow,yellow(lo|
00003fc0  6f 70 29 29 3d 69 63 6f  6e 28 62 6c 75 65 2c 62  |op))=icon(blue,b|
00003fd0  6c 75 65 28 63 6f 75 6e  74 65 72 29 29 20 8c 0d  |lue(counter)) ..|
00003fe0  17 0c 1a 20 20 20 20 20  20 20 20 79 65 6c 6c 6f  |...        yello|
00003ff0  77 28 6c 6f 6f 70 29 3d  30 0d 17 16 34 20 20 20  |w(loop)=0...4   |
00004000  20 20 20 20 20 f2 43 68  61 6e 67 65 49 63 6f 6e  |     .ChangeIcon|
00004010  28 6d 61 69 6e 25 2c 6c  6f 6f 70 2b 38 35 2c 22  |(main%,loop+85,"|
00004020  31 22 2c 22 73 79 65 6c  6c 6f 77 22 29 0d 17 20  |1","syellow").. |
00004030  0b 20 20 20 20 20 20 cd  0d 17 2a 04 0d 17 34 3e  |.      ...*...4>|
00004040  20 20 20 20 20 20 e7 20  69 63 6f 6e 28 67 72 65  |      . icon(gre|
00004050  65 6e 2c 67 72 65 65 6e  28 6c 6f 6f 70 29 29 3d  |en,green(loop))=|
00004060  69 63 6f 6e 28 62 6c 75  65 2c 62 6c 75 65 28 63  |icon(blue,blue(c|
00004070  6f 75 6e 74 65 72 29 29  20 8c 0d 17 3e 19 20 20  |ounter)) ...>.  |
00004080  20 20 20 20 20 20 67 72  65 65 6e 28 6c 6f 6f 70  |      green(loop|
00004090  29 3d 30 0d 17 48 33 20  20 20 20 20 20 20 20 f2  |)=0..H3        .|
000040a0  43 68 61 6e 67 65 49 63  6f 6e 28 6d 61 69 6e 25  |ChangeIcon(main%|
000040b0  2c 6c 6f 6f 70 2b 38 39  2c 22 31 22 2c 22 73 67  |,loop+89,"1","sg|
000040c0  72 65 65 6e 22 29 0d 17  52 0b 20 20 20 20 20 20  |reen")..R.      |
000040d0  cd 0d 17 5c 0e 20 20 20  20 ed 20 6c 6f 6f 70 0d  |...\.    . loop.|
000040e0  17 66 04 0d 17 70 0f 20  20 20 20 63 6f 75 6e 74  |.f...p.    count|
000040f0  3d 30 0d 17 7a 14 20 20  20 20 e3 20 6c 6f 6f 70  |=0..z.    . loop|
00004100  3d 30 20 b8 20 33 0d 17  84 2f 20 20 20 20 20 20  |=0 . 3.../      |
00004110  e7 20 62 6c 75 65 28 6c  6f 6f 70 29 3d 62 6c 75  |. blue(loop)=blu|
00004120  65 28 63 6f 75 6e 74 65  72 29 20 8c 20 63 6f 75  |e(counter) . cou|
00004130  6e 74 2b 3d 31 0d 17 8e  0e 20 20 20 20 ed 20 6c  |nt+=1....    . l|
00004140  6f 6f 70 0d 17 98 04 0d  17 a2 44 20 20 20 20 f2  |oop.......D    .|
00004150  43 68 61 6e 67 65 49 63  6f 6e 28 6d 61 69 6e 25  |ChangeIcon(main%|
00004160  2c 69 63 6f 6e 28 62 6c  75 65 2c 62 6c 75 65 28  |,icon(blue,blue(|
00004170  63 6f 75 6e 74 65 72 29  29 2c c3 28 63 6f 75 6e  |counter)),.(coun|
00004180  74 29 2c 22 73 62 6c 75  65 22 29 0d 17 ac 07 20  |t),"sblue").... |
00004190  20 cd 0d 17 b6 04 0d 17  c0 21 f4 20 2a 20 2a 20  | ........!. * * |
000041a0  4d 4f 56 45 20 59 45 4c  4c 4f 57 20 43 4f 55 4e  |MOVE YELLOW COUN|
000041b0  54 45 52 20 2a 20 2a 0d  17 ca 04 0d 17 d4 15 e7  |TER * *.........|
000041c0  20 63 6f 6c 6f 75 72 3d  79 65 6c 6c 6f 77 20 8c  | colour=yellow .|
000041d0  0d 17 de 1d 20 20 20 20  e7 20 79 65 6c 6c 6f 77  |....    . yellow|
000041e0  28 63 6f 75 6e 74 65 72  29 3d 30 20 8c 0d 17 e8  |(counter)=0 ....|
000041f0  2d 20 20 20 20 20 20 f2  43 68 61 6e 67 65 49 63  |-      .ChangeIc|
00004200  6f 6e 28 6d 61 69 6e 25  2c 63 6f 75 6e 74 65 72  |on(main%,counter|
00004210  2b 38 35 2c 22 22 2c 22  22 29 0d 17 f2 1b 20 20  |+85,"","")....  |
00004220  20 20 20 20 79 65 6c 6c  6f 77 28 63 6f 75 6e 74  |    yellow(count|
00004230  65 72 29 3d 31 0d 17 fc  09 20 20 20 20 cc 0d 18  |er)=1....    ...|
00004240  06 11 20 20 20 20 20 20  63 6f 75 6e 74 3d 30 0d  |..      count=0.|
00004250  18 10 16 20 20 20 20 20  20 e3 20 6c 6f 6f 70 3d  |...      . loop=|
00004260  30 20 b8 20 33 0d 18 1a  35 20 20 20 20 20 20 20  |0 . 3...5       |
00004270  20 e7 20 79 65 6c 6c 6f  77 28 6c 6f 6f 70 29 3d  | . yellow(loop)=|
00004280  79 65 6c 6c 6f 77 28 63  6f 75 6e 74 65 72 29 20  |yellow(counter) |
00004290  8c 20 63 6f 75 6e 74 2b  3d 31 0d 18 24 10 20 20  |. count+=1..$.  |
000042a0  20 20 20 20 ed 20 6c 6f  6f 70 0d 18 2e 15 20 20  |    . loop....  |
000042b0  20 20 20 20 e7 20 63 6f  75 6e 74 3d 31 20 8c 0d  |    . count=1 ..|
000042c0  18 38 41 20 20 20 20 20  20 20 20 f2 43 68 61 6e  |.8A        .Chan|
000042d0  67 65 49 63 6f 6e 28 6d  61 69 6e 25 2c 69 63 6f  |geIcon(main%,ico|
000042e0  6e 28 79 65 6c 6c 6f 77  2c 79 65 6c 6c 6f 77 28  |n(yellow,yellow(|
000042f0  63 6f 75 6e 74 65 72 29  29 2c 22 22 2c 22 22 29  |counter)),"","")|
00004300  0d 18 42 0b 20 20 20 20  20 20 cc 0d 18 4c 50 20  |..B.      ...LP |
00004310  20 20 20 20 20 20 20 f2  43 68 61 6e 67 65 49 63  |       .ChangeIc|
00004320  6f 6e 28 6d 61 69 6e 25  2c 69 63 6f 6e 28 79 65  |on(main%,icon(ye|
00004330  6c 6c 6f 77 2c 79 65 6c  6c 6f 77 28 63 6f 75 6e  |llow,yellow(coun|
00004340  74 65 72 29 29 2c c3 28  63 6f 75 6e 74 2d 31 29  |ter)),.(count-1)|
00004350  2c 22 73 79 65 6c 6c 6f  77 22 29 0d 18 56 0b 20  |,"syellow")..V. |
00004360  20 20 20 20 20 cd 0d 18  60 21 20 20 20 20 20 20  |     ...`!      |
00004370  79 65 6c 6c 6f 77 28 63  6f 75 6e 74 65 72 29 2b  |yellow(counter)+|
00004380  3d 70 6c 61 63 65 73 0d  18 6a 09 20 20 20 20 cd  |=places..j.    .|
00004390  0d 18 74 04 0d 18 7e 46  20 20 20 20 e7 20 79 65  |..t...~F    . ye|
000043a0  6c 6c 6f 77 28 63 6f 75  6e 74 65 72 29 3e 35 38  |llow(counter)>58|
000043b0  20 8c 20 79 65 6c 6c 6f  77 28 63 6f 75 6e 74 65  | . yellow(counte|
000043c0  72 29 3d 35 38 2d 28 79  65 6c 6c 6f 77 28 63 6f  |r)=58-(yellow(co|
000043d0  75 6e 74 65 72 29 2d 35  38 29 0d 18 88 04 0d 18  |unter)-58)......|
000043e0  92 14 20 20 20 20 e3 20  6c 6f 6f 70 3d 30 20 b8  |..    . loop=0 .|
000043f0  20 33 0d 18 9c 3e 20 20  20 20 20 20 e7 20 69 63  | 3...>      . ic|
00004400  6f 6e 28 72 65 64 2c 72  65 64 28 6c 6f 6f 70 29  |on(red,red(loop)|
00004410  29 3d 69 63 6f 6e 28 79  65 6c 6c 6f 77 2c 79 65  |)=icon(yellow,ye|
00004420  6c 6c 6f 77 28 63 6f 75  6e 74 65 72 29 29 20 8c  |llow(counter)) .|
00004430  0d 18 a6 17 20 20 20 20  20 20 20 20 72 65 64 28  |....        red(|
00004440  6c 6f 6f 70 29 3d 30 0d  18 b0 31 20 20 20 20 20  |loop)=0...1     |
00004450  20 20 20 f2 43 68 61 6e  67 65 49 63 6f 6e 28 6d  |   .ChangeIcon(m|
00004460  61 69 6e 25 2c 6c 6f 6f  70 2b 37 37 2c 22 31 22  |ain%,loop+77,"1"|
00004470  2c 22 73 72 65 64 22 29  0d 18 ba 0b 20 20 20 20  |,"sred")....    |
00004480  20 20 cd 0d 18 c4 04 0d  18 ce 40 20 20 20 20 20  |  ........@     |
00004490  20 e7 20 69 63 6f 6e 28  62 6c 75 65 2c 62 6c 75  | . icon(blue,blu|
000044a0  65 28 6c 6f 6f 70 29 29  3d 69 63 6f 6e 28 79 65  |e(loop))=icon(ye|
000044b0  6c 6c 6f 77 2c 79 65 6c  6c 6f 77 28 63 6f 75 6e  |llow,yellow(coun|
000044c0  74 65 72 29 29 20 8c 0d  18 d8 18 20 20 20 20 20  |ter)) .....     |
000044d0  20 20 20 62 6c 75 65 28  6c 6f 6f 70 29 3d 30 0d  |   blue(loop)=0.|
000044e0  18 e2 32 20 20 20 20 20  20 20 20 f2 43 68 61 6e  |..2        .Chan|
000044f0  67 65 49 63 6f 6e 28 6d  61 69 6e 25 2c 6c 6f 6f  |geIcon(main%,loo|
00004500  70 2b 38 31 2c 22 31 22  2c 22 73 62 6c 75 65 22  |p+81,"1","sblue"|
00004510  29 0d 18 ec 0b 20 20 20  20 20 20 cd 0d 18 f6 04  |)....      .....|
00004520  0d 19 00 42 20 20 20 20  20 20 e7 20 69 63 6f 6e  |...B      . icon|
00004530  28 67 72 65 65 6e 2c 67  72 65 65 6e 28 6c 6f 6f  |(green,green(loo|
00004540  70 29 29 3d 69 63 6f 6e  28 79 65 6c 6c 6f 77 2c  |p))=icon(yellow,|
00004550  79 65 6c 6c 6f 77 28 63  6f 75 6e 74 65 72 29 29  |yellow(counter))|
00004560  20 8c 0d 19 0a 19 20 20  20 20 20 20 20 20 67 72  | .....        gr|
00004570  65 65 6e 28 6c 6f 6f 70  29 3d 30 0d 19 14 33 20  |een(loop)=0...3 |
00004580  20 20 20 20 20 20 20 f2  43 68 61 6e 67 65 49 63  |       .ChangeIc|
00004590  6f 6e 28 6d 61 69 6e 25  2c 6c 6f 6f 70 2b 38 39  |on(main%,loop+89|
000045a0  2c 22 31 22 2c 22 73 67  72 65 65 6e 22 29 0d 19  |,"1","sgreen")..|
000045b0  1e 0b 20 20 20 20 20 20  cd 0d 19 28 0e 20 20 20  |..      ...(.   |
000045c0  20 ed 20 6c 6f 6f 70 0d  19 32 04 0d 19 3c 0f 20  | . loop..2...<. |
000045d0  20 20 20 63 6f 75 6e 74  3d 30 0d 19 46 14 20 20  |   count=0..F.  |
000045e0  20 20 e3 20 6c 6f 6f 70  3d 30 20 b8 20 33 0d 19  |  . loop=0 . 3..|
000045f0  50 33 20 20 20 20 20 20  e7 20 79 65 6c 6c 6f 77  |P3      . yellow|
00004600  28 6c 6f 6f 70 29 3d 79  65 6c 6c 6f 77 28 63 6f  |(loop)=yellow(co|
00004610  75 6e 74 65 72 29 20 8c  20 63 6f 75 6e 74 2b 3d  |unter) . count+=|
00004620  31 0d 19 5a 0e 20 20 20  20 ed 20 6c 6f 6f 70 0d  |1..Z.    . loop.|
00004630  19 64 04 0d 19 6e 4a 20  20 20 20 f2 43 68 61 6e  |.d...nJ    .Chan|
00004640  67 65 49 63 6f 6e 28 6d  61 69 6e 25 2c 69 63 6f  |geIcon(main%,ico|
00004650  6e 28 79 65 6c 6c 6f 77  2c 79 65 6c 6c 6f 77 28  |n(yellow,yellow(|
00004660  63 6f 75 6e 74 65 72 29  29 2c c3 28 63 6f 75 6e  |counter)),.(coun|
00004670  74 29 2c 22 73 79 65 6c  6c 6f 77 22 29 0d 19 78  |t),"syellow")..x|
00004680  07 20 20 cd 0d 19 82 04  0d 19 8c 20 f4 20 2a 20  |.  ........ . * |
00004690  2a 20 4d 4f 56 45 20 47  52 45 45 4e 20 43 4f 55  |* MOVE GREEN COU|
000046a0  4e 54 45 52 20 2a 20 2a  0d 19 96 04 0d 19 a0 14  |NTER * *........|
000046b0  e7 20 63 6f 6c 6f 75 72  3d 67 72 65 65 6e 20 8c  |. colour=green .|
000046c0  0d 19 aa 1c 20 20 20 20  e7 20 67 72 65 65 6e 28  |....    . green(|
000046d0  63 6f 75 6e 74 65 72 29  3d 30 20 8c 0d 19 b4 2d  |counter)=0 ....-|
000046e0  20 20 20 20 20 20 f2 43  68 61 6e 67 65 49 63 6f  |      .ChangeIco|
000046f0  6e 28 6d 61 69 6e 25 2c  63 6f 75 6e 74 65 72 2b  |n(main%,counter+|
00004700  38 39 2c 22 22 2c 22 22  29 0d 19 be 1a 20 20 20  |89,"","")....   |
00004710  20 20 20 67 72 65 65 6e  28 63 6f 75 6e 74 65 72  |   green(counter|
00004720  29 3d 31 0d 19 c8 09 20  20 20 20 cc 0d 19 d2 11  |)=1....    .....|
00004730  20 20 20 20 20 20 63 6f  75 6e 74 3d 30 0d 19 dc  |      count=0...|
00004740  16 20 20 20 20 20 20 e3  20 6c 6f 6f 70 3d 30 20  |.      . loop=0 |
00004750  b8 20 33 0d 19 e6 33 20  20 20 20 20 20 20 20 e7  |. 3...3        .|
00004760  20 67 72 65 65 6e 28 6c  6f 6f 70 29 3d 67 72 65  | green(loop)=gre|
00004770  65 6e 28 63 6f 75 6e 74  65 72 29 20 8c 20 63 6f  |en(counter) . co|
00004780  75 6e 74 2b 3d 31 0d 19  f0 10 20 20 20 20 20 20  |unt+=1....      |
00004790  ed 20 6c 6f 6f 70 0d 19  fa 15 20 20 20 20 20 20  |. loop....      |
000047a0  e7 20 63 6f 75 6e 74 3d  31 20 8c 0d 1a 04 3f 20  |. count=1 ....? |
000047b0  20 20 20 20 20 20 20 f2  43 68 61 6e 67 65 49 63  |       .ChangeIc|
000047c0  6f 6e 28 6d 61 69 6e 25  2c 69 63 6f 6e 28 67 72  |on(main%,icon(gr|
000047d0  65 65 6e 2c 67 72 65 65  6e 28 63 6f 75 6e 74 65  |een,green(counte|
000047e0  72 29 29 2c 22 22 2c 22  22 29 0d 1a 0e 0b 20 20  |r)),"","")....  |
000047f0  20 20 20 20 cc 0d 1a 18  4d 20 20 20 20 20 20 20  |    ....M       |
00004800  20 f2 43 68 61 6e 67 65  49 63 6f 6e 28 6d 61 69  | .ChangeIcon(mai|
00004810  6e 25 2c 69 63 6f 6e 28  67 72 65 65 6e 2c 67 72  |n%,icon(green,gr|
00004820  65 65 6e 28 63 6f 75 6e  74 65 72 29 29 2c c3 28  |een(counter)),.(|
00004830  63 6f 75 6e 74 2d 31 29  2c 22 73 67 72 65 65 6e  |count-1),"sgreen|
00004840  22 29 0d 1a 22 0b 20 20  20 20 20 20 cd 0d 1a 2c  |")..".      ...,|
00004850  20 20 20 20 20 20 20 67  72 65 65 6e 28 63 6f 75  |       green(cou|
00004860  6e 74 65 72 29 2b 3d 70  6c 61 63 65 73 0d 1a 36  |nter)+=places..6|
00004870  09 20 20 20 20 cd 0d 1a  40 04 0d 1a 4a 43 20 20  |.    ...@...JC  |
00004880  20 20 e7 20 67 72 65 65  6e 28 63 6f 75 6e 74 65  |  . green(counte|
00004890  72 29 3e 35 38 20 8c 20  67 72 65 65 6e 28 63 6f  |r)>58 . green(co|
000048a0  75 6e 74 65 72 29 3d 35  38 2d 28 67 72 65 65 6e  |unter)=58-(green|
000048b0  28 63 6f 75 6e 74 65 72  29 2d 35 38 29 0d 1a 54  |(counter)-58)..T|
000048c0  04 0d 1a 5e 14 20 20 20  20 e3 20 6c 6f 6f 70 3d  |...^.    . loop=|
000048d0  30 20 b8 20 33 0d 1a 68  3c 20 20 20 20 20 20 e7  |0 . 3..h<      .|
000048e0  20 69 63 6f 6e 28 72 65  64 2c 72 65 64 28 6c 6f  | icon(red,red(lo|
000048f0  6f 70 29 29 3d 69 63 6f  6e 28 67 72 65 65 6e 2c  |op))=icon(green,|
00004900  67 72 65 65 6e 28 63 6f  75 6e 74 65 72 29 29 20  |green(counter)) |
00004910  8c 0d 1a 72 17 20 20 20  20 20 20 20 20 72 65 64  |...r.        red|
00004920  28 6c 6f 6f 70 29 3d 30  0d 1a 7c 31 20 20 20 20  |(loop)=0..|1    |
00004930  20 20 20 20 f2 43 68 61  6e 67 65 49 63 6f 6e 28  |    .ChangeIcon(|
00004940  6d 61 69 6e 25 2c 6c 6f  6f 70 2b 37 37 2c 22 31  |main%,loop+77,"1|
00004950  22 2c 22 73 72 65 64 22  29 0d 1a 86 0b 20 20 20  |","sred")....   |
00004960  20 20 20 cd 0d 1a 90 04  0d 1a 9a 3e 20 20 20 20  |   ........>    |
00004970  20 20 e7 20 69 63 6f 6e  28 62 6c 75 65 2c 62 6c  |  . icon(blue,bl|
00004980  75 65 28 6c 6f 6f 70 29  29 3d 69 63 6f 6e 28 67  |ue(loop))=icon(g|
00004990  72 65 65 6e 2c 67 72 65  65 6e 28 63 6f 75 6e 74  |reen,green(count|
000049a0  65 72 29 29 20 8c 0d 1a  a4 18 20 20 20 20 20 20  |er)) .....      |
000049b0  20 20 62 6c 75 65 28 6c  6f 6f 70 29 3d 30 0d 1a  |  blue(loop)=0..|
000049c0  ae 32 20 20 20 20 20 20  20 20 f2 43 68 61 6e 67  |.2        .Chang|
000049d0  65 49 63 6f 6e 28 6d 61  69 6e 25 2c 6c 6f 6f 70  |eIcon(main%,loop|
000049e0  2b 38 31 2c 22 31 22 2c  22 73 62 6c 75 65 22 29  |+81,"1","sblue")|
000049f0  0d 1a b8 0b 20 20 20 20  20 20 cd 0d 1a c2 04 0d  |....      ......|
00004a00  1a cc 42 20 20 20 20 20  20 e7 20 69 63 6f 6e 28  |..B      . icon(|
00004a10  79 65 6c 6c 6f 77 2c 79  65 6c 6c 6f 77 28 6c 6f  |yellow,yellow(lo|
00004a20  6f 70 29 29 3d 69 63 6f  6e 28 67 72 65 65 6e 2c  |op))=icon(green,|
00004a30  67 72 65 65 6e 28 63 6f  75 6e 74 65 72 29 29 20  |green(counter)) |
00004a40  8c 0d 1a d6 1a 20 20 20  20 20 20 20 20 79 65 6c  |.....        yel|
00004a50  6c 6f 77 28 6c 6f 6f 70  29 3d 30 0d 1a e0 34 20  |low(loop)=0...4 |
00004a60  20 20 20 20 20 20 20 f2  43 68 61 6e 67 65 49 63  |       .ChangeIc|
00004a70  6f 6e 28 6d 61 69 6e 25  2c 6c 6f 6f 70 2b 38 35  |on(main%,loop+85|
00004a80  2c 22 31 22 2c 22 73 79  65 6c 6c 6f 77 22 29 0d  |,"1","syellow").|
00004a90  1a ea 0b 20 20 20 20 20  20 cd 0d 1a f4 0e 20 20  |...      .....  |
00004aa0  20 20 ed 20 6c 6f 6f 70  0d 1a fe 0f 20 20 20 20  |  . loop....    |
00004ab0  63 6f 75 6e 74 3d 30 0d  1b 08 04 0d 1b 12 14 20  |count=0........ |
00004ac0  20 20 20 e3 20 6c 6f 6f  70 3d 30 20 b8 20 33 0d  |   . loop=0 . 3.|
00004ad0  1b 1c 31 20 20 20 20 20  20 e7 20 67 72 65 65 6e  |..1      . green|
00004ae0  28 6c 6f 6f 70 29 3d 67  72 65 65 6e 28 63 6f 75  |(loop)=green(cou|
00004af0  6e 74 65 72 29 20 8c 20  63 6f 75 6e 74 2b 3d 31  |nter) . count+=1|
00004b00  0d 1b 26 0e 20 20 20 20  ed 20 6c 6f 6f 70 0d 1b  |..&.    . loop..|
00004b10  30 04 0d 1b 3a 47 20 20  20 20 f2 43 68 61 6e 67  |0...:G    .Chang|
00004b20  65 49 63 6f 6e 28 6d 61  69 6e 25 2c 69 63 6f 6e  |eIcon(main%,icon|
00004b30  28 67 72 65 65 6e 2c 67  72 65 65 6e 28 63 6f 75  |(green,green(cou|
00004b40  6e 74 65 72 29 29 2c c3  28 63 6f 75 6e 74 29 2c  |nter)),.(count),|
00004b50  22 73 67 72 65 65 6e 22  29 0d 1b 44 07 20 20 cd  |"sgreen")..D.  .|
00004b60  0d 1b 4e 04 0d 1b 58 1c  20 20 e7 20 a4 41 6c 6c  |..N...X.  . .All|
00004b70  48 6f 6d 65 28 63 6f 6c  6f 75 72 29 3d b9 20 8c  |Home(colour)=. .|
00004b80  0d 1b 62 12 20 20 20 20  41 6c 6c 48 6f 6d 65 2b  |..b.    AllHome+|
00004b90  3d 31 0d 1b 6c 38 20 20  20 20 f2 43 68 61 6e 67  |=1..l8    .Chang|
00004ba0  65 49 63 6f 6e 28 72 65  73 75 6c 74 73 25 2c 41  |eIcon(results%,A|
00004bb0  6c 6c 48 6f 6d 65 2d 31  2c 6e 61 6d 65 24 28 63  |llHome-1,name$(c|
00004bc0  6f 6c 6f 75 72 29 2c 22  22 29 0d 1b 76 1d 20 20  |olour),"")..v.  |
00004bd0  20 20 f2 4f 70 65 6e 57  69 6e 64 6f 77 28 72 65  |  .OpenWindow(re|
00004be0  73 75 6c 74 73 25 29 0d  1b 80 07 20 20 cd 0d 1b  |sults%)....  ...|
00004bf0  8a 04 0d 1b 94 1c 20 20  e7 20 41 6c 6c 48 6f 6d  |......  . AllHom|
00004c00  65 3d 4e 75 6d 50 6c 61  79 65 72 73 20 8c 0d 1b  |e=NumPlayers ...|
00004c10  9e 1b 20 20 20 20 f2 43  6c 6f 73 65 57 69 6e 64  |..    .CloseWind|
00004c20  6f 77 28 64 69 63 65 25  29 0d 1b a8 07 20 20 cc  |ow(dice%)....  .|
00004c30  0d 1b b2 13 20 20 20 20  e7 20 64 69 63 65 3c 3e  |....    . dice<>|
00004c40  36 20 8c 0d 1b bc 0b 20  20 20 20 20 20 f5 0d 1b  |6 .....      ...|
00004c50  c6 13 20 20 20 20 20 20  20 20 74 75 72 6e 2b 3d  |..        turn+=|
00004c60  31 0d 1b d0 1f 20 20 20  20 20 20 20 20 e7 20 74  |1....        . t|
00004c70  75 72 6e 3d 34 20 8c 20  74 75 72 6e 3d 72 65 64  |urn=4 . turn=red|
00004c80  0d 1b da 32 20 20 20 20  20 20 fd 20 a4 41 6c 6c  |...2      . .All|
00004c90  48 6f 6d 65 28 74 75 72  6e 29 3d a3 20 80 20 50  |Home(turn)=. . P|
00004ca0  6c 61 79 65 72 54 79 70  65 28 74 75 72 6e 29 3c  |layerType(turn)<|
00004cb0  3e 30 0d 1b e4 09 20 20  20 20 cd 0d 1b ee 3c 20  |>0....    ....< |
00004cc0  20 20 20 f2 43 68 61 6e  67 65 49 63 6f 6e 28 64  |   .ChangeIcon(d|
00004cd0  69 63 65 25 2c 31 2c 6e  61 6d 65 24 28 74 75 72  |ice%,1,name$(tur|
00004ce0  6e 29 2b 22 2c 20 50 6c  65 61 73 65 20 63 6c 69  |n)+", Please cli|
00004cf0  63 6b 22 2c 22 22 29 0d  1b f8 36 20 20 20 20 f2  |ck","")...6    .|
00004d00  43 68 61 6e 67 65 49 63  6f 6e 28 64 69 63 65 25  |ChangeIcon(dice%|
00004d10  2c 32 2c 22 6f 6e 20 74  68 65 20 64 69 63 65 20  |,2,"on the dice |
00004d20  74 6f 20 72 6f 6c 6c 2e  22 2c 22 22 29 0d 1c 02  |to roll.","")...|
00004d30  0e 20 20 20 20 62 65 65  6e 3d b9 0d 1c 0c 07 20  |.    been=..... |
00004d40  20 cd 0d 1c 16 05 e1 0d  1c 20 05 3a 0d 1c 2a 10  | ........ .:..*.|
00004d50  dd f2 4d 65 6e 75 53 65  6c 65 63 74 0d 1c 34 04  |..MenuSelect..4.|
00004d60  0d 1c 3e 31 f4 20 43 68  65 63 6b 20 77 68 69 63  |..>1. Check whic|
00004d70  68 20 65 6e 74 72 79 20  73 65 6c 65 63 74 65 64  |h entry selected|
00004d80  20 69 6e 20 69 63 6f 6e  20 62 61 72 20 6d 65 6e  | in icon bar men|
00004d90  75 0d 1c 48 14 20 20 e7  20 6d 65 6e 66 6c 61 67  |u..H.  . menflag|
00004da0  25 3d 31 20 8c 0d 1c 52  15 20 20 20 20 c8 8e 20  |%=1 ...R.    .. |
00004db0  62 6c 6f 63 6b 25 21 30  20 ca 0d 1c 5c 18 20 20  |block%!0 ...\.  |
00004dc0  20 20 20 20 c9 20 31 20  3a 20 f2 4e 65 77 47 61  |    . 1 : .NewGa|
00004dd0  6d 65 0d 1c 66 28 20 20  20 20 20 20 20 20 20 20  |me..f(          |
00004de0  20 20 20 20 20 f2 4f 70  65 6e 57 69 6e 64 6f 77  |     .OpenWindow|
00004df0  28 70 6c 61 79 65 72 73  25 29 0d 1c 70 11 20 20  |(players%)..p.  |
00004e00  20 20 20 20 c9 20 32 20  3a 20 e0 0d 1c 7a 09 20  |    . 2 : ...z. |
00004e10  20 20 20 cb 0d 1c 84 07  20 20 cd 0d 1c 8e 05 3a  |   .....  .....:|
00004e20  0d 1c 98 27 f4 20 63 68  65 63 6b 20 77 68 69 63  |...'. check whic|
00004e30  68 20 69 74 65 6d 20 69  6e 20 6d 65 6e 75 20 73  |h item in menu s|
00004e40  65 6c 65 63 74 65 64 0d  1c a2 04 0d 1c ac 12 20  |elected........ |
00004e50  20 e7 20 6d 65 6e 66 6c  61 67 25 3d 32 0d 1c b6  | . menflag%=2...|
00004e60  15 20 20 20 20 c8 8e 20  62 6c 6f 63 6b 25 21 30  |.    .. block%!0|
00004e70  20 ca 0d 1c c0 18 20 20  20 20 20 20 c9 20 31 20  | .....      . 1 |
00004e80  3a 20 f2 4e 65 77 47 61  6d 65 0d 1c ca 28 20 20  |: .NewGame...(  |
00004e90  20 20 20 20 20 20 20 20  20 20 20 20 20 f2 4f 70  |             .Op|
00004ea0  65 6e 57 69 6e 64 6f 77  28 70 6c 61 79 65 72 73  |enWindow(players|
00004eb0  25 29 0d 1c d4 09 20 20  20 20 cb 0d 1c de 07 20  |%)....    ..... |
00004ec0  20 cd 0d 1c e8 05 3a 0d  1c f2 26 20 20 c8 99 20  | .....:...&  .. |
00004ed0  22 57 69 6d 70 5f 47 65  74 50 6f 69 6e 74 65 72  |"Wimp_GetPointer|
00004ee0  49 6e 66 6f 22 2c 2c 62  6c 6f 63 6b 25 0d 1c fc  |Info",,block%...|
00004ef0  14 20 20 e7 20 62 6c 6f  63 6b 25 21 38 3d 31 20  |.  . block%!8=1 |
00004f00  8c 0d 1d 06 15 20 20 20  20 c8 8e 20 6d 65 6e 66  |.....    .. menf|
00004f10  6c 61 67 25 20 ca 0d 1d  10 2f 20 20 20 20 20 20  |lag% ..../      |
00004f20  c9 20 31 20 3a 20 c8 99  20 22 57 69 6d 70 5f 43  |. 1 : .. "Wimp_C|
00004f30  72 65 61 74 65 4d 65 6e  75 22 2c 2c 49 63 6f 6e  |reateMenu",,Icon|
00004f40  4d 65 6e 75 25 0d 1d 1a  2f 20 20 20 20 20 20 c9  |Menu%.../      .|
00004f50  20 32 20 3a 20 c8 99 20  22 57 69 6d 70 5f 43 72  | 2 : .. "Wimp_Cr|
00004f60  65 61 74 65 4d 65 6e 75  22 2c 2c 4d 61 69 6e 4d  |eateMenu",,MainM|
00004f70  65 6e 75 25 0d 1d 24 09  20 20 20 20 cb 0d 1d 2e  |enu%..$.    ....|
00004f80  07 20 20 cc 0d 1d 38 20  20 20 20 20 c8 99 20 22  |.  ...8     .. "|
00004f90  57 69 6d 70 5f 43 72 65  61 74 65 4d 65 6e 75 22  |Wimp_CreateMenu"|
00004fa0  2c 2c 2d 31 0d 1d 42 12  20 20 20 20 6d 65 6e 66  |,,-1..B.    menf|
00004fb0  6c 61 67 25 3d 30 0d 1d  4c 07 20 20 cd 0d 1d 56  |lag%=0..L.  ...V|
00004fc0  05 e1 0d 1d 60 05 3a 0d  1d 6a 2a dd f2 43 68 61  |....`.:..j*..Cha|
00004fd0  6e 67 65 49 63 6f 6e 28  77 68 61 6e 25 2c 69 68  |ngeIcon(whan%,ih|
00004fe0  61 6e 25 2c 74 65 78 74  24 2c 69 6e 64 69 72 24  |an%,text$,indir$|
00004ff0  29 0d 1d 74 1b f4 20 63  68 61 6e 67 65 20 73 70  |)..t.. change sp|
00005000  72 69 74 65 20 6f 66 20  69 63 6f 6e 0d 1d 7e 04  |rite of icon..~.|
00005010  0d 1d 88 23 20 20 62 6c  6f 63 6b 25 21 30 3d 77  |...#  block%!0=w|
00005020  68 61 6e 25 3a 62 6c 6f  63 6b 25 21 34 3d 69 68  |han%:block%!4=ih|
00005030  61 6e 25 0d 1d 92 24 20  20 c8 99 20 22 57 69 6d  |an%...$  .. "Wim|
00005040  70 5f 47 65 74 49 63 6f  6e 53 74 61 74 65 22 2c  |p_GetIconState",|
00005050  2c 62 6c 6f 63 6b 25 0d  1d 9c 1c 20 20 62 6c 6f  |,block%....  blo|
00005060  63 6b 25 21 38 3d 30 3a  62 6c 6f 63 6b 25 21 31  |ck%!8=0:block%!1|
00005070  32 3d 30 0d 1d a6 1e 20  20 24 28 62 6c 6f 63 6b  |2=0....  $(block|
00005080  25 21 32 38 29 3d 74 65  78 74 24 2b bd 28 31 33  |%!28)=text$+.(13|
00005090  29 0d 1d b0 1f 20 20 24  28 62 6c 6f 63 6b 25 21  |)....  $(block%!|
000050a0  33 32 29 3d 69 6e 64 69  72 24 2b bd 28 31 33 29  |32)=indir$+.(13)|
000050b0  0d 1d ba 24 20 20 c8 99  20 22 57 69 6d 70 5f 53  |...$  .. "Wimp_S|
000050c0  65 74 49 63 6f 6e 53 74  61 74 65 22 2c 2c 62 6c  |etIconState",,bl|
000050d0  6f 63 6b 25 0d 1d c4 05  e1 0d 1d ce 05 3a 0d 1d  |ock%.........:..|
000050e0  d8 18 dd 20 a4 74 65 78  74 28 77 68 61 6e 25 2c  |... .text(whan%,|
000050f0  69 68 61 6e 25 29 0d 1d  e2 23 20 20 62 6c 6f 63  |ihan%)...#  bloc|
00005100  6b 25 21 30 3d 77 68 61  6e 25 3a 62 6c 6f 63 6b  |k%!0=whan%:block|
00005110  25 21 34 3d 69 68 61 6e  25 0d 1d ec 24 20 20 c8  |%!4=ihan%...$  .|
00005120  99 20 22 57 69 6d 70 5f  47 65 74 49 63 6f 6e 53  |. "Wimp_GetIconS|
00005130  74 61 74 65 22 2c 2c 62  6c 6f 63 6b 25 0d 1d f6  |tate",,block%...|
00005140  11 3d 24 28 62 6c 6f 63  6b 25 21 32 38 29 0d 1e  |.=$(block%!28)..|
00005150  00 05 3a 0d 1e 0a 0e dd  20 f2 4d 65 73 73 61 67  |..:..... .Messag|
00005160  65 0d 1e 14 26 20 20 20  20 73 6f 75 72 63 65 25  |e...&    source%|
00005170  3d 62 6c 6f 63 6b 25 21  34 3a 72 65 66 25 3d 62  |=block%!4:ref%=b|
00005180  6c 6f 63 6b 25 21 38 0d  1e 1e 16 20 20 20 20 c8  |lock%!8....    .|
00005190  8e 20 62 6c 6f 63 6b 25  21 31 36 20 ca 0d 1e 28  |. block%!16 ...(|
000051a0  15 20 20 20 20 c9 20 30  20 3a 20 71 75 69 74 25  |.    . 0 : quit%|
000051b0  3d b9 0d 1e 32 2a 20 20  20 20 c9 20 32 20 3a 20  |=...2*    . 2 : |
000051c0  f2 53 61 76 65 46 69 6c  65 28 a4 67 6e 61 6d 65  |.SaveFile(.gname|
000051d0  28 62 6c 6f 63 6b 25 2b  34 34 29 29 0d 1e 3c 17  |(block%+44))..<.|
000051e0  20 20 20 20 c9 20 33 20  3a 20 f2 4c 6f 61 64 46  |    . 3 : .LoadF|
000051f0  69 6c 65 0d 1e 46 18 20  20 20 20 c9 20 35 20 3a  |ile..F.    . 5 :|
00005200  20 f2 43 6c 69 63 6b 4c  6f 61 64 0d 1e 50 07 20  | .ClickLoad..P. |
00005210  20 cb 0d 1e 5a 05 e1 0d  1e 64 05 3a 0d 1e 6e 1b  | ...Z....d.:..n.|
00005220  dd 20 f2 72 65 70 6c 79  28 74 79 70 65 25 2c 72  |. .reply(type%,r|
00005230  65 61 73 6f 6e 25 29 0d  1e 78 12 20 20 62 6c 6f  |eason%)..x.  blo|
00005240  63 6b 25 21 30 3d 32 35  36 0d 1e 82 14 20 20 62  |ck%!0=256....  b|
00005250  6c 6f 63 6b 25 21 31 32  3d 72 65 66 25 0d 1e 8c  |lock%!12=ref%...|
00005260  17 20 20 62 6c 6f 63 6b  25 21 31 36 3d 72 65 61  |.  block%!16=rea|
00005270  73 6f 6e 25 0d 1e 96 2f  20 20 c8 99 22 57 69 6d  |son%.../  .."Wim|
00005280  70 5f 53 65 6e 64 4d 65  73 73 61 67 65 22 2c 74  |p_SendMessage",t|
00005290  79 70 65 25 2c 62 6c 6f  63 6b 25 2c 73 6f 75 72  |ype%,block%,sour|
000052a0  63 65 25 0d 1e a0 05 e1  0d 1e aa 05 3a 0d 1e b4  |ce%.........:...|
000052b0  19 dd a4 67 6e 61 6d 65  28 61 25 29 3a ea 66 24  |...gname(a%):.f$|
000052c0  3a 66 24 3d 22 22 0d 1e  be 10 20 20 c8 95 20 3f  |:f$=""....  .. ?|
000052d0  61 25 3e 3d 33 32 0d 1e  c8 16 20 20 20 20 66 24  |a%>=32....    f$|
000052e0  2b 3d bd 3f 61 25 3a 61  25 2b 3d 31 0d 1e d2 07  |+=.?a%:a%+=1....|
000052f0  20 20 ce 0d 1e dc 07 3d  66 24 0d 1e e6 05 3a 0d  |  .....=f$....:.|
00005300  1e f0 0b dd 20 f2 73 61  76 65 0d 1e fa 14 20 20  |.... .save....  |
00005310  c8 8e 20 62 6c 6f 63 6b  25 21 31 36 20 ca 0d 1f  |.. block%!16 ...|
00005320  04 28 20 20 20 20 c9 20  31 20 3a 20 f2 43 72 65  |.(    . 1 : .Cre|
00005330  61 74 65 44 72 61 67 42  6f 78 28 73 61 76 65 62  |ateDragBox(saveb|
00005340  6f 78 25 2c 31 29 0d 1f  0e 18 20 20 20 20 c9 20  |ox%,1)....    . |
00005350  33 20 3a 20 f2 51 75 69  63 6b 53 61 76 65 0d 1f  |3 : .QuickSave..|
00005360  18 07 20 20 cb 0d 1f 22  05 e1 0d 1f 2c 05 3a 0d  |..  ..."....,.:.|
00005370  1f 36 0f dd f2 51 75 69  63 6b 53 61 76 65 0d 1f  |.6...QuickSave..|
00005380  40 1e 20 20 66 6e 61 6d  65 24 3d a4 74 65 78 74  |@.  fname$=.text|
00005390  28 73 61 76 65 62 6f 78  25 2c 32 29 0d 1f 4a 16  |(savebox%,2)..J.|
000053a0  20 20 e7 20 a7 66 6e 61  6d 65 24 2c 22 2e 22 29  |  . .fname$,".")|
000053b0  20 8c 0d 1f 54 19 20 20  20 20 f2 53 61 76 65 46  | ...T.    .SaveF|
000053c0  69 6c 65 28 66 6e 61 6d  65 24 29 0d 1f 5e 07 20  |ile(fname$)..^. |
000053d0  20 cc 0d 1f 68 84 20 20  20 20 f2 45 72 72 6f 72  | ...h.    .Error|
000053e0  28 22 54 6f 20 73 61 76  65 20 74 68 65 20 67 61  |("To save the ga|
000053f0  6d 65 20 65 69 74 68 65  72 20 64 72 61 67 20 74  |me either drag t|
00005400  68 65 20 66 69 6c 65 20  69 63 6f 6e 20 74 6f 20  |he file icon to |
00005410  61 20 64 69 72 65 63 74  6f 72 79 20 76 69 65 77  |a directory view|
00005420  65 72 2c 20 6f 72 20 65  6e 74 65 72 20 61 20 66  |er, or enter a f|
00005430  69 6c 65 20 6e 61 6d 65  20 28 69 6e 63 6c 75 64  |ile name (includ|
00005440  69 6e 67 20 66 75 6c 6c  20 70 61 74 68 20 6e 61  |ing full path na|
00005450  6d 65 29 2e 22 29 0d 1f  72 07 20 20 cd 0d 1f 7c  |me).")..r.  ...||
00005460  05 e1 0d 1f 86 05 3a 0d  1f 90 22 dd f2 43 72 65  |......:..."..Cre|
00005470  61 74 65 44 72 61 67 42  6f 78 28 77 69 6e 64 6f  |ateDragBox(windo|
00005480  77 25 2c 69 63 6f 6e 25  29 0d 1f 9a 18 20 20 20  |w%,icon%)....   |
00005490  20 62 6c 6f 63 6b 25 21  30 3d 77 69 6e 64 6f 77  | block%!0=window|
000054a0  25 0d 1f a4 27 20 20 20  20 c8 99 22 57 69 6d 70  |%...'    .."Wimp|
000054b0  5f 47 65 74 57 69 6e 64  6f 77 53 74 61 74 65 22  |_GetWindowState"|
000054c0  2c 2c 62 6c 6f 63 6b 25  0d 1f ae 1d 20 20 20 20  |,,block%....    |
000054d0  6f 78 3d 62 6c 6f 63 6b  25 21 34 2d 62 6c 6f 63  |ox=block%!4-bloc|
000054e0  6b 25 21 32 30 0d 1f b8  1e 20 20 20 20 6f 79 3d  |k%!20....    oy=|
000054f0  62 6c 6f 63 6b 25 21 31  36 2d 62 6c 6f 63 6b 25  |block%!16-block%|
00005500  21 32 34 0d 1f c2 16 20  20 20 20 62 6c 6f 63 6b  |!24....    block|
00005510  25 21 34 3d 69 63 6f 6e  25 0d 1f cc 25 20 20 20  |%!4=icon%...%   |
00005520  20 c8 99 22 57 69 6d 70  5f 47 65 74 49 63 6f 6e  | .."Wimp_GetIcon|
00005530  53 74 61 74 65 22 2c 2c  62 6c 6f 63 6b 25 0d 1f  |State",,block%..|
00005540  d6 17 20 20 20 20 21 62  6c 6f 63 6b 25 3d 77 69  |..    !block%=wi|
00005550  6e 64 6f 77 25 0d 1f e0  12 20 20 20 20 62 6c 6f  |ndow%....    blo|
00005560  63 6b 25 21 34 3d 35 0d  1f ea 14 20 20 20 20 62  |ck%!4=5....    b|
00005570  6c 6f 63 6b 25 21 38 2b  3d 6f 78 0d 1f f4 15 20  |lock%!8+=ox.... |
00005580  20 20 20 62 6c 6f 63 6b  25 21 31 32 2b 3d 6f 79  |   block%!12+=oy|
00005590  0d 1f fe 15 20 20 20 20  62 6c 6f 63 6b 25 21 31  |....    block%!1|
000055a0  36 2b 3d 6f 78 0d 20 08  15 20 20 20 20 62 6c 6f  |6+=ox. ..    blo|
000055b0  63 6b 25 21 32 30 2b 3d  6f 79 0d 20 12 13 20 20  |ck%!20+=oy. ..  |
000055c0  20 20 62 6c 6f 63 6b 25  21 32 34 3d 30 0d 20 1c  |  block%!24=0. .|
000055d0  13 20 20 20 20 62 6c 6f  63 6b 25 21 32 38 3d 30  |.    block%!28=0|
000055e0  0d 20 26 1b 20 20 20 20  62 6c 6f 63 6b 25 21 33  |. &.    block%!3|
000055f0  32 3d 26 37 46 46 46 46  46 46 46 0d 20 30 1b 20  |2=&7FFFFFFF. 0. |
00005600  20 20 20 62 6c 6f 63 6b  25 21 33 36 3d 26 37 46  |   block%!36=&7F|
00005610  46 46 46 46 46 46 0d 20  3a 20 20 20 20 20 c8 99  |FFFFFF. :     ..|
00005620  22 57 69 6d 70 5f 44 72  61 67 42 6f 78 22 2c 2c  |"Wimp_DragBox",,|
00005630  62 6c 6f 63 6b 25 0d 20  44 04 0d 20 4e 13 20 20  |block%. D.. N.  |
00005640  20 20 e7 20 64 72 61 67  25 3d b9 20 8c 0d 20 58  |  . drag%=. .. X|
00005650  3b 20 20 20 20 20 20 c8  99 22 44 72 61 67 41 53  |;      .."DragAS|
00005660  70 72 69 74 65 5f 53 74  61 72 74 22 2c 26 43 41  |prite_Start",&CA|
00005670  2c 31 2c 22 66 69 6c 65  5f 37 37 37 22 2c 62 6c  |,1,"file_777",bl|
00005680  6f 63 6b 25 2b 38 2c 30  0d 20 62 09 20 20 20 20  |ock%+8,0. b.    |
00005690  cd 0d 20 6c 07 20 20 cd  0d 20 76 05 e1 0d 20 80  |.. l.  .. v... .|
000056a0  05 3a 0d 20 8a 16 dd f2  44 72 61 67 53 61 76 65  |.:. ....DragSave|
000056b0  28 66 6e 61 6d 65 24 29  0d 20 94 25 20 20 c8 99  |(fname$). .%  ..|
000056c0  22 57 69 6d 70 5f 47 65  74 50 6f 69 6e 74 65 72  |"Wimp_GetPointer|
000056d0  49 6e 66 6f 22 2c 2c 62  6c 6f 63 6b 25 0d 20 9e  |Info",,block%. .|
000056e0  1e 20 20 e7 20 62 6c 6f  63 6b 25 21 31 32 3d 73  |.  . block%!12=s|
000056f0  61 76 65 62 6f 78 25 20  8c 20 e1 0d 20 a8 25 20  |avebox% . .. .% |
00005700  20 62 6c 6f 63 6b 25 21  32 30 3d 62 6c 6f 63 6b  | block%!20=block|
00005710  25 21 31 32 3a 62 6c 6f  63 6b 25 21 31 32 3d 30  |%!12:block%!12=0|
00005720  0d 20 b2 25 20 20 62 6c  6f 63 6b 25 21 32 34 3d  |. .%  block%!24=|
00005730  62 6c 6f 63 6b 25 21 31  36 3a 62 6c 6f 63 6b 25  |block%!16:block%|
00005740  21 31 36 3d 31 0d 20 bc  24 20 20 62 6c 6f 63 6b  |!16=1. .$  block|
00005750  25 21 32 38 3d 62 6c 6f  63 6b 25 21 30 3a 62 6c  |%!28=block%!0:bl|
00005760  6f 63 6b 25 21 30 3d 36  34 0d 20 c6 24 20 20 62  |ock%!0=64. .$  b|
00005770  6c 6f 63 6b 25 21 33 32  3d 62 6c 6f 63 6b 25 21  |lock%!32=block%!|
00005780  34 3a 62 6c 6f 63 6b 25  21 33 36 3d 30 0d 20 d0  |4:block%!36=0. .|
00005790  32 20 20 62 6c 6f 63 6b  25 21 34 30 3d 26 37 37  |2  block%!40=&77|
000057a0  37 3a 24 28 62 6c 6f 63  6b 25 2b 34 34 29 3d a4  |7:$(block%+44)=.|
000057b0  6c 65 61 66 28 66 6e 61  6d 65 24 29 2b bd 30 0d  |leaf(fname$)+.0.|
000057c0  20 da 38 20 20 c8 99 22  57 69 6d 70 5f 53 65 6e  | .8  .."Wimp_Sen|
000057d0  64 4d 65 73 73 61 67 65  22 2c 31 37 2c 62 6c 6f  |dMessage",17,blo|
000057e0  63 6b 25 2c 62 6c 6f 63  6b 25 21 32 30 2c 62 6c  |ck%,block%!20,bl|
000057f0  6f 63 6b 25 21 32 34 0d  20 e4 05 e1 0d 20 ee 05  |ock%!24. .... ..|
00005800  3a 0d 20 f8 11 dd a4 6c  65 61 66 28 70 61 74 68  |:. ....leaf(path|
00005810  24 29 0d 21 02 14 20 20  c8 95 20 a7 70 61 74 68  |$).!..  .. .path|
00005820  24 2c 22 2e 22 29 0d 21  0c 23 20 20 20 20 70 61  |$,".").!.#    pa|
00005830  74 68 24 3d c1 70 61 74  68 24 2c a7 70 61 74 68  |th$=.path$,.path|
00005840  24 2c 22 2e 22 29 2b 31  29 0d 21 16 07 20 20 ce  |$,".")+1).!..  .|
00005850  0d 21 20 0a 3d 70 61 74  68 24 0d 21 2a 05 3a 0d  |.! .=path$.!*.:.|
00005860  21 34 16 dd f2 53 61 76  65 46 69 6c 65 28 66 6e  |!4...SaveFile(fn|
00005870  61 6d 65 24 29 0d 21 3e  92 20 20 ea 20 85 20 3a  |ame$).!>.  . . :|
00005880  20 ee 20 85 20 ea 20 3a  20 f2 45 72 72 6f 72 28  | . . . : .Error(|
00005890  22 54 6f 20 73 61 76 65  20 74 68 65 20 67 61 6d  |"To save the gam|
000058a0  65 20 65 69 74 68 65 72  20 64 72 61 67 20 74 68  |e either drag th|
000058b0  65 20 66 69 6c 65 20 69  63 6f 6e 20 74 6f 20 61  |e file icon to a|
000058c0  20 64 69 72 65 63 74 6f  72 79 20 76 69 65 77 65  | directory viewe|
000058d0  72 2c 20 6f 72 20 65 6e  74 65 72 20 61 20 66 69  |r, or enter a fi|
000058e0  6c 65 20 6e 61 6d 65 20  28 69 6e 63 6c 75 64 69  |le name (includi|
000058f0  6e 67 20 66 75 6c 6c 20  70 61 74 68 20 6e 61 6d  |ng full path nam|
00005900  65 29 2e 22 29 3a e1 0d  21 48 15 20 20 66 69 6c  |e)."):..!H.  fil|
00005910  65 25 3d ae 28 66 6e 61  6d 65 24 29 0d 21 52 1a  |e%=.(fname$).!R.|
00005920  20 20 20 20 f1 23 66 69  6c 65 25 2c 4e 75 6d 50  |    .#file%,NumP|
00005930  6c 61 79 65 72 73 0d 21  5c 17 20 20 20 20 f1 23  |layers.!\.    .#|
00005940  66 69 6c 65 25 2c 41 6c  6c 48 6f 6d 65 0d 21 66  |file%,AllHome.!f|
00005950  14 20 20 20 20 f1 23 66  69 6c 65 25 2c 64 69 63  |.    .#file%,dic|
00005960  65 0d 21 70 14 20 20 20  20 f1 23 66 69 6c 65 25  |e.!p.    .#file%|
00005970  2c 74 75 72 6e 0d 21 7a  14 20 20 20 20 f1 23 66  |,turn.!z.    .#f|
00005980  69 6c 65 25 2c 62 65 65  6e 0d 21 84 04 0d 21 8e  |ile%,been.!...!.|
00005990  16 20 20 20 20 e3 20 63  6f 6c 6f 75 72 3d 30 20  |.    . colour=0 |
000059a0  b8 20 33 0d 21 98 24 20  20 20 20 20 20 f1 23 66  |. 3.!.$      .#f|
000059b0  69 6c 65 25 2c 50 6c 61  79 65 72 54 79 70 65 28  |ile%,PlayerType(|
000059c0  63 6f 6c 6f 75 72 29 0d  21 a2 1f 20 20 20 20 20  |colour).!..     |
000059d0  20 f1 23 66 69 6c 65 25  2c 6e 61 6d 65 24 28 63  | .#file%,name$(c|
000059e0  6f 6c 6f 75 72 29 0d 21  ac 10 20 20 20 20 ed 20  |olour).!..    . |
000059f0  63 6f 6c 6f 75 72 0d 21  b6 04 0d 21 c0 17 20 20  |colour.!...!..  |
00005a00  20 20 e3 20 63 6f 75 6e  74 65 72 3d 30 20 b8 20  |  . counter=0 . |
00005a10  33 0d 21 ca 1e 20 20 20  20 20 20 f1 23 66 69 6c  |3.!..      .#fil|
00005a20  65 25 2c 72 65 64 28 63  6f 75 6e 74 65 72 29 0d  |e%,red(counter).|
00005a30  21 d4 1f 20 20 20 20 20  20 f1 23 66 69 6c 65 25  |!..      .#file%|
00005a40  2c 62 6c 75 65 28 63 6f  75 6e 74 65 72 29 0d 21  |,blue(counter).!|
00005a50  de 21 20 20 20 20 20 20  f1 23 66 69 6c 65 25 2c  |.!      .#file%,|
00005a60  79 65 6c 6c 6f 77 28 63  6f 75 6e 74 65 72 29 0d  |yellow(counter).|
00005a70  21 e8 20 20 20 20 20 20  20 f1 23 66 69 6c 65 25  |!.       .#file%|
00005a80  2c 67 72 65 65 6e 28 63  6f 75 6e 74 65 72 29 0d  |,green(counter).|
00005a90  21 f2 11 20 20 20 20 ed  20 63 6f 75 6e 74 65 72  |!..    . counter|
00005aa0  0d 21 fc 0d 20 20 d9 23  66 69 6c 65 25 0d 22 06  |.!..  .#file%.".|
00005ab0  20 20 20 c8 99 22 4f 53  5f 46 69 6c 65 22 2c 31  |   .."OS_File",1|
00005ac0  38 2c 66 6e 61 6d 65 24  2c 26 37 37 37 0d 22 10  |8,fname$,&777.".|
00005ad0  1d 20 20 c8 99 22 57 69  6d 70 5f 43 72 65 61 74  |.  .."Wimp_Creat|
00005ae0  65 4d 65 6e 75 22 2c 2c  2d 31 0d 22 1a 1c 20 20  |eMenu",,-1."..  |
00005af0  f2 43 6c 6f 73 65 57 69  6e 64 6f 77 28 73 61 76  |.CloseWindow(sav|
00005b00  65 62 6f 78 25 29 0d 22  24 12 20 20 f2 72 65 70  |ebox%)."$.  .rep|
00005b10  6c 79 28 31 37 2c 33 29  0d 22 2e 27 20 20 f2 43  |ly(17,3).".'  .C|
00005b20  68 61 6e 67 65 49 63 6f  6e 28 73 61 76 65 62 6f  |hangeIcon(savebo|
00005b30  78 25 2c 32 2c 66 6e 61  6d 65 24 2c 22 22 29 0d  |x%,2,fname$,"").|
00005b40  22 38 05 e1 0d 22 42 05  3a 0d 22 4c 0f dd f2 43  |"8..."B.:."L...C|
00005b50  6c 69 63 6b 4c 6f 61 64  0d 22 56 18 20 20 e7 20  |lickLoad."V.  . |
00005b60  62 6c 6f 63 6b 25 21 34  30 3d 26 37 37 37 20 8c  |block%!40=&777 .|
00005b70  0d 22 60 14 20 20 20 20  f2 72 65 70 6c 79 28 31  |."`.    .reply(1|
00005b80  37 2c 34 29 0d 22 6a 11  20 20 20 20 f2 4c 6f 61  |7,4)."j.    .Loa|
00005b90  64 46 69 6c 65 0d 22 74  07 20 20 cd 0d 22 7e 05  |dFile."t.  .."~.|
00005ba0  e1 0d 22 88 05 3a 0d 22  92 0e dd f2 4c 6f 61 64  |.."..:."....Load|
00005bb0  46 69 6c 65 0d 22 9c 18  20 20 e7 20 62 6c 6f 63  |File."..  . bloc|
00005bc0  6b 25 21 34 30 3d 26 37  37 37 20 8c 0d 22 a6 20  |k%!40=&777 ..". |
00005bd0  20 20 20 20 66 6e 61 6d  65 24 3d a4 67 6e 61 6d  |    fname$=.gnam|
00005be0  65 28 62 6c 6f 63 6b 25  2b 34 34 29 0d 22 b0 29  |e(block%+44).".)|
00005bf0  20 20 20 20 f2 43 68 61  6e 67 65 49 63 6f 6e 28  |    .ChangeIcon(|
00005c00  73 61 76 65 62 6f 78 25  2c 32 2c 66 6e 61 6d 65  |savebox%,2,fname|
00005c10  24 2c 22 22 29 0d 22 ba  13 20 20 20 20 f2 43 6c  |$,"")."..    .Cl|
00005c20  65 61 72 42 6f 61 72 64  0d 22 c4 17 20 20 20 20  |earBoard."..    |
00005c30  66 69 6c 65 25 3d 8e 28  66 6e 61 6d 65 24 29 0d  |file%=.(fname$).|
00005c40  22 ce 04 0d 22 d8 1c 20  20 20 20 20 20 e8 23 66  |"..."..      .#f|
00005c50  69 6c 65 25 2c 4e 75 6d  50 6c 61 79 65 72 73 0d  |ile%,NumPlayers.|
00005c60  22 e2 19 20 20 20 20 20  20 e8 23 66 69 6c 65 25  |"..      .#file%|
00005c70  2c 41 6c 6c 48 6f 6d 65  0d 22 ec 16 20 20 20 20  |,AllHome."..    |
00005c80  20 20 e8 23 66 69 6c 65  25 2c 64 69 63 65 0d 22  |  .#file%,dice."|
00005c90  f6 16 20 20 20 20 20 20  e8 23 66 69 6c 65 25 2c  |..      .#file%,|
00005ca0  74 75 72 6e 0d 23 00 16  20 20 20 20 20 20 e8 23  |turn.#..      .#|
00005cb0  66 69 6c 65 25 2c 62 65  65 6e 0d 23 0a 04 0d 23  |file%,been.#...#|
00005cc0  14 18 20 20 20 20 20 20  e3 20 63 6f 6c 6f 75 72  |..      . colour|
00005cd0  3d 30 20 b8 20 33 0d 23  1e 26 20 20 20 20 20 20  |=0 . 3.#.&      |
00005ce0  20 20 e8 23 66 69 6c 65  25 2c 50 6c 61 79 65 72  |  .#file%,Player|
00005cf0  54 79 70 65 28 63 6f 6c  6f 75 72 29 0d 23 28 21  |Type(colour).#(!|
00005d00  20 20 20 20 20 20 20 20  e8 23 66 69 6c 65 25 2c  |        .#file%,|
00005d10  6e 61 6d 65 24 28 63 6f  6c 6f 75 72 29 0d 23 32  |name$(colour).#2|
00005d20  12 20 20 20 20 20 20 ed  20 63 6f 6c 6f 75 72 0d  |.      . colour.|
00005d30  23 3c 04 0d 23 46 19 20  20 20 20 20 20 e3 20 63  |#<..#F.      . c|
00005d40  6f 75 6e 74 65 72 3d 30  20 b8 20 33 0d 23 50 20  |ounter=0 . 3.#P |
00005d50  20 20 20 20 20 20 20 20  e8 23 66 69 6c 65 25 2c  |        .#file%,|
00005d60  72 65 64 28 63 6f 75 6e  74 65 72 29 0d 23 5a 21  |red(counter).#Z!|
00005d70  20 20 20 20 20 20 20 20  e8 23 66 69 6c 65 25 2c  |        .#file%,|
00005d80  62 6c 75 65 28 63 6f 75  6e 74 65 72 29 0d 23 64  |blue(counter).#d|
00005d90  23 20 20 20 20 20 20 20  20 e8 23 66 69 6c 65 25  |#        .#file%|
00005da0  2c 79 65 6c 6c 6f 77 28  63 6f 75 6e 74 65 72 29  |,yellow(counter)|
00005db0  0d 23 6e 22 20 20 20 20  20 20 20 20 e8 23 66 69  |.#n"        .#fi|
00005dc0  6c 65 25 2c 67 72 65 65  6e 28 63 6f 75 6e 74 65  |le%,green(counte|
00005dd0  72 29 0d 23 78 13 20 20  20 20 20 20 ed 20 63 6f  |r).#x.      . co|
00005de0  75 6e 74 65 72 0d 23 82  0f 20 20 20 20 d9 23 66  |unter.#..    .#f|
00005df0  69 6c 65 25 0d 23 8c 11  20 20 20 20 73 74 61 72  |ile%.#..    star|
00005e00  74 65 64 3d b9 0d 23 96  12 20 20 20 20 f2 49 6e  |ted=..#..    .In|
00005e10  69 74 42 6f 61 72 64 0d  23 a0 1a 20 20 20 20 f2  |itBoard.#..    .|
00005e20  4f 70 65 6e 57 69 6e 64  6f 77 28 6d 61 69 6e 25  |OpenWindow(main%|
00005e30  29 0d 23 aa 31 20 20 20  20 e7 20 41 6c 6c 48 6f  |).#.1    . AllHo|
00005e40  6d 65 3c 4e 75 6d 50 6c  61 79 65 72 73 20 8c 20  |me<NumPlayers . |
00005e50  f2 4f 70 65 6e 57 69 6e  64 6f 77 28 64 69 63 65  |.OpenWindow(dice|
00005e60  25 29 0d 23 b4 2b 20 20  20 20 e7 20 41 6c 6c 48  |%).#.+    . AllH|
00005e70  6f 6d 65 3e 30 20 8c 20  f2 4f 70 65 6e 57 69 6e  |ome>0 . .OpenWin|
00005e80  64 6f 77 28 72 65 73 75  6c 74 73 25 29 0d 23 be  |dow(results%).#.|
00005e90  07 20 20 cd 0d 23 c8 05  e1 0d 23 d2 05 3a 0d 23  |.  ..#....#..:.#|
00005ea0  dc 1a dd f2 4f 70 65 6e  57 69 6e 64 6f 77 28 62  |....OpenWindow(b|
00005eb0  6c 6f 63 6b 25 21 30 29  0d 23 e6 26 20 20 c8 99  |lock%!0).#.&  ..|
00005ec0  20 22 57 69 6d 70 5f 47  65 74 57 69 6e 64 6f 77  | "Wimp_GetWindow|
00005ed0  53 74 61 74 65 22 2c 2c  62 6c 6f 63 6b 25 0d 23  |State",,block%.#|
00005ee0  f0 22 20 20 c8 99 20 22  57 69 6d 70 5f 4f 70 65  |."  .. "Wimp_Ope|
00005ef0  6e 57 69 6e 64 6f 77 22  2c 2c 62 6c 6f 63 6b 25  |nWindow",,block%|
00005f00  0d 23 fa 05 e1 0d 24 04  05 3a 0d 24 0e 1b dd f2  |.#....$..:.$....|
00005f10  43 6c 6f 73 65 57 69 6e  64 6f 77 28 62 6c 6f 63  |CloseWindow(bloc|
00005f20  6b 25 21 30 29 0d 24 18  26 20 20 c8 99 20 22 57  |k%!0).$.&  .. "W|
00005f30  69 6d 70 5f 47 65 74 57  69 6e 64 6f 77 53 74 61  |imp_GetWindowSta|
00005f40  74 65 22 2c 2c 62 6c 6f  63 6b 25 0d 24 22 23 20  |te",,block%.$"# |
00005f50  20 c8 99 20 22 57 69 6d  70 5f 43 6c 6f 73 65 57  | .. "Wimp_CloseW|
00005f60  69 6e 64 6f 77 22 2c 2c  62 6c 6f 63 6b 25 0d 24  |indow",,block%.$|
00005f70  2c 05 e1 0d 24 36 05 3a  0d 24 40 0c dd f2 52 65  |,...$6.:.$@...Re|
00005f80  64 72 61 77 0d 24 4a 2c  20 20 c8 99 20 22 57 69  |draw.$J,  .. "Wi|
00005f90  6d 70 5f 52 65 64 72 61  77 57 69 6e 64 6f 77 22  |mp_RedrawWindow"|
00005fa0  2c 2c 62 6c 6f 63 6b 25  20 b8 20 6d 6f 72 65 25  |,,block% . more%|
00005fb0  0d 24 54 34 20 20 78 6f  25 3d 62 6c 6f 63 6b 25  |.$T4  xo%=block%|
00005fc0  21 34 2d 62 6c 6f 63 6b  25 21 32 30 3a 79 6f 25  |!4-block%!20:yo%|
00005fd0  3d 62 6c 6f 63 6b 25 21  31 36 2d 62 6c 6f 63 6b  |=block%!16-block|
00005fe0  25 21 32 34 0d 24 5e 04  0d 24 68 0e 20 20 c8 95  |%!24.$^..$h.  ..|
00005ff0  20 6d 6f 72 65 25 0d 24  72 2b 20 20 20 20 f4 20  | more%.$r+    . |
00006000  70 75 74 20 75 73 65 72  20 72 65 64 72 61 77 20  |put user redraw |
00006010  63 6f 64 65 20 69 6e 20  74 68 69 73 20 6c 6f 6f  |code in this loo|
00006020  70 0d 24 7c 04 0d 24 86  2e 20 20 20 20 c8 99 20  |p.$|..$..    .. |
00006030  22 57 69 6d 70 5f 47 65  74 52 65 63 74 61 6e 67  |"Wimp_GetRectang|
00006040  6c 65 22 2c 2c 62 6c 6f  63 6b 25 20 b8 20 6d 6f  |le",,block% . mo|
00006050  72 65 25 0d 24 90 07 20  20 ce 0d 24 9a 05 e1 0d  |re%.$..  ..$....|
00006060  24 a4 05 3a 0d 24 ae 0e  dd f2 50 6f 6c 6c 4c 6f  |$..:.$....PollLo|
00006070  6f 70 0d 24 b8 1d f4 20  43 68 65 63 6b 20 77 68  |op.$... Check wh|
00006080  61 74 20 69 73 20 68 61  70 70 65 6e 69 6e 67 0d  |at is happening.|
00006090  24 c2 04 0d 24 cc 07 20  20 f5 0d 24 d6 28 20 20  |$...$..  ..$.(  |
000060a0  20 20 c8 99 20 22 57 69  6d 70 5f 50 6f 6c 6c 22  |  .. "Wimp_Poll"|
000060b0  2c 2c 62 6c 6f 63 6b 25  20 b8 20 72 65 61 73 6f  |,,block% . reaso|
000060c0  6e 25 0d 24 e0 14 20 20  20 20 c8 8e 20 72 65 61  |n%.$..    .. rea|
000060d0  73 6f 6e 25 20 ca 0d 24  ea 15 20 20 20 20 20 20  |son% ..$..      |
000060e0  c9 20 31 3a f2 52 65 64  72 61 77 0d 24 f4 2a 20  |. 1:.Redraw.$.* |
000060f0  20 20 20 20 20 c9 20 32  3a c8 99 20 22 57 69 6d  |     . 2:.. "Wim|
00006100  70 5f 4f 70 65 6e 57 69  6e 64 6f 77 22 2c 2c 62  |p_OpenWindow",,b|
00006110  6c 6f 63 6b 25 0d 24 fe  2b 20 20 20 20 20 20 c9  |lock%.$.+      .|
00006120  20 33 3a c8 99 20 22 57  69 6d 70 5f 43 6c 6f 73  | 3:.. "Wimp_Clos|
00006130  65 57 69 6e 64 6f 77 22  2c 2c 62 6c 6f 63 6b 25  |eWindow",,block%|
00006140  0d 25 08 19 20 20 20 20  20 20 c9 20 36 3a f2 4d  |.%..      . 6:.M|
00006150  6f 75 73 65 43 6c 69 63  6b 0d 25 12 2a 20 20 20  |ouseClick.%.*   |
00006160  20 20 20 c9 20 37 3a f2  44 72 61 67 53 61 76 65  |   . 7:.DragSave|
00006170  28 a4 74 65 78 74 28 73  61 76 65 62 6f 78 25 2c  |(.text(savebox%,|
00006180  32 29 29 0d 25 1c 17 20  20 20 20 20 20 c9 20 38  |2)).%..      . 8|
00006190  3a f2 4b 65 79 43 6c 69  63 6b 0d 25 26 19 20 20  |:.KeyClick.%&.  |
000061a0  20 20 20 20 c9 20 39 3a  f2 4d 65 6e 75 53 65 6c  |    . 9:.MenuSel|
000061b0  65 63 74 0d 25 30 1a 20  20 20 20 20 20 c9 20 31  |ect.%0.      . 1|
000061c0  37 2c 31 38 3a f2 4d 65  73 73 61 67 65 0d 25 3a  |7,18:.Message.%:|
000061d0  09 20 20 20 20 cb 0d 25  44 04 0d 25 4e 4f 20 20  |.    ..%D..%NO  |
000061e0  20 20 e7 20 50 6c 61 79  65 72 54 79 70 65 28 74  |  . PlayerType(t|
000061f0  75 72 6e 29 3d 43 6f 6d  70 75 74 65 72 20 80 20  |urn)=Computer . |
00006200  41 6c 6c 48 6f 6d 65 3c  4e 75 6d 50 6c 61 79 65  |AllHome<NumPlaye|
00006210  72 73 20 80 20 73 74 61  72 74 65 64 3d b9 20 80  |rs . started=. .|
00006220  20 62 65 65 6e 3d b9 20  8c 0d 25 58 18 20 20 20  | been=. ..%X.   |
00006230  20 20 20 f2 50 6f 6c 6c  49 64 6c 65 28 31 30 30  |   .PollIdle(100|
00006240  29 0d 25 62 0f 20 20 20  20 20 20 f2 64 69 63 65  |).%b.      .dice|
00006250  0d 25 6c 09 20 20 20 20  cd 0d 25 76 04 0d 25 80  |.%l.    ..%v..%.|
00006260  4f 20 20 20 20 e7 20 50  6c 61 79 65 72 54 79 70  |O    . PlayerTyp|
00006270  65 28 74 75 72 6e 29 3d  43 6f 6d 70 75 74 65 72  |e(turn)=Computer|
00006280  20 80 20 41 6c 6c 48 6f  6d 65 3c 4e 75 6d 50 6c  | . AllHome<NumPl|
00006290  61 79 65 72 73 20 80 20  73 74 61 72 74 65 64 3d  |ayers . started=|
000062a0  b9 20 80 20 62 65 65 6e  3d a3 20 8c 0d 25 8a 18  |. . been=. ..%..|
000062b0  20 20 20 20 20 20 f2 50  6f 6c 6c 49 64 6c 65 28  |      .PollIdle(|
000062c0  31 30 30 29 0d 25 94 13  20 20 20 20 20 20 f2 63  |100).%..      .c|
000062d0  6f 6d 70 75 74 65 72 0d  25 9e 09 20 20 20 20 cd  |omputer.%..    .|
000062e0  0d 25 a8 04 0d 25 b2 09  20 20 fd 20 a3 0d 25 bc  |.%...%..  . ..%.|
000062f0  05 e1 0d 25 c6 04 0d 25  d0 14 dd f2 50 6f 6c 6c  |...%...%....Poll|
00006300  49 64 6c 65 28 74 69 6d  65 29 0d 25 da 09 20 20  |Idle(time).%..  |
00006310  d1 3d 30 0d 25 e4 07 20  20 f5 0d 25 ee 31 20 20  |.=0.%..  ..%.1  |
00006320  20 20 c8 99 20 22 57 69  6d 70 5f 50 6f 6c 6c 49  |  .. "Wimp_PollI|
00006330  64 6c 65 22 2c 2c 62 6c  6f 63 6b 25 2c 74 69 6d  |dle",,block%,tim|
00006340  65 20 b8 20 72 65 61 73  6f 6e 25 0d 25 f8 14 20  |e . reason%.%.. |
00006350  20 20 20 c8 8e 20 72 65  61 73 6f 6e 25 20 ca 0d  |   .. reason% ..|
00006360  26 02 15 20 20 20 20 20  20 c9 20 31 3a f2 52 65  |&..      . 1:.Re|
00006370  64 72 61 77 0d 26 0c 2a  20 20 20 20 20 20 c9 20  |draw.&.*      . |
00006380  32 3a c8 99 20 22 57 69  6d 70 5f 4f 70 65 6e 57  |2:.. "Wimp_OpenW|
00006390  69 6e 64 6f 77 22 2c 2c  62 6c 6f 63 6b 25 0d 26  |indow",,block%.&|
000063a0  16 2b 20 20 20 20 20 20  c9 20 33 3a c8 99 20 22  |.+      . 3:.. "|
000063b0  57 69 6d 70 5f 43 6c 6f  73 65 57 69 6e 64 6f 77  |Wimp_CloseWindow|
000063c0  22 2c 2c 62 6c 6f 63 6b  25 0d 26 20 19 20 20 20  |",,block%.& .   |
000063d0  20 20 20 c9 20 36 3a f2  4d 6f 75 73 65 43 6c 69  |   . 6:.MouseCli|
000063e0  63 6b 0d 26 2a 2a 20 20  20 20 20 20 c9 20 37 3a  |ck.&**      . 7:|
000063f0  f2 44 72 61 67 53 61 76  65 28 a4 74 65 78 74 28  |.DragSave(.text(|
00006400  73 61 76 65 62 6f 78 25  2c 32 29 29 0d 26 34 17  |savebox%,2)).&4.|
00006410  20 20 20 20 20 20 c9 20  38 3a f2 4b 65 79 43 6c  |      . 8:.KeyCl|
00006420  69 63 6b 0d 26 3e 19 20  20 20 20 20 20 c9 20 39  |ick.&>.      . 9|
00006430  3a f2 4d 65 6e 75 53 65  6c 65 63 74 0d 26 48 1a  |:.MenuSelect.&H.|
00006440  20 20 20 20 20 20 c9 20  31 37 2c 31 38 3a f2 4d  |      . 17,18:.M|
00006450  65 73 73 61 67 65 0d 26  52 09 20 20 20 20 cb 0d  |essage.&R.    ..|
00006460  26 5c 0e 20 20 fd 20 91  3e 74 69 6d 65 0d 26 66  |&\.  . .>time.&f|
00006470  05 e1 0d 26 70 04 0d 26  7a 05 3a 0d 26 84 0e dd  |...&p..&z.:.&...|
00006480  f2 4b 65 79 43 6c 69 63  6b 0d 26 8e 23 20 20 c8  |.KeyClick.&.#  .|
00006490  99 22 57 69 6d 70 5f 50  72 6f 63 65 73 73 4b 65  |."Wimp_ProcessKe|
000064a0  79 22 2c 62 6c 6f 63 6b  25 21 32 34 0d 26 98 13  |y",block%!24.&..|
000064b0  20 20 c8 8e 20 62 6c 6f  63 6b 25 21 30 20 ca 0d  |  .. block%!0 ..|
000064c0  26 a2 2e 20 20 20 20 c9  20 70 6c 61 79 65 72 73  |&..    . players|
000064d0  25 20 3a 20 e7 20 62 6c  6f 63 6b 25 21 32 34 3d  |% : . block%!24=|
000064e0  26 44 20 8c 20 f2 70 6c  61 79 65 72 73 0d 26 ac  |&D . .players.&.|
000064f0  30 20 20 20 20 c9 20 73  61 76 65 62 6f 78 25 20  |0    . savebox% |
00006500  3a 20 e7 20 62 6c 6f 63  6b 25 21 32 34 3d 26 44  |: . block%!24=&D|
00006510  20 8c 20 f2 51 75 69 63  6b 53 61 76 65 0d 26 b6  | . .QuickSave.&.|
00006520  07 20 20 cb 0d 26 c0 05  e1 0d 26 ca 04 0d 26 d4  |.  ..&....&...&.|
00006530  0d dd f2 4e 65 77 47 61  6d 65 0d 26 de 20 20 20  |...NewGame.&.   |
00006540  f4 20 53 74 75 66 66 20  74 6f 20 69 6e 69 74 69  |. Stuff to initi|
00006550  61 6c 69 73 65 20 67 61  6d 65 0d 26 e8 04 0d 26  |alise game.&...&|
00006560  f2 1e 20 20 c8 99 20 22  57 69 6d 70 5f 43 72 65  |..  .. "Wimp_Cre|
00006570  61 74 65 4d 65 6e 75 22  2c 2c 2d 31 0d 26 fc 10  |ateMenu",,-1.&..|
00006580  20 20 6d 65 6e 66 6c 61  67 25 3d 30 0d 27 06 04  |  menflag%=0.'..|
00006590  0d 27 10 19 20 20 f2 43  6c 6f 73 65 57 69 6e 64  |.'..  .CloseWind|
000065a0  6f 77 28 6d 61 69 6e 25  29 0d 27 1a 19 20 20 f2  |ow(main%).'..  .|
000065b0  43 6c 6f 73 65 57 69 6e  64 6f 77 28 64 69 63 65  |CloseWindow(dice|
000065c0  25 29 0d 27 24 1c 20 20  f2 43 6c 6f 73 65 57 69  |%).'$.  .CloseWi|
000065d0  6e 64 6f 77 28 72 65 73  75 6c 74 73 25 29 0d 27  |ndow(results%).'|
000065e0  2e 04 0d 27 38 11 20 20  f2 43 6c 65 61 72 42 6f  |...'8.  .ClearBo|
000065f0  61 72 64 0d 27 42 04 0d  27 4c 15 20 20 e3 20 63  |ard.'B..'L.  . c|
00006600  6f 75 6e 74 65 72 3d 30  20 b8 20 33 0d 27 56 16  |ounter=0 . 3.'V.|
00006610  20 20 20 20 72 65 64 28  63 6f 75 6e 74 65 72 29  |    red(counter)|
00006620  3d 30 0d 27 60 17 20 20  20 20 62 6c 75 65 28 63  |=0.'`.    blue(c|
00006630  6f 75 6e 74 65 72 29 3d  30 0d 27 6a 19 20 20 20  |ounter)=0.'j.   |
00006640  20 79 65 6c 6c 6f 77 28  63 6f 75 6e 74 65 72 29  | yellow(counter)|
00006650  3d 30 0d 27 74 18 20 20  20 20 67 72 65 65 6e 28  |=0.'t.    green(|
00006660  63 6f 75 6e 74 65 72 29  3d 30 0d 27 7e 0f 20 20  |counter)=0.'~.  |
00006670  ed 20 63 6f 75 6e 74 65  72 0d 27 88 04 0d 27 92  |. counter.'...'.|
00006680  27 20 20 f2 43 68 61 6e  67 65 49 63 6f 6e 28 6d  |'  .ChangeIcon(m|
00006690  61 69 6e 25 2c 30 2c 22  22 2c 22 73 63 65 6e 74  |ain%,0,"","scent|
000066a0  65 72 22 29 0d 27 9c 0e  20 20 74 75 72 6e 3d 72  |er").'..  turn=r|
000066b0  65 64 0d 27 a6 13 20 20  62 65 65 6e 3d b9 3a 64  |ed.'..  been=.:d|
000066c0  69 63 65 3d 31 0d 27 b0  04 0d 27 ba 0f 20 20 73  |ice=1.'...'..  s|
000066d0  74 61 72 74 65 64 3d a3  0d 27 c4 0f 20 20 41 6c  |tarted=..'..  Al|
000066e0  6c 48 6f 6d 65 3d 30 0d  27 ce 05 e1 0d 27 d8 04  |lHome=0.'....'..|
000066f0  0d 27 e2 10 dd f2 43 6c  65 61 72 42 6f 61 72 64  |.'....ClearBoard|
00006700  0d 27 ec 15 20 20 e3 20  63 6f 75 6e 74 65 72 3d  |.'..  . counter=|
00006710  30 20 b8 20 33 0d 27 f6  04 0d 28 00 1a 20 20 20  |0 . 3.'...(..   |
00006720  20 e7 20 72 65 64 28 63  6f 75 6e 74 65 72 29 3d  | . red(counter)=|
00006730  30 20 8c 0d 28 0a 2d 20  20 20 20 20 20 f2 43 68  |0 ..(.-      .Ch|
00006740  61 6e 67 65 49 63 6f 6e  28 6d 61 69 6e 25 2c 37  |angeIcon(main%,7|
00006750  37 2b 63 6f 75 6e 74 65  72 2c 22 22 2c 22 22 29  |7+counter,"","")|
00006760  0d 28 14 09 20 20 20 20  cc 0d 28 1e 39 20 20 20  |.(..    ..(.9   |
00006770  20 20 20 f2 43 68 61 6e  67 65 49 63 6f 6e 28 6d  |   .ChangeIcon(m|
00006780  61 69 6e 25 2c 69 63 6f  6e 28 72 65 64 2c 72 65  |ain%,icon(red,re|
00006790  64 28 63 6f 75 6e 74 65  72 29 29 2c 22 22 2c 22  |d(counter)),"","|
000067a0  22 29 0d 28 28 09 20 20  20 20 cd 0d 28 32 04 0d  |").((.    ..(2..|
000067b0  28 3c 1b 20 20 20 20 e7  20 62 6c 75 65 28 63 6f  |(<.    . blue(co|
000067c0  75 6e 74 65 72 29 3d 30  20 8c 0d 28 46 2d 20 20  |unter)=0 ..(F-  |
000067d0  20 20 20 20 f2 43 68 61  6e 67 65 49 63 6f 6e 28  |    .ChangeIcon(|
000067e0  6d 61 69 6e 25 2c 38 31  2b 63 6f 75 6e 74 65 72  |main%,81+counter|
000067f0  2c 22 22 2c 22 22 29 0d  28 50 09 20 20 20 20 cc  |,"","").(P.    .|
00006800  0d 28 5a 3b 20 20 20 20  20 20 f2 43 68 61 6e 67  |.(Z;      .Chang|
00006810  65 49 63 6f 6e 28 6d 61  69 6e 25 2c 69 63 6f 6e  |eIcon(main%,icon|
00006820  28 62 6c 75 65 2c 62 6c  75 65 28 63 6f 75 6e 74  |(blue,blue(count|
00006830  65 72 29 29 2c 22 22 2c  22 22 29 0d 28 64 09 20  |er)),"","").(d. |
00006840  20 20 20 cd 0d 28 6e 04  0d 28 78 1d 20 20 20 20  |   ..(n..(x.    |
00006850  e7 20 79 65 6c 6c 6f 77  28 63 6f 75 6e 74 65 72  |. yellow(counter|
00006860  29 3d 30 20 8c 0d 28 82  2d 20 20 20 20 20 20 f2  |)=0 ..(.-      .|
00006870  43 68 61 6e 67 65 49 63  6f 6e 28 6d 61 69 6e 25  |ChangeIcon(main%|
00006880  2c 38 35 2b 63 6f 75 6e  74 65 72 2c 22 22 2c 22  |,85+counter,"","|
00006890  22 29 0d 28 8c 09 20 20  20 20 cc 0d 28 96 3f 20  |").(..    ..(.? |
000068a0  20 20 20 20 20 f2 43 68  61 6e 67 65 49 63 6f 6e  |     .ChangeIcon|
000068b0  28 6d 61 69 6e 25 2c 69  63 6f 6e 28 79 65 6c 6c  |(main%,icon(yell|
000068c0  6f 77 2c 79 65 6c 6c 6f  77 28 63 6f 75 6e 74 65  |ow,yellow(counte|
000068d0  72 29 29 2c 22 22 2c 22  22 29 0d 28 a0 09 20 20  |r)),"","").(..  |
000068e0  20 20 cd 0d 28 aa 04 0d  28 b4 1c 20 20 20 20 e7  |  ..(...(..    .|
000068f0  20 67 72 65 65 6e 28 63  6f 75 6e 74 65 72 29 3d  | green(counter)=|
00006900  30 20 8c 0d 28 be 2d 20  20 20 20 20 20 f2 43 68  |0 ..(.-      .Ch|
00006910  61 6e 67 65 49 63 6f 6e  28 6d 61 69 6e 25 2c 38  |angeIcon(main%,8|
00006920  39 2b 63 6f 75 6e 74 65  72 2c 22 22 2c 22 22 29  |9+counter,"","")|
00006930  0d 28 c8 09 20 20 20 20  cc 0d 28 d2 3d 20 20 20  |.(..    ..(.=   |
00006940  20 20 20 f2 43 68 61 6e  67 65 49 63 6f 6e 28 6d  |   .ChangeIcon(m|
00006950  61 69 6e 25 2c 69 63 6f  6e 28 67 72 65 65 6e 2c  |ain%,icon(green,|
00006960  67 72 65 65 6e 28 63 6f  75 6e 74 65 72 29 29 2c  |green(counter)),|
00006970  22 22 2c 22 22 29 0d 28  dc 09 20 20 20 20 cd 0d  |"","").(..    ..|
00006980  28 e6 09 20 20 20 20 cd  0d 28 f0 04 0d 28 fa 0f  |(..    ..(...(..|
00006990  20 20 ed 20 63 6f 75 6e  74 65 72 0d 29 04 05 e1  |  . counter.)...|
000069a0  0d 29 0e 04 0d 29 18 0f  dd f2 49 6e 69 74 42 6f  |.)...)....InitBo|
000069b0  61 72 64 0d 29 22 15 20  20 e3 20 63 6f 75 6e 74  |ard.)".  . count|
000069c0  65 72 3d 30 20 b8 20 33  0d 29 2c 04 0d 29 36 1e  |er=0 . 3.),..)6.|
000069d0  20 20 20 20 e7 20 50 6c  61 79 65 72 54 79 70 65  |    . PlayerType|
000069e0  28 72 65 64 29 3c 3e a3  20 8c 0d 29 40 1c 20 20  |(red)<>. ..)@.  |
000069f0  20 20 20 20 e7 20 72 65  64 28 63 6f 75 6e 74 65  |    . red(counte|
00006a00  72 29 3d 30 20 8c 0d 29  4a 34 20 20 20 20 20 20  |r)=0 ..)J4      |
00006a10  20 20 f2 43 68 61 6e 67  65 49 63 6f 6e 28 6d 61  |  .ChangeIcon(ma|
00006a20  69 6e 25 2c 37 37 2b 63  6f 75 6e 74 65 72 2c 22  |in%,77+counter,"|
00006a30  31 22 2c 22 73 72 65 64  22 29 0d 29 54 0b 20 20  |1","sred").)T.  |
00006a40  20 20 20 20 cc 0d 29 5e  40 20 20 20 20 20 20 20  |    ..)^@       |
00006a50  20 f2 43 68 61 6e 67 65  49 63 6f 6e 28 6d 61 69  | .ChangeIcon(mai|
00006a60  6e 25 2c 69 63 6f 6e 28  72 65 64 2c 72 65 64 28  |n%,icon(red,red(|
00006a70  63 6f 75 6e 74 65 72 29  29 2c 22 31 22 2c 22 73  |counter)),"1","s|
00006a80  72 65 64 22 29 0d 29 68  0b 20 20 20 20 20 20 cd  |red").)h.      .|
00006a90  0d 29 72 09 20 20 20 20  cd 0d 29 7c 04 0d 29 86  |.)r.    ..)|..).|
00006aa0  1f 20 20 20 20 e7 20 50  6c 61 79 65 72 54 79 70  |.    . PlayerTyp|
00006ab0  65 28 62 6c 75 65 29 3c  3e a3 20 8c 0d 29 90 1d  |e(blue)<>. ..)..|
00006ac0  20 20 20 20 20 20 e7 20  62 6c 75 65 28 63 6f 75  |      . blue(cou|
00006ad0  6e 74 65 72 29 3d 30 20  8c 0d 29 9a 35 20 20 20  |nter)=0 ..).5   |
00006ae0  20 20 20 20 20 f2 43 68  61 6e 67 65 49 63 6f 6e  |     .ChangeIcon|
00006af0  28 6d 61 69 6e 25 2c 38  31 2b 63 6f 75 6e 74 65  |(main%,81+counte|
00006b00  72 2c 22 31 22 2c 22 73  62 6c 75 65 22 29 0d 29  |r,"1","sblue").)|
00006b10  a4 0b 20 20 20 20 20 20  cc 0d 29 ae 43 20 20 20  |..      ..).C   |
00006b20  20 20 20 20 20 f2 43 68  61 6e 67 65 49 63 6f 6e  |     .ChangeIcon|
00006b30  28 6d 61 69 6e 25 2c 69  63 6f 6e 28 62 6c 75 65  |(main%,icon(blue|
00006b40  2c 62 6c 75 65 28 63 6f  75 6e 74 65 72 29 29 2c  |,blue(counter)),|
00006b50  22 31 22 2c 22 73 62 6c  75 65 22 29 0d 29 b8 0b  |"1","sblue").)..|
00006b60  20 20 20 20 20 20 cd 0d  29 c2 09 20 20 20 20 cd  |      ..)..    .|
00006b70  0d 29 cc 04 0d 29 d6 21  20 20 20 20 e7 20 50 6c  |.)...).!    . Pl|
00006b80  61 79 65 72 54 79 70 65  28 79 65 6c 6c 6f 77 29  |ayerType(yellow)|
00006b90  3c 3e a3 20 8c 0d 29 e0  1f 20 20 20 20 20 20 e7  |<>. ..)..      .|
00006ba0  20 79 65 6c 6c 6f 77 28  63 6f 75 6e 74 65 72 29  | yellow(counter)|
00006bb0  3d 30 20 8c 0d 29 ea 37  20 20 20 20 20 20 20 20  |=0 ..).7        |
00006bc0  f2 43 68 61 6e 67 65 49  63 6f 6e 28 6d 61 69 6e  |.ChangeIcon(main|
00006bd0  25 2c 38 35 2b 63 6f 75  6e 74 65 72 2c 22 31 22  |%,85+counter,"1"|
00006be0  2c 22 73 79 65 6c 6c 6f  77 22 29 0d 29 f4 0b 20  |,"syellow").).. |
00006bf0  20 20 20 20 20 cc 0d 29  fe 49 20 20 20 20 20 20  |     ..).I      |
00006c00  20 20 f2 43 68 61 6e 67  65 49 63 6f 6e 28 6d 61  |  .ChangeIcon(ma|
00006c10  69 6e 25 2c 69 63 6f 6e  28 79 65 6c 6c 6f 77 2c  |in%,icon(yellow,|
00006c20  79 65 6c 6c 6f 77 28 63  6f 75 6e 74 65 72 29 29  |yellow(counter))|
00006c30  2c 22 31 22 2c 22 73 79  65 6c 6c 6f 77 22 29 0d  |,"1","syellow").|
00006c40  2a 08 0b 20 20 20 20 20  20 cd 0d 2a 12 09 20 20  |*..      ..*..  |
00006c50  20 20 cd 0d 2a 1c 04 0d  2a 26 20 20 20 20 20 e7  |  ..*...*&     .|
00006c60  20 50 6c 61 79 65 72 54  79 70 65 28 67 72 65 65  | PlayerType(gree|
00006c70  6e 29 3c 3e a3 20 8c 0d  2a 30 1e 20 20 20 20 20  |n)<>. ..*0.     |
00006c80  20 e7 20 67 72 65 65 6e  28 63 6f 75 6e 74 65 72  | . green(counter|
00006c90  29 3d 30 20 8c 0d 2a 3a  36 20 20 20 20 20 20 20  |)=0 ..*:6       |
00006ca0  20 f2 43 68 61 6e 67 65  49 63 6f 6e 28 6d 61 69  | .ChangeIcon(mai|
00006cb0  6e 25 2c 38 39 2b 63 6f  75 6e 74 65 72 2c 22 31  |n%,89+counter,"1|
00006cc0  22 2c 22 73 67 72 65 65  6e 22 29 0d 2a 44 0b 20  |","sgreen").*D. |
00006cd0  20 20 20 20 20 cc 0d 2a  4e 46 20 20 20 20 20 20  |     ..*NF      |
00006ce0  20 20 f2 43 68 61 6e 67  65 49 63 6f 6e 28 6d 61  |  .ChangeIcon(ma|
00006cf0  69 6e 25 2c 69 63 6f 6e  28 67 72 65 65 6e 2c 67  |in%,icon(green,g|
00006d00  72 65 65 6e 28 63 6f 75  6e 74 65 72 29 29 2c 22  |reen(counter)),"|
00006d10  31 22 2c 22 73 67 72 65  65 6e 22 29 0d 2a 58 0b  |1","sgreen").*X.|
00006d20  20 20 20 20 20 20 cd 0d  2a 62 09 20 20 20 20 cd  |      ..*b.    .|
00006d30  0d 2a 6c 0f 20 20 ed 20  63 6f 75 6e 74 65 72 0d  |.*l.  . counter.|
00006d40  2a 76 2d 20 20 f2 43 68  61 6e 67 65 49 63 6f 6e  |*v-  .ChangeIcon|
00006d50  28 64 69 63 65 25 2c 30  2c 22 22 2c 22 73 64 69  |(dice%,0,"","sdi|
00006d60  63 65 22 2b c3 28 64 69  63 65 29 29 0d 2a 80 10  |ce"+.(dice)).*..|
00006d70  20 20 e7 20 62 65 65 6e  3d b9 20 8c 0d 2a 8a 3d  |  . been=. ..*.=|
00006d80  20 20 20 20 20 f2 43 68  61 6e 67 65 49 63 6f 6e  |     .ChangeIcon|
00006d90  28 64 69 63 65 25 2c 31  2c 6e 61 6d 65 24 28 74  |(dice%,1,name$(t|
00006da0  75 72 6e 29 2b 22 2c 20  50 6c 65 61 73 65 20 63  |urn)+", Please c|
00006db0  6c 69 63 6b 22 2c 22 22  29 0d 2a 94 37 20 20 20  |lick","").*.7   |
00006dc0  20 20 f2 43 68 61 6e 67  65 49 63 6f 6e 28 64 69  |  .ChangeIcon(di|
00006dd0  63 65 25 2c 32 2c 22 6f  6e 20 74 68 65 20 64 69  |ce%,2,"on the di|
00006de0  63 65 20 74 6f 20 72 6f  6c 6c 2e 22 2c 22 22 29  |ce to roll.","")|
00006df0  0d 2a 9e 07 20 20 cc 0d  2a a8 3c 20 20 20 20 f2  |.*..  ..*.<    .|
00006e00  43 68 61 6e 67 65 49 63  6f 6e 28 64 69 63 65 25  |ChangeIcon(dice%|
00006e10  2c 31 2c 6e 61 6d 65 24  28 74 75 72 6e 29 2b 22  |,1,name$(turn)+"|
00006e20  2c 20 50 6c 65 61 73 65  20 63 6c 69 63 6b 22 2c  |, Please click",|
00006e30  22 22 29 0d 2a b2 37 20  20 20 20 f2 43 68 61 6e  |"").*.7    .Chan|
00006e40  67 65 49 63 6f 6e 28 64  69 63 65 25 2c 32 2c 22  |geIcon(dice%,2,"|
00006e50  6f 6e 20 74 68 65 20 70  69 65 63 65 20 74 6f 20  |on the piece to |
00006e60  6d 6f 76 65 2e 22 2c 22  22 29 0d 2a bc 07 20 20  |move.","").*..  |
00006e70  cd 0d 2a c6 05 e1 0d ff                           |..*.....|
00006e78