Home » Personal collection » Acorn tapes » Own_Work » drawer_tl_tape01a_d90_acorn_finished_progs.wav » SnakeV1

SnakeV1

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 tapes » Own_Work » drawer_tl_tape01a_d90_acorn_finished_progs.wav
Filename: SnakeV1
Read OK:
File size: 0C88 bytes
Load address: FFFF0E00
Exec address: FFFF8023
File contents
  110ON ERROR GOTO 250
  120MODE6
  130VDU23,1,0;0;0;0;:*FX4,1
  140PROCINIT
  150REPEAT
  160PROCSETUP:PROCSCREEN
  170REPEAT:PROCSNAKE:PROCNUMBER
  180UNTIL FINISHED% OR TIME>6000
  190PROCENDGAME
  200UNTIL FNEND
  210PROCCLEANUP:MODE6
  220END
  250PROCCLEANUP
  260REPORT:IF ERL>0 THEN PRINT" at line ";ERL
  270END
  290DEFPROCINIT
  300HIGHSCORE%=0:*FX11,0
  310max%=500:DIMxpos%(max%),ypos%(max%),D$(4)
  320VDU 23,255,255,255,255,255,255,255,255,255
  330VDU 23,235,24,60,126,219,24,24,24,0:D$(1)=CHR$(235)
  340VDU 23,234,0,24,24,24,219,126,60,24:D$(3)=CHR$(234)
  350VDU 23,233,8,12,6,127,6,12,8,0:D$(2)=CHR$(233)
  360VDU 23,232,16,48,96,254,96,48,16,0:D$(4)=CHR$(232)
  370PROCINSTRUCTIONS
  380ENDPROC
  400DEFPROCINSTRUCTIONS
  410CLS
  420PRINT''SPC(5)"SNAKE"
  430PRINT''"Version 1"
  440PRINT
  450PRINT
  460PRINT
  470PRINT
  480PRINT
  490PRINT
  500PRINT
  510PRINT
  520PRINT
  530PRINT
  540PRINT
  550PRINT
  560PRINT'''SPC(6)"PRESS A KEY";
  570DUMMY=GET
  580ENDPROC
  600DEFPROCSETUP
  610SCORE%=0:TIME=0:NX%=4:NY%=4:value%=0:Head%=2
  620Length%=2:Real_Length%=2:Tail%=0:DIR%=1
  630FINISHED%=FALSE:REASON$=""
  640xpos%(Head%)=19:ypos%(Head%)=10:xpos%(Head%-1)=19
  650 ypos%(Head%-1)=11:xpos%(Tail%)=19:ypos%(Tail%)=12
  660ENDPROC
  680DEFPROCSCREEN
  690CLS:PROCTOPLINE:PRINT
  700FOR I=1 TO 39:VDU255:NEXT
  710FOR J=2 TO 21:VDU31,0,J,255,31,38,J,255:NEXT
  720PRINTTAB(0,22);:FORI%=1 TO 39:VDU255:NEXT
  730VDU 31,19,10,235,31,19,11,42,31,19,12,42
  740ENDPROC
  760DEFPROCSNAKE
  770PROCTOPLINE
  780I$=INKEY$(0):IF I$<>"" THEN PROCNEWDIR(I$)
  790IF Length%=Real_Length% THEN PROCPOKE(xpos%(Tail%),ypos%(Tail%)," "):Tail%=Tail%+1:IF Tail%>max% THEN Tail%=0
  800IF Length%>Real_Length% THEN Real_Length%=Real_Length%+1
  810OHead%=Head%:Head%=Head%+1:IF Head%>max% THEN Head%=0
  820IF DIR%=1 THEN PROCadd(0,-1) ELSE IF DIR%=2 THEN PROCadd(1,0) ELSE IF DIR%=3 THEN PROCadd(0,1) ELSE PROCadd(-1,0)
  830A%=FNPEEK(xpos%(Head%),ypos%(Head%))
  840IF A%=255 THEN FINISHED%=TRUE:REASON$="WALL" ELSE IF A%=126 THEN FINISHED%=TRUE:REASON$="SELF"
  850PROCPOKE(xpos%(OHead%),ypos%(OHead%),"*")
  860PROCPOKE(xpos%(Head%),ypos%(Head%),D$(DIR%))
  870IF A%<>48 THEN ENDPROC
  880FOR I%=value%-1 TO 0 STEP -1
  890PROCPOKE(NX%,NY%,STR$(I%)):Length%=Length%+1
  900PROCWAIT(0.05):SCORE%=SCORE%+1
  910TIME=TIME-57:PROCTOPLINE
  920NEXT
  930value%=0
  940ENDPROC
  960DEFPROCNEWDIR(I$)
  970IF I$=CHR$(&89)THENDIR%=DIR%+1:IF DIR%=5 THEN DIR%=1
  980IF I$=CHR$(&88)THENDIR%=DIR%-1:IF DIR%=0 THEN DIR%=4
  990ENDPROC
 1010DEFPROCadd(x%,y%)
 1020xpos%(Head%)=xpos%(OHead%)+x%:ypos%(Head%)=ypos%(OHead%)+y%
 1030ENDPROC
 1050DEFPROCNUMBER
 1060IF value%<>0 AND RND(120)<>1 THEN ENDPROC
 1070FOR I%=-1 TO 1:FOR J%=-1 TO 1
 1080IF NX%+I%<>xpos%(Head%) OR NY%+J%<>ypos%(Head%) THEN PROCPOKE(NX%+I%,NY%+J%," ")
 1090NEXT,
 1100REPEAT
 1110 NX%=RND(35)+1:NY%=RND(16)+2:valid%=TRUE
 1120FOR I%=-1 TO 1:FOR J%=-1 TO 1
 1130valid%=valid% AND (FNPEEK(NX%+I%,NY%+J%)=0)
 1140NEXT,
 1150UNTIL valid% OR TIME>6000
 1160IF TIME>6000 THEN ENDPROC
 1170value%=RND(9)
 1180FOR I%=-1 TO 1:FOR J%=-1 TO 1
 1190PROCPOKE(NX%+I%,NY%+J%,"`")
 1200NEXT,
 1210PROCPOKE(NX%,NY%,STR$(value%))
 1220ENDPROC
 1240DEFPROCENDGAME
 1250VDU28,4,17,36,8:CLS
 1260PRINTTAB(10,3);"GAME OVER"
 1270IF REASON$="WALL" THEN PRINTTAB(0,1);"YOU'VE HIT A SIDE-OH DEAR!"
 1280 IF REASON$="SELF" THEN PRINTTAB(0,1);"YOU'VE HIT YOURSELF-A BAD MOVE"
 1290IF TIME>6000 THEN PRINTTAB(12,1);"TIME UP"
 1300PROCWAIT(1):IF SCORE%>HIGHSCORE% THEN HIGHSCORE%=SCORE%
 1310ENDPROC
 1330DEF FNEND:LOCAL B$
 1340PRINTTAB(0,6);"ANOTHER GAME (Y/N)"
 1350PRINTTAB(0,8);"PRESS 'I' FOR INSTRUTIONS":VDU 26
 1360REPEAT
 1370B$=GET$
 1380IF B$="I" OR B$="i" THEN PROCINSTRUCTIONS:B$="Y"
 1390UNTIL INSTR("YyNn",B$)
 1400=B$="N" OR B$="n"
 1420DEFPROCTOPLINE
 1430PRINTTAB(0,1);"SCORE= ";SCORE%;" TIME= ";
 1440@%=&20205:PRINT;60-TIME/100;:@%=10
 1450PRINT" HIGH SCORE=";HIGHSCORE%;" ";
 1460 ENDPROC
 1480DEF FNPEEK(X%,Y%)=?(HIMEM+Y%*320+X%*8+2)
 1490 
 1500DEFPROCPOKE(X%,Y%,X$)
 1510VDU31,X%,Y%,ASC(X$)
 1520ENDPROC
 1540DEFPROCWAIT(T):LOCAL oldtime
 1550oldtime=TIME
 1560REPEAT UNTIL TIME-oldtime>T*100
 1570ENDPROC
 1590DEFPROCCLEANUP
 1600*FX 12,0
 1610*FX4,0
 1620@%=10
 1630ENDPROC
n� � � �dz@
x�6
��23,1,0;0;0;0;:*FX4,1
�	�INIT
��
��SETUP:�SCREEN
��:�SNAKE:�NUMBER
�� FINISHED% � �>6000
��ENDGAME
�
� �END
��CLEANUP:�6
��
��CLEANUP
�:� �>0 � �" at line ";�
�
"
��INIT
,HIGHSCORE%=0:*FX11,0
6+max%=500:�xpos%(max%),ypos%(max%),D$(4)
@,� 23,255,255,255,255,255,255,255,255,255
J2� 23,235,24,60,126,219,24,24,24,0:D$(1)=�(235)
T2� 23,234,0,24,24,24,219,126,60,24:D$(3)=�(234)
^-� 23,233,8,12,6,127,6,12,8,0:D$(2)=�(233)
h1� 23,232,16,48,96,254,96,48,16,0:D$(4)=�(232)
r�INSTRUCTIONS
|�
���INSTRUCTIONS
��
��''�(5)"SNAKE"
��''"Version 1"
��
��
��
��
��
��
��
��
�
�
�
&�
0�'''�(6)"PRESS A KEY";
:DUMMY=�
D�
X��SETUP
b-SCORE%=0:�=0:NX%=4:NY%=4:value%=0:Head%=2
l+Length%=2:Real_Length%=2:Tail%=0:DIR%=1
vFINISHED%=�:REASON$=""
�5xpos%(Head%)=19:ypos%(Head%)=10:xpos%(Head%-1)=19
�6 ypos%(Head%-1)=11:xpos%(Tail%)=19:ypos%(Tail%)=12
��
���SCREEN
��:�TOPLINE:�
�� I=1 � 39:�255:�
�(� J=2 � 21:�31,0,J,255,31,38,J,255:�
��0,22);:�I%=1 � 39:�255:�
�*� 31,19,10,235,31,19,11,42,31,19,12,42
��
���SNAKE
�TOPLINE
"I$=�(0):� I$<>"" � �NEWDIR(I$)
f� Length%=Real_Length% � �POKE(xpos%(Tail%),ypos%(Tail%)," "):Tail%=Tail%+1:� Tail%>max% � Tail%=0
 8� Length%>Real_Length% � Real_Length%=Real_Length%+1
