If you have ever played any of the snake, mofrog, nibbles, etc. games, then this game should be familiar to you. The basic premise is to go around eating food and the snake grows longer with each piece of food. Like with the other games, try out the game and try to understand and think through the code.

The Code

:Repeat C=Ans(1
:Output(10fPart(B),int(B),"   // 1 space
:If Ans=45
:Goto 0
:If Ans=34 or 2>abs(Ans-25
:If max(LA=Ans
:Goto 0
:Lbl 0

The Download

In case you want to try the program on your calculator, you can download the program in .8xp format.

Other Versions

Snake is a rather popular game to code since it showcases many features of the TI-BASIC language and provokes algorithmic thinking. Below are some other snake clones that you can study and compare to observe the classic tradeoffs in speed, memory efficiency, features, and aesthetics.

  • XSnake by XprO — Optimized for pure speed
  • Nibbles by Edward H — Requires no auxiliary lists, and hence memory efficient
  • Nibbles Arcade by SiCoDe — Feature-heavy with snake variations and an AI


Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License