Maze Walkthrough

We're glad you came by, but you might find what you're looking for elsewhere.

TI-Basic Developer is not the site it once was. While its information on commands and other calculator features remains almost second-to-none, its forum, archives, and even hosting service, Wikidot, have been decaying for years. The calculator community would love to see what you're working on, or help you in your next coding adventure, but TI-Basic Developer is no longer the place to do it.

Instead, you should head over to Cemetech (primarily American) or TI-Planet (primarily international). Both are active, well-established forums with their own archives, chatrooms, reference material, and abundant coding tools and resources. We'll see you there, we hope.

The basic premise behind Maze Walkthrough is you have to make your way through the maze without touching any of the walls. This game is rather simple at its core, but it does feature a randomly generated maze each time, so it can be played indefinitely. It also is extremely compact, a good example of what you can do in a small number of bytes.

Table of Contents

The Code

:ClrHome
:ClrDraw
:AxesOff
:ZStandard
:Vertical Xmin
:Horizontal Xmin
:Horizontal Xmax
:For(X,‾9,10
:randInt(‾8,8
:Line(X,Xmax,X,Ans
:Line(X,Xmin,X,Ans-2
:End
:3→X:3→Y:E3→S
:Repeat K=45 or X=94 or pxl-Test(Y,X
:Pxl-On(Y,X
:Repeat Ans
:getKey→K
:End
:Pxl-Off(Y,X
:S-1→S
:X+(K=26)-(K=24→X
:Y+(K=34)-(K=25→Y
:End
:ClrDraw
:Text(15,15,"You "+sub("Lose!Win! ",1+5(X=94),5
:Text(22,15,"Score: ",S
:Pause
:ClrDraw
:ClrHome:"

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 2.5 License.