How do you do this without using list variables? Do you use a matrix to show the whole world?

Great, graphics, by the way.

I added a start length option (min 0), amount to grow per nibble option, obstacles (need help here, if they form where your snake starts you get an error, so it isn't really possible to do more than about ten), and a nibble goal. This was already there, but it was fixed at 94. It also times how long you played and has a stats screen at the end. If you want is to play like the original, set start length 5, grow amount 3, nibble goal 94, and obstacles 0. Optimize away if you wish; it is considerably larger than the old one. I do want to emphasize that I take no credit for this program.

```
DEC
Lbl A
ClrDraw
Menu(" NIBBLES ","PLAY",θ,"QUIT",θθ
Lbl θ
ClrHome
Input "START LENGTH:",S
S→L
Input "GROW AMOUNT:",Z
Input "NIBBLE GOAL:",R
S→X
Input "OBSTACLES:",θ
0→W
ClrDraw
startTmr→P
AxesOff:FnOff
ZStandard
104→Xmax
72→Ymin
ZInteger
Line(94,0,94,61
Line(0,0,0,61
Horizontal 0
Horizontal 61
If θ=0:Then
0→W
Goto 60
End
If X=0:Then
0→S
End
Repeat W=θ or θ=1
Text(randInt(2,60),randInt(2,93),"⁺
W+1→W
End
If S=0:Then
X→S
End
Lbl 60
41→A:Ans→E
29→B:Ans→F
1→H:0→V
1→θ
Pt-On(41,29,2
Repeat not(pxl-Test(N-1,M-1
2+3int(31rand→M
2+3int(20rand→N
End
Pt-On(M,N,2
Pt-Off(M,N,3
Pxl-On(N,M
Repeat 0
getKey→K
If Ans:Then
If H:Then
(Ans=34)-(Ans=25→V
If Ans
0→H
Else
(Ans=26)-(Ans=24→H
If Ans
0→V
End
End
If H:Then
A+3H→A
If pxl-Test(B,Ans-H)
Then
Lbl H
startTmr→O
O-P→Q
ClrHome
Output(1,1,"****************"
Output(2,5,"GOAL:"
Output(2,10,R
Output(3,3,"OBSTACLES:
Output(3,13,W
Output(4,4,"NIBBLES:"
Output(4,12,θ
Output(5,2,"COMPLETION:"
Output(5,13,θ/R*100
Output(6,1," TIME:"
Output(6,10,Q
Output(7,3,"MAX LENGTH:
Output(7,14,X
Output(8,1,"^V^V^V^V^V^V^V^≥"
Pause
Goto A
End
If K=105
Pause
Pt-On(Ans,B,2
Pxl-Off(B,Ans-H
Pxl-Off(B,Ans-2H
Else
B+3V→B
If pxl-Test(Ans-V,A:Then
Goto H
End
Pt-On(A,Ans,2
Pxl-Off(Ans-V,A
Pxl-Off(Ans-2V,A
End
If pxl-Test(B,A
Then
Pxl-Off(B,A
Repeat not(pxl-Test(N-1,M-1
2+3int(31rand→M
2+3int(20rand→N
End
Pt-On(M,N,2
Pt-Off(M,N,3
Pxl-On(N,M
If θ=R:Then
Goto H
End
Line(0,62,(θ/R)*94,62)
1+θ→θ
S+Z→S
X+Z→X
End
If S:Then
S-1→S:Else
pxl-Test(F,E-1)-pxl-Test(F,E+1
If Ans:Then
Pxl-On(F,E+2Ans
Pt-Off(E,F,2
E+3Ans→E
Else
1-2pxl-Test(F+1,E
Pxl-On(F+2Ans,E
Pt-Off(E,F,2
F+3Ans→F
End
End
End
Lbl θθ
ClrDraw
ZStandard
AxesOn
AUTO
ClrHome
Stop
```

W starts at 0 and theta is user input before this section of code.

```
Input "OBSTACLES:",θ
0→W
.
.
.
Repeat W=θ or θ=1
Text(randInt(2,60),randInt(2,93),"⁺
W+1→W
End
```

This can be simplified to:

```
For(W,1,θ
Text(randInt(2,60),randInt(2,93),"⁺
End
```

```
If H:Then
A+3H→A
End
```

```
If X=0:Then
0→S
End
```

```
If θ=R:Then
Goto H
End
```

and anywhere else you have:

```
If true:Then
Action
End
```

can be simplified to:

`If true: Action`

This only works if it is one line of action code

```
If θ=0:Then
0→W
Goto 60
End
```

Fix a memory leak:

```
If not(θ:0→W
If not(θ:Goto 60
```

Anywhere you have:

```
If X=0
If A=0
etc.
```

can save a byte by doing:

```
If not(X
If not(a
etc.
```

Thank you. However, I will probably keep the

```
If true:Then
Action
End
```

Instead of

`If true: Action`

Because If:Then statements run faster than Plain If statements.

Single-line `If` is actually slower than If/Then/End only in very specific conditions:

- The
`If`is the the first line in a`For(`statement which is run frequently - The closing parenthesis on the
`For(`is omitted - The
`If`condition is false a significant proportion of the time.

Most of the time, it's better to use single-line `If` when you can.