TI-BASIC:Demented Snake

From Learn @ Cemetech
Revision as of 19:36, 24 February 2016 by Maintenance script (talk | contribs) (Automated internal link correction)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

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.

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.