Hello TI community. Although I made this game a long time ago, I feeled that I wanted to fully complete it, which I haven't had the time for because of school. Now I have vacation though, therefore I will post it. Also, I probably won't be doing more work with TI for a while, since I decided to start learning some Java (if you know this language and feel to help, feel free to contact me). I'm disappointed that I didn't get to come so far with TI-Basic, but I think it gives a decent base for further programming.

Anyway, here's the game I'm looking for advice on optimization, please don't be too hard on me since it was my first game. **Notice that I didn't use Ans yet, since I might have to change the order of things**. If you can't be arsed to read the whole thing, you can look at smaller parts.

```
4→Y:8→X // Snake's "head" coordinates
0→C:1→D //Direction to move on Y, X axis.
9→B:6→A // Coordinates of "fruit" for score
1→M //Variable for the snake coordinate list
Output(A,B,","
SetUpEditor LX //Snake coordinate lists
SetUpeDitor LY
3→dim(LY):3→dim(LX)
{4,4,4→LY
{6,7,8→LX
ClrHome
Output(4,7,".
Output(4,8,".
Repeat Y>=8 or Y<=1 or X>=16 or 1>=X or sum(2=((X=LX)+(Y=LY)))=2
For U,1,E //E is prechosen variable for delay (difficulty)
End
getKey→K
If K≠0:Then
(K≠24)(K≠26)C+(C=0)sum(DeltaList(K={25,34}))→C
(K≠25)(K≠34)D+(D=0)sum(DeltaList(K={24,26}))→D
End
Y+C→Y:X+D→X
Output(LY(M),LX(M)," ")
Output(Y,X,".")
X→LX(M):Y→LY(M)
M+1→M
If B=X and A=Y:Then
Output(A,B,".
randInt(2,7)→A
randInt(2,15)→B
1+dim(LY)→dim(LY)
1+dim(LX)→dim(LX)
End
Output(A,B,","
If M=dim(LX)+1:1→M
End
```

Thanks for your time! Attaching image with comments to understand it easier: