Demented Snake

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. However, this snake game has an additional element to it: you need to constantly change directions to keep the snake moving fast. Like with the other games, try out the game and try to understand and think through the code.

Table of Contents

The Code

:Repeat max(S≠L1 and Ans≠L2
:Repeat T=Ans and S=L1(I
:If Ans=45:Goto Q
:If Ans=34 or 2>abs(Ans-25:Ans→K
:Output(L1(Ans),L2(Ans),"  // 1 space
:Lbl Q

The Download

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


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