Light Cycles

If you remember the old movie, Tron, you might remember the premise of this game. You control a cycle (or in this case, a pixel) that moves in a direction until you change the direction. It leaves a path, and if you hit the path, or the wall, you lose. The trick here is that you must out last your opponent: an AI. This version of Light Cycles for the calculator utilizes a simple AI system that makes it kind of intelligent. Please try to understand the code and learn from it.

The Code

:Vertical Xmin
:Vertical Xmax
:Horizontal Ymin
:Horizontal Ymax
:Repeat G=45 or not(pxl-Test(A,B) and pxl-Test(C,D
:If Ans
:Ans+(Ans=2 and pxl-Test(C,D-1
:Ans+(Ans=3 and pxl-Test(C-1,D→F


Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-Noncommercial-No Derivative Works 2.5 License.