*5OHead%=Head%:Head%=Head%+1:� Head%>max% � Head%=0
4T� DIR%=1 � �add(0,-1) � � DIR%=2 � �add(1,0) � � DIR%=3 � �add(0,1) � �add(-1,0)
>'A%=�PEEK(xpos%(Head%),ypos%(Head%))
HQ� A%=255 � FINISHED%=�:REASON$="WALL" � � A%=126 � FINISHED%=�:REASON$="SELF"
R*�POKE(xpos%(OHead%),ypos%(OHead%),"*")
\-�POKE(xpos%(Head%),ypos%(Head%),D$(DIR%))
f� A%<>48 � �
p� I%=value%-1 � 0 � -1
z*�POKE(NX%,NY%,�(I%)):Length%=Length%+1
��WAIT(0.05):SCORE%=SCORE%+1
��=�-57:�TOPLINE
��
�value%=0
��
���NEWDIR(I$)
�-� I$=�(&89)�DIR%=DIR%+1:� DIR%=5 � DIR%=1
�-� I$=�(&88)�DIR%=DIR%-1:� DIR%=0 � DIR%=4
��
���add(x%,y%)
�?xpos%(Head%)=xpos%(OHead%)+x%:ypos%(Head%)=ypos%(OHead%)+y%
�
��NUMBER
$� value%<>0 � �(120)<>1 � �
.� I%=-1 � 1:� J%=-1 � 1
8L� NX%+I%<>xpos%(Head%) � NY%+J%<>ypos%(Head%) � �POKE(NX%+I%,NY%+J%," ")
B�,
L�
V% NX%=�(35)+1:NY%=�(16)+2:valid%=�
`� I%=-1 � 1:� J%=-1 � 1
j,valid%=valid% � (�PEEK(NX%+I%,NY%+J%)=0)
t�,
~� valid% � �>6000
�� �>6000 � �
�value%=�(9)
�� I%=-1 � 1:� J%=-1 � 1
��POKE(NX%+I%,NY%+J%,"`")
��,
��POKE(NX%,NY%,�(value%))
��
�
��ENDGAME
��28,4,17,36,8:�
��10,3);"GAME OVER"
�:� REASON$="WALL" � �0,1);"YOU'VE HIT A SIDE-OH DEAR!"
? � REASON$="SELF" � �0,1);"YOU'VE HIT YOURSELF-A BAD MOVE"

 � �>6000 � �12,1);"TIME UP"
