TI-BASIC Wiki
Advertisement

Mine Field was a game that I came up with a while ago. You have to maneuver the field around mines to get to the star. This also shows of some great technologies, such as matrix variable storing, the entire program runs on about 4 variables (excluding matrices and a custom list)

Code[]

Program:MINES
:ClrHome
:1X
: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
:Output(Y,X,">
:Output(4,16,"*
:1→[B](4,16
:Repeat [B](Y,X
:Repeat Ans
:getKey→G
:End
:Output(Y,X," "
: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
Advertisement