0001  // ScuttleButt
0002  //
0003  // Original Game and Graphics by Karl Hornell 2018
0004  // Adapted for the TI-99/4a by Stefan Bauch 2022
0005  //
0006  //
0007  
0008  DIM SC(6,31), SH(2),P1$(7),P2$(7),TX$(2)
0009  
0010  GOSUB GameInit
0011  REPEAT
0012    GOSUB StartGame
0013    REPEAT
0014      CALL turn(8)  :: dir = 1 :: lm = MIN(144,RND*(144-bx))
0015      REPEAT
0016        CALL KEY(3,k,s)
0017        IF s<>0 THEN BEGIN
0018          // walk right
0019          IF k=68 THEN BEGIN
0020             IF c=0 THEN IF P<22 THEN CALL DrCol(p,4) ELSE GOSUB EmptyBucket
0021             IF c=3 THEN CALL RemCol(p,0,SC(,))
0022             IF c=4 THEN CALL DrCol(p,5)
0023             IF c=7 THEN GOSUB MoveRight
0024             c = c + 1
0025          END
0026          // walk left
0027          IF k=83 THEN BEGIN
0028             IF c=4 THEN CALL DrCol(p,0)
0029             IF c=1 THEN CALL RemCol(p,4,SC(,))
0030             IF c=5 THEN CALL RemCol(p,5,SC(,))
0031             IF c=0 AND P>1 THEN GOSUB MoveLeft
0032             c = c - 1
0033          END
0034          IF c<0 THEN c=0
0035          CALL VWRITE(4872,P1$(C),5040,P2$(C))
0036        END
0037        GOSUB CheckButt
0038      UNTIL MI=3 OR TurdC=0
0039      CALL UnShit(sh(),turd)
0040      CALL Turn(0)
0041      IF MI<3 THEN BEGIN
0042        bf = 0 :: CALL bucket(bf)
0043        CALL Disply(8,7,"Well|done")
0044        CALL Disply(10,5,"Wave|00|cleared")
0045        CALL DisVal(10,10,2,lv)
0046        FOR i=1 TO 10
0047          CALL SOUND(100,220,4)
0048          score = score + 1
0049          CALL DISVAL(2,28,4,Score)
0050          CALL SOUND(50,220,30)
0051        NEXT i
0052        GOSUB UpperClear
0053        lv = lv +1 :: CALL DisVal(8,29,2,lv)
0054        GOSUB LevelPar
0055        CALL LOCATE(#9,240,1) :: txl=10+RND*(60-MIN(lv,30))
0056      END
0057    UNTIL MI=3
0058    // game over
0059    CALL disply(8,9,"GAME|OVER")
0060    REPEAT
0061      CALL KEY(3,k,s)
0062    UNTIL s=1
0063    FOR i=0 TO 5
0064      CALL RemCol(p,i,SC(,))
0065    NEXT i
0066    CALL HCHAR(24,1,0,27)
0067  UNTIL k=78 OR k=88
0068  END
0069  
0070  
0071  CheckButt:
0072    CALL POSITION(#1,by,bx)
0073    IF dir=-1 AND bx<lm THEN CALL turn(8)  :: dir = 1 :: lm = bx+RND*(144-bx)
0074    IF dir= 1 AND bx>lm THEN CALL turn(-8) :: dir =-1 :: lm = 25+RND*(bx-25)
0075  
0076    CALL POSITION(#9,ty,tx)
0077    IF tx>txl AND turd>0 THEN BEGIN
0078      CALL LOCATE(#9,240,1) :: txl=10+RND*(60-MIN(lv,30))
0079      IF sh(0)=0 THEN CALL poop(0,sh(),bx) ELSE IF tsim>1 AND sh(1)=0 THEN CALL poop(1,sh(),bx) ELSE IF tsim>2 AND sh(2)=0  THEN CALL poop(2,sh(),bx) ELSE turd = turd +1
0080      turd = turd -1
0081    END
0082  
0083    FOR sn=0 TO 2
0084      CALL POSITION(#5+sn,sy,sx)
0085      IF sy>140 AND sh(sn) THEN IF sy<161 AND sx>p*8+c*2 AND sx<p*8+c*2+25 AND bf<6 THEN
0086         GOSUB catch ELSE IF sy>180 THEN GOSUB miss
0087    NEXT sn
0088  RETURN
0089  
0090  Catch:
0091    CALL SOUND(250,880-(bf=4)*880-(bf=5)*2640,0)
0092    score=score+1
0093    TurdC = TurdC - 1
0094    CALL DISVAL(2,28,4,Score)
0095    sh(sn)=0
0096    CALL DELSPRITE(#5+sn)
0097    bf = bf +1
0098    CALL bucket(bf)
0099  RETURN
0100  
0101  miss:
0102    CALL SOUND(500,110,0,110,30,830,30,-4,0)
0103    CALL UnShit(sh(),turd)
0104    CALL freeze
0105    MI = MI + 1
0106    CALL HCHAR(11,29,120,MI)
0107    GOSUB SPRITE11
0108    p = p - 2
0109    GOSUB MoveRight
0110    CALL RemCol(p,4,SC(,))
0111    CALL RemCol(p,5,SC(,))
0112    CALL delay(2000)
0113    IF MI<3 THEN CALL thaw :: GOSUB SPRITE00
0114    bf=0 :: CALL bucket(bf)
0115  RETURN
0116  
0117  MoveRight:
0118    CALL RemCol(p,1,SC(,))
0119    P = P + 2
0120    C = -1
0121    CALL window(18,p,23,p+3)
0122    CALL disply(18,p,PR$,0)
0123    CALL window
0124    IF p<20 THEN CALL Disply(24,P-2,FT$) ..
0125            ELSE CALL Disply(24,P-2,seg$(FT$,1,29-P))
0126  RETURN
0127  
0128  MoveLeft:
0129    P = P - 2
0130    C = 8
0131    CALL window(18,p+1,23,p+5)
0132    CALL disply(18,p+1,PL$,0)
0133    CALL window
0134    IF P=1 THEN CALL Disply(24,1,seg$(FT$,3,7)) ELSE
0135      IF p<20 THEN CALL Disply(24,P-2,FT$) ..
0136              ELSE CALL Disply(24,P-2,seg$(FT$,1,29-P))
0137  RETURN
0138  
0139  EmptyBucket:
0140    REPEAT
0141      IF s<>0 THEN BEGIN
0142        // walk right
0143        IF k=68 AND c<3 THEN BEGIN
0144           IF c=0 THEN CALL DrCol(p,4)
0145           IF c=1 THEN CALL DrCol(p,5)
0146           c = c + 1
0147        END
0148        // walk left
0149        IF k=83 THEN BEGIN
0150           IF c=2 THEN CALL RemCol(p,5,SC(,))
0151           IF c=1 THEN CALL RemCol(p,4,SC(,))
0152           c = c - 1
0153        END
0154        IF C>0 THEN ON C GOSUB SPRITE08, SPRITE09, SPRITE10
0155      END
0156      GOSUB CheckButt
0157      IF c=3 AND bf>0 THEN CALL SOUND(300,-7,10) :: bf = bf - 1 :: CALL bucket(bf)
0158      CALL KEY(3,k,s)
0159    UNTIL c<1
0160    CALL VWRITE(4872,P1$(0),5040,P2$(0))
0161  RETURN
0162  
0163  
0164  StartGame:
0165    CALL DISPLY(4,8,"SCUTTLEBUTT")
0166    CALL DISPLY(6,5,"Behind|Enema|Lines")
0167    i=1 :: j=0
0168    tx$(0) = "Press|any|key|||||||TI|Port|by|Stefan|Bauch||||||Original|Game|by|Karl|H}rnell|"
0169    tx$(1) = "This|giant|posterior|has|turned|up|in|your|livingroom|and|intends|to|make|a|mess.|Move|left|and|right|to|catch|the|waste|in|your|bucket.|"
0170    tx$(2) = "The|bucket|has|limited|capacity.|Empty|it|in|the|toilet|now|and|then|so|that|it|does|not|overflow.|Good|luck.|"
0171    REPEAT
0172      a$=seg$("||||||||||||||||||||||||||"&TX$(j),i,26)
0173      IF i>LEN(tx$(j))+25 THEN i=1 :: j=j+1 ELSE i=i+1
0174      IF j=3 THEN j=0
0175      CALL disply(10,1,a$)
0176      CALL delay(150)
0177      CALL KEY(3,k,s)
0178    UNTIL s=1
0179  
0180    GOSUB UpperClear
0181    IF score>hsc THEN CALL DisVal(5,28,4,score) :: hsc=score
0182    P = 9 :: C = 0 :: txl = 60
0183    LV = 1 :: MI = 0
0184    Score = 0 :: bf = 0
0185    CALL VWRITE(4872,P1$(0),5040,P2$(0))
0186    GOSUB ScoreTab
0187    GOSUB LevelPar
0188    GOSUB MoveRight
0189    CALL SPRITE(#9,88,3,240,1,0,10)
0190  RETURN
0191  
0192  
0193  GameInit:
0194    CALL SCRN2
0195    CALL SCREEN2(16)
0196    CALL COLOR2(81,16,16)
0197    CALL HCHAR(1,1,0,384)
0198  
0199    // Define Room Characters
0200    FOR C=1 TO 68::READ CN,CC$::CALL CHAR2(CN,CC$)::NEXT C
0201  
0202    CALL DISPLY(4,8,"SCUTTLEBUTT")
0203  
0204    // Draw Room
0205    FOR Y=0 TO 11
0206      FOR X=0 TO 31
0207        READ CP :: CALL VCHAR(Y+13,X+1,CP) :: SC(MAX(0,Y-5),X)=CP
0208      NEXT X
0209    NEXT Y
0210  
0211    CALL VCHAR(1,27,129,12)
0212    GOSUB ScoreTab
0213    CALL COLOR2(81,2,16)
0214  
0215    FOR i=0 TO 5
0216      FOR j=0 TO 3
0217        PR$=PR$&CHR$(1+j*7+i)
0218      NEXT j
0219    NEXT i
0220  
0221    FOR i=0 TO 5
0222      FOR j=1 TO 5
0223        PL$=PL$&CHR$(1+j*7+i)
0224      NEXT j
0225    NEXT i
0226  
0227    // Prepare Butt
0228    CALL MAGNIFY(3)
0229    CALL CHAR(100,"C0C8D0C0E079333C1E07070101000000000000000000081010C3D8F0FE7F0700")
0230    CALL CHAR(104,"000000000000002040000C4042F3FF3F00000000000000021A00032F7FFEE800")
0231    CALL CHAR(108,"00000006066C1C9C78F0E0E2FDFF0F0000000000000000000404C00B0FFFFC00")
0232    CALL CHAR(112,"00000100020009038F1FF8F0E0C000003030F070E0E0C0E00080000000000000")
0233    CALL SPRITE(#1,100,2,1,64,#2,104,2,1,80,#3,108,2,1,96,#4,112,2,1,112)
0234    // prepare shit and bucket
0235    CALL CHAR(116,"081C366DDBB6ED7F000000000000000000000000808080000000000000000000")
0236    CALL SPRITE(#8,120,15,113,225)
0237  
0238    // buffer 8 most used character definitions in CPU-RAM for speed
0239    FOR i=0 TO 7
0240      FOR j=1 TO 42
0241        CALL CHAR2(j,"00")
0242      NEXT j
0243      ON i+1 GOSUB SPRITE00, SPRITE01, SPRITE02, SPRITE03, SPRITE04, SPRITE05, SPRITE06, SPRITE07
0244      CALL VREAD(4872,168,P1$(i),5040,168,P2$(I))
0245    NEXT i
0246  
0247    // row 24 ... feet string
0248    ft$ = chr$(0)&chr$(0)&chr$(7)&chr$(14)&chr$(21)&chr$(28)&chr$(35)&chr$(42)&chr$(0)&chr$(0)
0249  RETURN
0250  
0251  LevelPar:
0252    CASE lv OF
0253      1 : turd = 5
0254      2 : turd = 8
0255      ELSE turd = lv * 2 + 4
0256    ENDCASE
0257    TurdC = turd
0258  
0259    tsim = 1
0260    IF lv > 4 THEN tsim = 2
0261    IF lv > 9 THEN tsim = 3
0262  RETURN
0263  
0264  UpperClear:
0265    FOR i=1 TO 12
0266      CALL HCHAR(i,1,0,26)
0267    NEXT i
0268  RETURN
0269  
0270  ScoreTab:
0271    CALL DISPLY(1,28,"Score")
0272    CALL DISVAL(2,28,4, Score)
0273    CALL DISPLY(4,28,"High")
0274    CALL DISVAL(5,28,4,hsc)
0275    CALL DISPLY(7,28,"Wave")
0276    CALL DISVAL(8,29,2,lv)
0277    CALL DISPLY(10,28,"Fail")
0278    CALL DISPLY(11,29,"ooo")
0279    CALL HCHAR(11,29,120,MI)
0280    CALL bucket(bf)
0281    CALL HCHAR(24,1,0,27)
0282  RETURN
0283  
0284  
0285  SPRITE00:
0286    CALL CHAR2( 1,"00000000011F3E3A625C808083878787474020386778BC9E87838180406060383F3F3F3E1010101010100808080804040201000F344282FF")
0287    CALL CHAR2( 8,"00000070880404040C0402FFE0F8F090382F4841C06021B25CC4830303070F1FF8F080000708101020202020101008080402CEFCE20262DE")
0288    CALL CHAR2(15,"0000000000000000000000FF0047A0E060B058CC47C100000000FFFCFEFEFFFF7F1E0000C020101008080808081010202040733F4740467B")
0289    CALL CHAR2(22,"0000000000000000000000FF01FF02020D111D1109EE3C181010E0000000000080C04040402020202020202020204040808000F02C4241FF")
0290  RETURN
0291  
0292  SPRITE01:
0293    CALL CHAR2( 1,"0000000000070F0E18172020202121211110080E191E2F27212020201018180E0F0F0F0F0404040404040202020202010101000F344282FF")
0294    CALL CHAR2( 8,"0000001C62C181818301003FF8FEFCE4CE0B1210F01808ACD7F1600000010307FEFCE08000000306040C080808040404020282FCE20262DE")
0295    CALL CHAR2(15,"0000000000000000000080FF0011283818EC1673113040800000FFFFFFFFFFFF0F01000000F8060101000000000101020203040404070000")
0296    CALL CHAR2(22,"0000000000000000000000FF00FF000003040704C27B0F060404F8008080C0C0E090100808040402828282828204040408FF720464BF0000")
0297    CALL CHAR2(29,"0000000000000000000000C040C0808040404040408000000000000000000000000000000000000000000000000000000000C02010F00000")
0298  RETURN
0299  
0300  SPRITE02:
0301    CALL CHAR2( 1,"00000000000001030306050808080808080404020306070B0908080808040606030303030301010202020202020202010101000F344282FF")
0302    CALL CHAR2( 8,"000000000718F0E0A020C0000F3E7F7F79730204847C86C2EB753C180000000081FFFFF8E00003040408080808040406020282FCE20262DE")
0303    CALL CHAR2(15,"000000000080404040C04020FF00840A0E86FB851C040C1020C0403F3F3F7FFFFF83000000F8070000000000000000000000000000000000")
0304    CALL CHAR2(22,"000000000000000000000000FF007F0000000181C1701E03010101FEC0E0E0F0F0F8640201018141404040414181C63F4740467B00000000")
0305    CALL CHAR2(29,"000000000000000000000000F010F02020D010D01090E0C08000000000000000000000000000000080808000000000F02C4241FF00000000")
0306  RETURN
0307  
0308  SPRITE03:
0309    CALL CHAR2( 2,"000001010202020202020101000001010202020202020101000000000000000000000000000000000000000F344282FF")
0310    CALL CHAR2( 8,"000000000001067CF8E8887000030F1F1F1E1C0081E19FE1F07A1D0F0600008080E0FFFFFEF840404040808081818282828282FCE20262DE")
0311    CALL CHAR2(15,"0000000000C020101010301008FF80E1C243E1BE2107018384C870100F0F0F1F3F7FE1C0000000001F608080000000000000000000000000")
0312    CALL CHAR2(23,"0000000000FF001F808080C060301C0700000000FFF0F8F8FCFCFE1E0100000000E01008080404040403040404070000")
0313    CALL CHAR2(30,"0000000000FC04FC08083444744424B8F0604040800000000000000000808040202010101010080810FF720464BF0000")
0314    CALL CHAR2(42,"0000C02010F00000")
0315  RETURN
0316  
0317  SPRITE04:
0318    CALL CHAR2( 7,"0000000F344282FF")
0319    CALL CHAR2( 8,"00000000000000011F3E3A625C808083878787474020386778BC9E87838180406060383F3F3F3E1010202040408181818282CEFCE20262DE")
0320    CALL CHAR2(15,"00000000000070880404040C0402FFE0F8F090382F4841C06021B25CC4830303070F1FF8F080000708106080800000000000000000000000")
0321    CALL CHAR2(23,"000000000000FF0047A0E060B058CC47C100000000FFFCFEFEFFFF7F1E0000C030080402010100000000000000000000")
0322    CALL CHAR2(30,"000000000000FF01FF02020D111D1109EE3C181010E0000000000080C04020101008080402028281C141733F4740467B")
0323    CALL CHAR2(42,"000000F02C4241FF")
0324  RETURN
0325  
0326  SPRITE05:
0327    CALL CHAR2( 7,"00000304080F0000")
0328    CALL CHAR2( 8,"00000000000000070F0E18172020202121211110080E191E2F27212020201018180E0F0F0F0F1010202040404020203018FF4E2026FD0000")
0329    CALL CHAR2(15,"00000000001C62C181818301003FF8FEFCE4CE0B1210F01808ACD7F1600000010307FEFCE0800007186080804040602040C0202020E00000")
0330    CALL CHAR2(23,"0000000080FF0011283818EC1673113040800000FFFFFFFFFFFF1F07000000E018040201010000000000000000000000")
0331    CALL CHAR2(30,"0000000000FF00FF000003040704C27B0F060404F8008080C0C0E0A01018080804040402828242414141733F4740467B")
0332    CALL CHAR2(37,"0000000000C040C08080404040404080000000000000000000000000000000000000000000000000000000F02C4241FF")
0333  RETURN
0334  
0335  SPRITE06:
0336    CALL CHAR2( 8,"00000000000001030306050808080808080404020306070B09080808080406060303030307080810101008080403000F344282FF00000000")
0337    CALL CHAR2(15,"000000000718F0E0A020C0000F3E7F7F79730204847C86C2EB753C180000000081FFFFF8E00106081010080C0301C2FCE20262DE00000000")
0338    CALL CHAR2(22,"000000000080404040C04020FF00840A0E86FB851C040C1020C0403F3F3F7FFFFF87010000F8040201010000000000000000000000000000")
0339    CALL CHAR2(30,"00000000FF007F0000000181C1701E03010101FEC0E0E0F0F0F8E8040402020201018181404040404040213F4740467B")
0340    CALL CHAR2(37,"00000000F010F02020D010D01090E0C0800000000000000000000000000000000000000080808080808000F02C4241FF")
0341  RETURN
0342  
0343  SPRITE07:
0344    CALL CHAR2( 9,"0101020202020202010100000101020202020202010101000000000000000000000000000000000000000304080F0000")
0345    CALL CHAR2(15,"00000001067CF8E8887000030F1F1F1E1C0081E19FE1F07A1D0F0600008080E0FFFFFEF840408080808181814040203018FF4E2026FD0000")
0346    CALL CHAR2(22,"000000C020101010301008FF80E1C243E1BE2107018384C870100F0F0F1F3F7FE1C0000006394080800000008080406020C0202020E00000")
0347    CALL CHAR2(30,"000000FF001F808080C060301C0700000000FFF0F8F8FCFCFE7A02010101804040402020202020204040733F4740467B")
0348    CALL CHAR2(37,"000000FC04FC08083444744424B8F060404080000000000000000000000080808080404040404040808000F02C4241FF")
0349  RETURN
0350  
0351  
0352  // Frames for dumping to toilet
0353  SPRITE08:
0354    CALL CHAR2( 1,"000000000001070908172020202121211110081E3F27614040404060787F7F3F3F3F3F3E1010101010100808080804040201000F344282FF")
0355    CALL CHAR2( 8,"0000001E21C000C0C183003FFEFECF98E0000103CDB0E37C000000000007FFFFFCF0C0000708101020202020101008080402CEFCE20262DE")
0356    CALL CHAR2(15,"0000000000808081820382840404098A8C9C9810D0F8860101030E3EFEFEFFFF7F1E0000C020101008080808081010202040733F4740467B")
0357    CALL CHAR2(22,"0000000000000080403088342B10109190F01008681C34C60301C2241800000080C04040402020202020202020204040C08000F02C4241FF")
0358    CALL CHAR2(29,"FFFFFFFFFFFFFFFFFFFFFFFFFFFF7F9F4F33090403071F3F7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF")
0359  RETURN
0360  
0361  SPRITE09:
0362    CALL CHAR2( 1,"00000000000001030604080808080808040402070F0818103020303C3F3F3F3F3F3F3F3F1010101010100808080804040201000F344282FF")
0363    CALL CHAR2( 8,"000000010678C030F830000F3F7F7361621C0080F3EC3F0000000000C0FFFFFFFCF8C0000708101020202020101008080402CEFCE20262DE")
0364    CALL CHAR2(15,"0000008060101010106020E08080C020202040F13E7880000000030F3FFFFFFF3F0E0000C020101008080808081010202040733F4740467B")
0365    CALL CHAR2(22,"00000000000000000000000102041820509F908380414324386090101F80808080C04040402020202020202020204040C08000F02C4241FF")
0366    CALL CHAR2(29,"FFFFFFFFFFFFFFFFEFC7A703132B11111130A0A2A221212120301010FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000000000000000")
0367    CALL CHAR2(36,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7F7F7F3FBFBF9F5FFFFFFFFF000000FF00000000808080C0C0E0F8FE0708102040601F00")
0368  RETURN
0369  
0370  SPRITE10:
0371    CALL CHAR2( 1,"0000000000000000000001010101010100000000010306040C0C0F0F1F1F1F1F1F3F3F3E1010101010100808080804040201000F344282FF")
0372    CALL CHAR2( 8,"00000000001F3046C38E0001070F0F0F8C8C43E0FE1D0300000000E0FEFFFFFFFFFCE0000708101020202020101008080402CEFCE20262DE")
0373    CALL CHAR2(15,"000000003CC2010181020CC4FCF0E8141422C60F37C3FF00000000001FFFFFFF1F070100C020101008080808081010202040733F4740467B")
0374    CALL CHAR2(22,"0000000000000000000000000000000000010107098AF02020201013FCE4E3E0E0C0C040402020202020202020204040C08000F02C4241FF")
0375    CALL CHAR2(29,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000C02070101021C10302020684E4F4FEFFFFFFFFFFFFFFFFFFFFFFFFFF0000000000000000")
0376    CALL CHAR2(36,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF909030363A3478787072F2F2F5F5F000000FF00000000808080C0C0E0F8FE0708102040601F00")
0377  RETURN
0378  
0379  
0380  // Frame screaming
0381  SPRITE11:
0382    CALL CHAR2( 1,"00000000000000000001010202020202010102060F17234141C183838783838182424221110F081010202010100808040201000F344282FF")
0383    CALL CHAR2( 8,"0000000F10202060D000030F1F3F3F3C180080601F0284C8F8FF00C28587C37D420E02060890E0203F204040201008080402CEFCE20262DE")
0384    CALL CHAR2(15,"0000008040202020500804C4E4F2F2F264040E33E387472F1FFF003F00000081C160380F01000000FF080404080810202040733F4740467B")
0385    CALL CHAR2(22,"000000000000000000000000000000000000000080C0A09008FC0CFA1211E909C989E98AFCD090880808101010204040808000F02C4241FF")
0386    CALL CHAR2(35,"",42,"")
0387  RETURN
0388  
0389  
0390  RoomChar:
0391  DATA 128,"FFFF00000000FFFF",129,"C0C0C0C0C0C0C0C0",130,"0303030303030303",131,"1F18181818181F00"
0392  DATA 132,"F81818181818F800",133,"FF0000000000FF00",134,"FF0000180000FF00",135,"E72424242424E700"
0393  DATA 136,"0808080808080808",137,"1010101010101010",138,"91CBC3BD99FF0000",139,"99999999BDC3D389"
0394  DATA 140,"C3C3C3C3C3C3C3C3",141,"9999999999999999",142,"0000FF9999999999",143,"88888486818080FF"
0395  DATA 144,"00000000FF0000FF",145,"11112161810101FF",146,"9090909090909090",147,"3F40808186848888"
0396  DATA 148,"FF0000FF00000000",149,"FC02018161211191",150,"0909090909090909",151,"03060C181C0E0600"
0397  DATA 152,"88888486818080FF",153,"FF80809F90909090",154,"FF0101F909090909",155,"09090909F90101FF"
0398  DATA 156,"909090909F8080FF",157,"00FC848C848C8484",158,"000E3860C0033620",159,"FFFFFFFFFFFFFFFF"
0399  DATA 160,"4242420404C43800",161,"3C4080800007F800",162,"000000000000FF00",163,"0708102040601F00"
0400  DATA 165,"808080C0C0E0F8FE",166,"000000FF00000000",167,"020402042854AA00",168,"8141414143434303"
0401  DATA 169,"F3F3F9F9F9F9F9FF",170,"E7E7F3F3F3F3F3F3",171,"FFFFE7E7E7E7E7E7",172,"0000FF001C14141C"
0402  DATA 173,"8989898989898989",174,"9191919191919191",175,"89F98F818181F18F",176,"939DF18181838DF1"
0403  DATA 177,"2424242424242424",178,"8080808080808080",179,"0101010101010101",180,"3C76CDA589A589A5"
0404  DATA 181,"F7DCBAACE8B8F0B0",182,"EF7B5D35171D0F0D",183,"20FFFBFB763C3C7E",184,"2020101008040300"
0405  DATA 185,"A41448289020C000",186,"06090605027F407F",187,"18996A9C5DFF00FF",188,"60B05090A0FE02FE"
0406  DATA 189,"102A64AA56341818",190,"FFFF3F3F3F9F9F9F",191,"CFCFCFE7E7E7F0F0",192,"FFFFFCFCFCF9F9F9"
0407  DATA 193,"F3F3F3E7E7E70F0F",0,"00",124,"00",125,"006C007C4444447C"
0408  
0409  
0410  
0411  RoomMap:
0412  DATA 0,147,148,149,0,0,0,0,0,0,0,0,0,0,0,0
0413  DATA 0,0,0,0,0,0,0,0,0,0,159,159,159,159,159,159
0414  DATA 0,146,151,150,0,0,0,0,0,153,148,148,154,0,0,0
0415  DATA 180,180,180,180,180,180,180,0,0,0,159,159,159,159,159,159
0416  DATA 0,143,144,145,0,0,0,0,0,146,158,158,150,0,0,0
0417  DATA 173,181,0,177,0,182,174,0,0,0,159,159,190,192,159,159
0418  DATA 0,136,142,137,0,0,0,0,0,156,144,144,155,0,0,0
0419  DATA 173,129,0,177,0,130,174,0,0,0,159,159,191,193,159,159
0420  DATA 0,136,141,137,0,0,153,154,0,0,0,0,0,0,0,0
0421  DATA 173,178,0,177,0,179,174,0,0,0,159,159,159,159,159,159
0422  DATA 0,136,139,137,0,0,146,150,0,0,0,0,0,0,0,0
0423  DATA 175,0,162,177,169,0,176,0,0,0,159,159,159,159,159,159
0424  DATA 0,136,138,137,0,0,156,155,0,0,157,0,183,0,0,0
0425  DATA 173,0,138,177,169,0,174,0,0,0,159,159,159,171,172,159
0426  DATA 130,128,128,128,140,128,128,128,128,128,128,128,128,128,129,0
0427  DATA 173,148,148,148,148,148,174,0,0,0,159,159,159,170,0,159
0428  DATA 130,0,0,0,140,131,133,134,133,135,133,134,133,132,129,0
0429  DATA 173,0,0,0,0,0,174,0,189,0,159,159,159,169,0,159
0430  DATA 130,135,135,135,140,131,133,134,133,135,133,134,133,132,129,0
0431  DATA 173,0,0,0,0,0,174,186,187,188,159,166,166,166,0,159
0432  DATA 130,128,128,128,140,128,128,128,128,128,128,128,128,128,129,0
0433  DATA 173,0,0,0,0,0,174,184,162,185,159,165,0,167,168,159
0434  DATA 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
0435  DATA 0,0,0,0,0,0,0,0,0,0,0,163,162,161,160,0
0436  
0437  SUB turn(x)
0438    CALL freeze
0439    CALL MOTION(#1,0,x,#2,0,x,#3,0,x,#4,0,x)
0440    CALL thaw
0441  SUBEND
0442  
0443  SUB DRCOL(P,C)
0444    FOR i=0 TO 5
0445      CALL HCHAR(18+i,p+c,1+i+c*7)
0446    NEXT i
0447  SUBEND
0448  
0449  SUB REMCOL(P,C,SC(,))
0450    FOR i=0 TO 5
0451      CALL HCHAR(18+i,p+c,SC(I,P+C-1))
0452    NEXT i
0453  SUBEND
0454  
0455  SUB Bucket(v)
0456    CALL CHAR(120,rpt$("00",13-v*2)&seg$("0F1F1F1F0F0F0F070707030303000000",25-v*4,v*4))
0457    CALL CHAR(122,rpt$("00",13-v*2)&seg$("F0F8F8F8F0F0F0E0E0E0C0C0C0000000",25-v*4,v*4))
0458  SUBEND
0459  
0460  SUB DISVAL(y,x,l,v)
0461    a$=STR$(v) :: a$=RPT$("0",l-LEN(a$))&a$
0462    CALL disply(y,x,a$)
0463  SUBEND
0464  
0465  SUB Poop(a,sh(),bx)
0466    sh(a)=1 :: CALL SPRITE(#5+a,116,2,16,bx+32,6,0):: CALL SOUND(150,-5,3)
0467  SUBEND
0468  
0469  SUB UnShit(sh(),t)
0470    CALL DELSPRITE(#5,#6,#7)
0471    FOR i=0 TO 2
0472      IF sh(i)>0 THEN t=t+1
0473      sh(i)=0
0474    NEXT i
0475  SUBEND
0476  
0477  
0478