4�WAIT(1):� SCORE%>HIGHSCORE% � HIGHSCORE%=SCORE%
�
2� �END:� B$
<�0,6);"ANOTHER GAME (Y/N)"
F+�0,8);"PRESS 'I' FOR INSTRUTIONS":� 26
P�
ZB$=�
d,� B$="I" � B$="i" � �INSTRUCTIONS:B$="Y"
n� �"YyNn",B$)
x=B$="N" � B$="n"
�
��TOPLINE
�&�0,1);"SCORE= ";SCORE%;" TIME= ";
�@%=&20205:�;60-�/100;:@%=10
�#�" HIGH SCORE=";HIGHSCORE%;" ";
� �
�%� �PEEK(X%,Y%)=?(�+Y%*320+X%*8+2)
� 
���POKE(X%,Y%,X$)
��31,X%,Y%,�(X$)
��
��WAIT(T):� oldtime

oldtime=�
� � �-oldtime>T*100
"�
6
��CLEANUP
@*FX 12,0
J
*FX4,0
T	@%=10
^�
�
00000000  0d 00 6e 0e ee 20 85 20  e5 20 8d 64 7a 40 0d 00  |..n.. . . .dz@..|
00000010  78 06 eb 36 0d 00 82 19  ef 32 33 2c 31 2c 30 3b  |x..6.....23,1,0;|
00000020  30 3b 30 3b 30 3b 3a 2a  46 58 34 2c 31 0d 00 8c  |0;0;0;:*FX4,1...|
00000030  09 f2 49 4e 49 54 0d 00  96 05 f5 0d 00 a0 12 f2  |..INIT..........|
00000040  53 45 54 55 50 3a f2 53  43 52 45 45 4e 0d 00 aa  |SETUP:.SCREEN...|
00000050  14 f5 3a f2 53 4e 41 4b  45 3a f2 4e 55 4d 42 45  |..:.SNAKE:.NUMBE|
00000060  52 0d 00 b4 18 fd 20 46  49 4e 49 53 48 45 44 25  |R..... FINISHED%|
00000070  20 84 20 91 3e 36 30 30  30 0d 00 be 0c f2 45 4e  | . .>6000.....EN|
00000080  44 47 41 4d 45 0d 00 c8  0a fd 20 a4 45 4e 44 0d  |DGAME..... .END.|
00000090  00 d2 0f f2 43 4c 45 41  4e 55 50 3a eb 36 0d 00  |....CLEANUP:.6..|
000000a0  dc 05 e0 0d 00 fa 0c f2  43 4c 45 41 4e 55 50 0d  |........CLEANUP.|
000000b0  01 04 1c f6 3a e7 20 9e  3e 30 20 8c 20 f1 22 20  |....:. .>0 . ." |
000000c0  61 74 20 6c 69 6e 65 20  22 3b 9e 0d 01 0e 05 e0  |at line ";......|
000000d0  0d 01 22 0a dd f2 49 4e  49 54 0d 01 2c 18 48 49  |.."...INIT..,.HI|
000000e0  47 48 53 43 4f 52 45 25  3d 30 3a 2a 46 58 31 31  |GHSCORE%=0:*FX11|
000000f0  2c 30 0d 01 36 2b 6d 61  78 25 3d 35 30 30 3a de  |,0..6+max%=500:.|
00000100  78 70 6f 73 25 28 6d 61  78 25 29 2c 79 70 6f 73  |xpos%(max%),ypos|
00000110  25 28 6d 61 78 25 29 2c  44 24 28 34 29 0d 01 40  |%(max%),D$(4)..@|
00000120  2c ef 20 32 33 2c 32 35  35 2c 32 35 35 2c 32 35  |,. 23,255,255,25|
00000130  35 2c 32 35 35 2c 32 35  35 2c 32 35 35 2c 32 35  |5,255,255,255,25|
00000140  35 2c 32 35 35 2c 32 35  35 0d 01 4a 32 ef 20 32  |5,255,255..J2. 2|
00000150  33 2c 32 33 35 2c 32 34  2c 36 30 2c 31 32 36 2c  |3,235,24,60,126,|
00000160  32 31 39 2c 32 34 2c 32  34 2c 32 34 2c 30 3a 44  |219,24,24,24,0:D|
00000170  24 28 31 29 3d bd 28 32  33 35 29 0d 01 54 32 ef  |$(1)=.(235)..T2.|
00000180  20 32 33 2c 32 33 34 2c  30 2c 32 34 2c 32 34 2c  | 23,234,0,24,24,|
00000190  32 34 2c 32 31 39 2c 31  32 36 2c 36 30 2c 32 34  |24,219,126,60,24|
000001a0  3a 44 24 28 33 29 3d bd  28 32 33 34 29 0d 01 5e  |:D$(3)=.(234)..^|
000001b0  2d ef 20 32 33 2c 32 33  33 2c 38 2c 31 32 2c 36  |-. 23,233,8,12,6|
000001c0  2c 31 32 37 2c 36 2c 31  32 2c 38 2c 30 3a 44 24  |,127,6,12,8,0:D$|
000001d0  28 32 29 3d bd 28 32 33  33 29 0d 01 68 31 ef 20  |(2)=.(233)..h1. |
000001e0  32 33 2c 32 33 32 2c 31  36 2c 34 38 2c 39 36 2c  |23,232,16,48,96,|
000001f0  32 35 34 2c 39 36 2c 34  38 2c 31 36 2c 30 3a 44  |254,96,48,16,0:D|
00000200  24 28 34 29 3d bd 28 32  33 32 29 0d 01 72 11 f2  |$(4)=.(232)..r..|
00000210  49 4e 53 54 52 55 43 54  49 4f 4e 53 0d 01 7c 05  |INSTRUCTIONS..|.|
00000220  e1 0d 01 90 12 dd f2 49  4e 53 54 52 55 43 54 49  |.......INSTRUCTI|
00000230  4f 4e 53 0d 01 9a 05 db  0d 01 a4 12 f1 27 27 89  |ONS..........''.|
00000240  28 35 29 22 53 4e 41 4b  45 22 0d 01 ae 12 f1 27  |(5)"SNAKE".....'|
00000250  27 22 56 65 72 73 69 6f  6e 20 31 22 0d 01 b8 05  |'"Version 1"....|
00000260  f1 0d 01 c2 05 f1 0d 01  cc 05 f1 0d 01 d6 05 f1  |................|
00000270  0d 01 e0 05 f1 0d 01 ea  05 f1 0d 01 f4 05 f1 0d  |................|
00000280  01 fe 05 f1 0d 02 08 05  f1 0d 02 12 05 f1 0d 02  |................|
00000290  1c 05 f1 0d 02 26 05 f1  0d 02 30 1a f1 27 27 27  |.....&....0..'''|
000002a0  89 28 36 29 22 50 52 45  53 53 20 41 20 4b 45 59  |.(6)"PRESS A KEY|
000002b0  22 3b 0d 02 3a 0b 44 55  4d 4d 59 3d a5 0d 02 44  |";..:.DUMMY=...D|
000002c0  05 e1 0d 02 58 0b dd f2  53 45 54 55 50 0d 02 62  |....X...SETUP..b|
000002d0  2d 53 43 4f 52 45 25 3d  30 3a d1 3d 30 3a 4e 58  |-SCORE%=0:.=0:NX|
000002e0  25 3d 34 3a 4e 59 25 3d  34 3a 76 61 6c 75 65 25  |%=4:NY%=4:value%|
000002f0  3d 30 3a 48 65 61 64 25  3d 32 0d 02 6c 2b 4c 65  |=0:Head%=2..l+Le|
00000300  6e 67 74 68 25 3d 32 3a  52 65 61 6c 5f 4c 65 6e  |ngth%=2:Real_Len|
00000310  67 74 68 25 3d 32 3a 54  61 69 6c 25 3d 30 3a 44  |gth%=2:Tail%=0:D|
00000320  49 52 25 3d 31 0d 02 76  1a 46 49 4e 49 53 48 45  |IR%=1..v.FINISHE|
00000330  44 25 3d a3 3a 52 45 41  53 4f 4e 24 3d 22 22 0d  |D%=.:REASON$="".|
00000340  02 80 35 78 70 6f 73 25  28 48 65 61 64 25 29 3d  |..5xpos%(Head%)=|
00000350  31 39 3a 79 70 6f 73 25  28 48 65 61 64 25 29 3d  |19:ypos%(Head%)=|
00000360  31 30 3a 78 70 6f 73 25  28 48 65 61 64 25 2d 31  |10:xpos%(Head%-1|
00000370  29 3d 31 39 0d 02 8a 36  20 79 70 6f 73 25 28 48  |)=19...6 ypos%(H|
00000380  65 61 64 25 2d 31 29 3d  31 31 3a 78 70 6f 73 25  |ead%-1)=11:xpos%|
00000390  28 54 61 69 6c 25 29 3d  31 39 3a 79 70 6f 73 25  |(Tail%)=19:ypos%|
000003a0  28 54 61 69 6c 25 29 3d  31 32 0d 02 94 05 e1 0d  |(Tail%)=12......|
000003b0  02 a8 0c dd f2 53 43 52  45 45 4e 0d 02 b2 10 db  |.....SCREEN.....|
000003c0  3a f2 54 4f 50 4c 49 4e  45 3a f1 0d 02 bc 15 e3  |:.TOPLINE:......|
000003d0  20 49 3d 31 20 b8 20 33  39 3a ef 32 35 35 3a ed  | I=1 . 39:.255:.|
000003e0  0d 02 c6 28 e3 20 4a 3d  32 20 b8 20 32 31 3a ef  |...(. J=2 . 21:.|
000003f0  33 31 2c 30 2c 4a 2c 32  35 35 2c 33 31 2c 33 38  |31,0,J,255,31,38|
00000400  2c 4a 2c 32 35 35 3a ed  0d 02 d0 1e f1 8a 30 2c  |,J,255:.......0,|
00000410  32 32 29 3b 3a e3 49 25  3d 31 20 b8 20 33 39 3a  |22);:.I%=1 . 39:|
00000420  ef 32 35 35 3a ed 0d 02  da 2a ef 20 33 31 2c 31  |.255:....*. 31,1|
00000430  39 2c 31 30 2c 32 33 35  2c 33 31 2c 31 39 2c 31  |9,10,235,31,19,1|
00000440  31 2c 34 32 2c 33 31 2c  31 39 2c 31 32 2c 34 32  |1,42,31,19,12,42|
00000450  0d 02 e4 05 e1 0d 02 f8  0b dd f2 53 4e 41 4b 45  |...........SNAKE|
00000460  0d 03 02 0c f2 54 4f 50  4c 49 4e 45 0d 03 0c 22  |.....TOPLINE..."|
00000470  49 24 3d bf 28 30 29 3a  e7 20 49 24 3c 3e 22 22  |I$=.(0):. I$<>""|
00000480  20 8c 20 f2 4e 45 57 44  49 52 28 49 24 29 0d 03  | . .NEWDIR(I$)..|
00000490  16 66 e7 20 4c 65 6e 67  74 68 25 3d 52 65 61 6c  |.f. Length%=Real|
000004a0  5f 4c 65 6e 67 74 68 25  20 8c 20 f2 50 4f 4b 45  |_Length% . .POKE|
000004b0  28 78 70 6f 73 25 28 54  61 69 6c 25 29 2c 79 70  |(xpos%(Tail%),yp|
000004c0  6f 73 25 28 54 61 69 6c  25 29 2c 22 20 22 29 3a  |os%(Tail%)," "):|
000004d0  54 61 69 6c 25 3d 54 61  69 6c 25 2b 31 3a e7 20  |Tail%=Tail%+1:. |
000004e0  54 61 69 6c 25 3e 6d 61  78 25 20 8c 20 54 61 69  |Tail%>max% . Tai|
000004f0  6c 25 3d 30 0d 03 20 38  e7 20 4c 65 6e 67 74 68  |l%=0.. 8. Length|
00000500  25 3e 52 65 61 6c 5f 4c  65 6e 67 74 68 25 20 8c  |%>Real_Length% .|
00000510  20 52 65 61 6c 5f 4c 65  6e 67 74 68 25 3d 52 65  | Real_Length%=Re|
00000520  61 6c 5f 4c 65 6e 67 74  68 25 2b 31 0d 03 2a 35  |al_Length%+1..*5|
00000530  4f 48 65 61 64 25 3d 48  65 61 64 25 3a 48 65 61  |OHead%=Head%:Hea|
00000540  64 25 3d 48 65 61 64 25  2b 31 3a e7 20 48 65 61  |d%=Head%+1:. Hea|
00000550  64 25 3e 6d 61 78 25 20  8c 20 48 65 61 64 25 3d  |d%>max% . Head%=|
00000560  30 0d 03 34 54 e7 20 44  49 52 25 3d 31 20 8c 20  |0..4T. DIR%=1 . |
00000570  f2 61 64 64 28 30 2c 2d  31 29 20 8b 20 e7 20 44  |.add(0,-1) . . D|
00000580  49 52 25 3d 32 20 8c 20  f2 61 64 64 28 31 2c 30  |IR%=2 . .add(1,0|
00000590  29 20 8b 20 e7 20 44 49  52 25 3d 33 20 8c 20 f2  |) . . DIR%=3 . .|
000005a0  61 64 64 28 30 2c 31 29  20 8b 20 f2 61 64 64 28  |add(0,1) . .add(|
000005b0  2d 31 2c 30 29 0d 03 3e  27 41 25 3d a4 50 45 45  |-1,0)..>'A%=.PEE|
000005c0  4b 28 78 70 6f 73 25 28  48 65 61 64 25 29 2c 79  |K(xpos%(Head%),y|
000005d0  70 6f 73 25 28 48 65 61  64 25 29 29 0d 03 48 51  |pos%(Head%))..HQ|
000005e0  e7 20 41 25 3d 32 35 35  20 8c 20 46 49 4e 49 53  |. A%=255 . FINIS|
000005f0  48 45 44 25 3d b9 3a 52  45 41 53 4f 4e 24 3d 22  |HED%=.:REASON$="|
00000600  57 41 4c 4c 22 20 8b 20  e7 20 41 25 3d 31 32 36  |WALL" . . A%=126|
00000610  20 8c 20 46 49 4e 49 53  48 45 44 25 3d b9 3a 52  | . FINISHED%=.:R|
00000620  45 41 53 4f 4e 24 3d 22  53 45 4c 46 22 0d 03 52  |EASON$="SELF"..R|
00000630  2a f2 50 4f 4b 45 28 78  70 6f 73 25 28 4f 48 65  |*.POKE(xpos%(OHe|
00000640  61 64 25 29 2c 79 70 6f  73 25 28 4f 48 65 61 64  |ad%),ypos%(OHead|
00000650  25 29 2c 22 2a 22 29 0d  03 5c 2d f2 50 4f 4b 45  |%),"*")..\-.POKE|
00000660  28 78 70 6f 73 25 28 48  65 61 64 25 29 2c 79 70  |(xpos%(Head%),yp|
00000670  6f 73 25 28 48 65 61 64  25 29 2c 44 24 28 44 49  |os%(Head%),D$(DI|
00000680  52 25 29 29 0d 03 66 10  e7 20 41 25 3c 3e 34 38  |R%))..f.. A%<>48|
00000690  20 8c 20 e1 0d 03 70 1a  e3 20 49 25 3d 76 61 6c  | . ...p.. I%=val|
000006a0  75 65 25 2d 31 20 b8 20  30 20 88 20 2d 31 0d 03  |ue%-1 . 0 . -1..|
000006b0  7a 2a f2 50 4f 4b 45 28  4e 58 25 2c 4e 59 25 2c  |z*.POKE(NX%,NY%,|
000006c0  c3 28 49 25 29 29 3a 4c  65 6e 67 74 68 25 3d 4c  |.(I%)):Length%=L|
000006d0  65 6e 67 74 68 25 2b 31  0d 03 84 1f f2 57 41 49  |ength%+1.....WAI|
000006e0  54 28 30 2e 30 35 29 3a  53 43 4f 52 45 25 3d 53  |T(0.05):SCORE%=S|
000006f0  43 4f 52 45 25 2b 31 0d  03 8e 13 d1 3d 91 2d 35  |CORE%+1.....=.-5|
00000700  37 3a f2 54 4f 50 4c 49  4e 45 0d 03 98 05 ed 0d  |7:.TOPLINE......|
00000710  03 a2 0c 76 61 6c 75 65  25 3d 30 0d 03 ac 05 e1  |...value%=0.....|
00000720  0d 03 c0 10 dd f2 4e 45  57 44 49 52 28 49 24 29  |......NEWDIR(I$)|
00000730  0d 03 ca 2d e7 20 49 24  3d bd 28 26 38 39 29 8c  |...-. I$=.(&89).|
00000740  44 49 52 25 3d 44 49 52  25 2b 31 3a e7 20 44 49  |DIR%=DIR%+1:. DI|
00000750  52 25 3d 35 20 8c 20 44  49 52 25 3d 31 0d 03 d4  |R%=5 . DIR%=1...|
00000760  2d e7 20 49 24 3d bd 28  26 38 38 29 8c 44 49 52  |-. I$=.(&88).DIR|
00000770  25 3d 44 49 52 25 2d 31  3a e7 20 44 49 52 25 3d  |%=DIR%-1:. DIR%=|
00000780  30 20 8c 20 44 49 52 25  3d 34 0d 03 de 05 e1 0d  |0 . DIR%=4......|
00000790  03 f2 10 dd f2 61 64 64  28 78 25 2c 79 25 29 0d  |.....add(x%,y%).|
000007a0  03 fc 3f 78 70 6f 73 25  28 48 65 61 64 25 29 3d  |..?xpos%(Head%)=|
000007b0  78 70 6f 73 25 28 4f 48  65 61 64 25 29 2b 78 25  |xpos%(OHead%)+x%|
000007c0  3a 79 70 6f 73 25 28 48  65 61 64 25 29 3d 79 70  |:ypos%(Head%)=yp|
000007d0  6f 73 25 28 4f 48 65 61  64 25 29 2b 79 25 0d 04  |os%(OHead%)+y%..|
000007e0  06 05 e1 0d 04 1a 0c dd  f2 4e 55 4d 42 45 52 0d  |.........NUMBER.|
000007f0  04 24 1f e7 20 76 61 6c  75 65 25 3c 3e 30 20 80  |.$.. value%<>0 .|
00000800  20 b3 28 31 32 30 29 3c  3e 31 20 8c 20 e1 0d 04  | .(120)<>1 . ...|
00000810  2e 1b e3 20 49 25 3d 2d  31 20 b8 20 31 3a e3 20  |... I%=-1 . 1:. |
00000820  4a 25 3d 2d 31 20 b8 20  31 0d 04 38 4c e7 20 4e  |J%=-1 . 1..8L. N|
00000830  58 25 2b 49 25 3c 3e 78  70 6f 73 25 28 48 65 61  |X%+I%<>xpos%(Hea|
00000840  64 25 29 20 84 20 4e 59  25 2b 4a 25 3c 3e 79 70  |d%) . NY%+J%<>yp|
00000850  6f 73 25 28 48 65 61 64  25 29 20 8c 20 f2 50 4f  |os%(Head%) . .PO|
00000860  4b 45 28 4e 58 25 2b 49  25 2c 4e 59 25 2b 4a 25  |KE(NX%+I%,NY%+J%|
00000870  2c 22 20 22 29 0d 04 42  06 ed 2c 0d 04 4c 05 f5  |," ")..B..,..L..|
00000880  0d 04 56 25 20 4e 58 25  3d b3 28 33 35 29 2b 31  |..V% NX%=.(35)+1|
00000890  3a 4e 59 25 3d b3 28 31  36 29 2b 32 3a 76 61 6c  |:NY%=.(16)+2:val|
000008a0  69 64 25 3d b9 0d 04 60  1b e3 20 49 25 3d 2d 31  |id%=...`.. I%=-1|
000008b0  20 b8 20 31 3a e3 20 4a  25 3d 2d 31 20 b8 20 31  | . 1:. J%=-1 . 1|
000008c0  0d 04 6a 2c 76 61 6c 69  64 25 3d 76 61 6c 69 64  |..j,valid%=valid|
000008d0  25 20 80 20 28 a4 50 45  45 4b 28 4e 58 25 2b 49  |% . (.PEEK(NX%+I|
000008e0  25 2c 4e 59 25 2b 4a 25  29 3d 30 29 0d 04 74 06  |%,NY%+J%)=0)..t.|
000008f0  ed 2c 0d 04 7e 15 fd 20  76 61 6c 69 64 25 20 84  |.,..~.. valid% .|
00000900  20 91 3e 36 30 30 30 0d  04 88 10 e7 20 91 3e 36  | .>6000..... .>6|
00000910  30 30 30 20 8c 20 e1 0d  04 92 0f 76 61 6c 75 65  |000 . .....value|
00000920  25 3d b3 28 39 29 0d 04  9c 1b e3 20 49 25 3d 2d  |%=.(9)..... I%=-|
00000930  31 20 b8 20 31 3a e3 20  4a 25 3d 2d 31 20 b8 20  |1 . 1:. J%=-1 . |
00000940  31 0d 04 a6 1c f2 50 4f  4b 45 28 4e 58 25 2b 49  |1.....POKE(NX%+I|
00000950  25 2c 4e 59 25 2b 4a 25  2c 22 60 22 29 0d 04 b0  |%,NY%+J%,"`")...|
00000960  06 ed 2c 0d 04 ba 1c f2  50 4f 4b 45 28 4e 58 25  |..,.....POKE(NX%|
00000970  2c 4e 59 25 2c c3 28 76  61 6c 75 65 25 29 29 0d  |,NY%,.(value%)).|
00000980  04 c4 05 e1 0d 04 d8 0d  dd f2 45 4e 44 47 41 4d  |..........ENDGAM|
00000990  45 0d 04 e2 13 ef 32 38  2c 34 2c 31 37 2c 33 36  |E.....28,4,17,36|
000009a0  2c 38 3a db 0d 04 ec 17  f1 8a 31 30 2c 33 29 3b  |,8:.......10,3);|
000009b0  22 47 41 4d 45 20 4f 56  45 52 22 0d 04 f6 3a e7  |"GAME OVER"...:.|
000009c0  20 52 45 41 53 4f 4e 24  3d 22 57 41 4c 4c 22 20  | REASON$="WALL" |
000009d0  8c 20 f1 8a 30 2c 31 29  3b 22 59 4f 55 27 56 45  |. ..0,1);"YOU'VE|
000009e0  20 48 49 54 20 41 20 53  49 44 45 2d 4f 48 20 44  | HIT A SIDE-OH D|
000009f0  45 41 52 21 22 0d 05 00  3f 20 e7 20 52 45 41 53  |EAR!"...? . REAS|
00000a00  4f 4e 24 3d 22 53 45 4c  46 22 20 8c 20 f1 8a 30  |ON$="SELF" . ..0|
00000a10  2c 31 29 3b 22 59 4f 55  27 56 45 20 48 49 54 20  |,1);"YOU'VE HIT |
00000a20  59 4f 55 52 53 45 4c 46  2d 41 20 42 41 44 20 4d  |YOURSELF-A BAD M|
00000a30  4f 56 45 22 0d 05 0a 20  e7 20 91 3e 36 30 30 30  |OVE"... . .>6000|
00000a40  20 8c 20 f1 8a 31 32 2c  31 29 3b 22 54 49 4d 45  | . ..12,1);"TIME|
00000a50  20 55 50 22 0d 05 14 34  f2 57 41 49 54 28 31 29  | UP"...4.WAIT(1)|
00000a60  3a e7 20 53 43 4f 52 45  25 3e 48 49 47 48 53 43  |:. SCORE%>HIGHSC|
00000a70  4f 52 45 25 20 8c 20 48  49 47 48 53 43 4f 52 45  |ORE% . HIGHSCORE|
00000a80  25 3d 53 43 4f 52 45 25  0d 05 1e 05 e1 0d 05 32  |%=SCORE%.......2|
00000a90  0f dd 20 a4 45 4e 44 3a  ea 20 42 24 0d 05 3c 1f  |.. .END:. B$..<.|
00000aa0  f1 8a 30 2c 36 29 3b 22  41 4e 4f 54 48 45 52 20  |..0,6);"ANOTHER |
00000ab0  47 41 4d 45 20 28 59 2f  4e 29 22 0d 05 46 2b f1  |GAME (Y/N)"..F+.|
00000ac0  8a 30 2c 38 29 3b 22 50  52 45 53 53 20 27 49 27  |.0,8);"PRESS 'I'|
00000ad0  20 46 4f 52 20 49 4e 53  54 52 55 54 49 4f 4e 53  | FOR INSTRUTIONS|
00000ae0  22 3a ef 20 32 36 0d 05  50 05 f5 0d 05 5a 08 42  |":. 26..P....Z.B|
00000af0  24 3d be 0d 05 64 2c e7  20 42 24 3d 22 49 22 20  |$=...d,. B$="I" |
00000b00  84 20 42 24 3d 22 69 22  20 8c 20 f2 49 4e 53 54  |. B$="i" . .INST|
00000b10  52 55 43 54 49 4f 4e 53  3a 42 24 3d 22 59 22 0d  |RUCTIONS:B$="Y".|
00000b20  05 6e 11 fd 20 a7 22 59  79 4e 6e 22 2c 42 24 29  |.n.. ."YyNn",B$)|
00000b30  0d 05 78 14 3d 42 24 3d  22 4e 22 20 84 20 42 24  |..x.=B$="N" . B$|
00000b40  3d 22 6e 22 0d 05 8c 0d  dd f2 54 4f 50 4c 49 4e  |="n"......TOPLIN|
00000b50  45 0d 05 96 26 f1 8a 30  2c 31 29 3b 22 53 43 4f  |E...&..0,1);"SCO|
00000b60  52 45 3d 20 22 3b 53 43  4f 52 45 25 3b 22 20 54  |RE= ";SCORE%;" T|
00000b70  49 4d 45 3d 20 22 3b 0d  05 a0 1f 40 25 3d 26 32  |IME= ";....@%=&2|
00000b80  30 32 30 35 3a f1 3b 36  30 2d 91 2f 31 30 30 3b  |0205:.;60-./100;|
00000b90  3a 40 25 3d 31 30 0d 05  aa 23 f1 22 20 48 49 47  |:@%=10...#." HIG|
00000ba0  48 20 53 43 4f 52 45 3d  22 3b 48 49 47 48 53 43  |H SCORE=";HIGHSC|
00000bb0  4f 52 45 25 3b 22 20 22  3b 0d 05 b4 06 20 e1 0d  |ORE%;" ";.... ..|
00000bc0  05 c8 25 dd 20 a4 50 45  45 4b 28 58 25 2c 59 25  |..%. .PEEK(X%,Y%|
00000bd0  29 3d 3f 28 93 2b 59 25  2a 33 32 30 2b 58 25 2a  |)=?(.+Y%*320+X%*|
00000be0  38 2b 32 29 0d 05 d2 05  20 0d 05 dc 14 dd f2 50  |8+2).... ......P|
00000bf0  4f 4b 45 28 58 25 2c 59  25 2c 58 24 29 0d 05 e6  |OKE(X%,Y%,X$)...|
00000c00  13 ef 33 31 2c 58 25 2c  59 25 2c 97 28 58 24 29  |..31,X%,Y%,.(X$)|
00000c10  0d 05 f0 05 e1 0d 06 04  17 dd f2 57 41 49 54 28  |...........WAIT(|
00000c20  54 29 3a ea 20 6f 6c 64  74 69 6d 65 0d 06 0e 0d  |T):. oldtime....|
00000c30  6f 6c 64 74 69 6d 65 3d  91 0d 06 18 17 f5 20 fd  |oldtime=...... .|
00000c40  20 91 2d 6f 6c 64 74 69  6d 65 3e 54 2a 31 30 30  | .-oldtime>T*100|
00000c50  0d 06 22 05 e1 0d 06 36  0d dd f2 43 4c 45 41 4e  |.."....6...CLEAN|
00000c60  55 50 0d 06 40 0c 2a 46  58 20 31 32 2c 30 0d 06  |UP..@.*FX 12,0..|
00000c70  4a 0a 2a 46 58 34 2c 30  0d 06 54 09 40 25 3d 31  |J.*FX4,0..T.@%=1|
00000c80  30 0d 06 5e 05 e1 0d ff                           |0..^....|
00000c88
SnakeV1.m0
SnakeV1.m1
SnakeV1.m2
SnakeV1.m4
SnakeV1.m5