Mine Field

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.

Like the classic game minesweeper, the goal of Mine Field is to avoid hitting the mines. A new twist has been added, however, and you must maneuver the field around the mines to get to the star (the asterisk) on the other side. The game uses a simple 8x16 matrix to store the field, although you could use a list or string as well. You can play this game indefinitely, since all of the mines are randomly placed.

Table of Contents

The Code

:ClrHome
:1→X:1→Y
:DelVar [B]{8,16→dim([B]
:6→[B](randInt(2,7),15
:6→[B](randInt(2,7),14
:For(A,1,8
:6→[B](A,randInt(2,15
:End
:1→[B](4,16
:Output(Y,X,">
:Output(4,16,"*
:Repeat [B](Y,X
:Repeat Ans
:getKey→G
:End
:Output(Y,X,"  // 1 space
:X-(G=24 and X>1)+(G=26 and X<16→X
:Y-(G=25 and Y>1)+(G=34 and Y<8→Y
:Output(Y,X,">
:End
:ClrHome
:"YOU "+sub("WIN!!LOSE!",[B](Y,X),5

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.