I received my TI-82 STATS programmable calculator (which is in fact more of a TI-83) about two days ago - and wanted to program a Snake game with the builtin TI-BASIC language.
Although I had to find out: TI-BASIC is extremely slow. My first implementation was so slow, that it wasn t even a challenge for the player! The main bottleneck for me lies in the management of the list (array) containing the coordinates of the snake body.
I have tried two things:
- When the snake moves, update head position, then loop through the array from the tail position, and set
myList[ N ]
tomyList[ N - 1 ]
, in order to make the snake appear to be moving.
This however, gets unplayable after the list gets about 4 parts long. (too slow)
- Then, I tried implementing some sort of queue/deque using TI-BASIC s list manipulation features, like popping off the end and adding something at the front of the array.
This worked a bit better, but also gets too slow over time.
TL;DR / actual question:
- Do you know a trick so the game doesn t slow down with the snake getting longer? I have seen that this is possible in other games made in TI-BASIC