TRON
   Tron is a simple game where you draw a line on a playing field.  The
   object of the game is to make the calc crash, but if you crash first you
   lose.  The arrow keys change you direction.  If you don't press any
   keys, you will continue going in the last direction.  When you start
   Tron, you can choose if there is static or not.  If you choose stacic,
   there are dots that must be avoided.  You start on a random position at
   top going down, and the calc starts at a random position at the bottom
   going up.

   Calculator's logic has been rewritten to hopefully speed up game play.

   ===
    Copyright 1995, Micheal Conrad Tilstra, Tadpol.
    All rights reserved.
    
    Redistribution and use in source and binary forms, with or without
    modification, are permitted provided that the following conditions
    are met:
    
    1. Redistributions of source code must retain the above copyright
       notice, this list of conditions, and the following disclaimer.
    
    2. Redistributions in binary form must reproduce the above copyright
       notice, this list of conditions, and the following disclaimer in the
       documentation and/or other materials provided with the distribution.
    
    3. The name of the author may not be used to endorse or promote products
       derived from this software without specific prior written permission.
    
    THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR
    IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
    PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
    DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
    (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
    LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
    AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
    TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
    OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.    
   ===

\START82\
\COMMENT=Tron 1.1.1 By Mike Tilstra
\NAME=TRON
\FILE=TRON.82p
PlotsOff 
FnOff :AxesOff
ClrDraw
Line(Xmin,Ymin,Xmin,Ymax)
Line(Xmin,Ymin,Xmax,Ymin)
Line(Xmax,Ymin,Xmax,Ymax)
Line(Xmin,Ymax,Xmax,Ymax)
Menu("TRON 1.1.1","CLEAR",X,"STATIC",Y)
Lbl Y
For(Z,1,20)
int 94rand+1\->\X
int 62rand+1\->\Y
Pxl-On(Y,X)
End
Lbl X
0\->\B:1\->\C:0\->\P
47\->\D:0\->\E
0\->\\@\:\(-)\1\->\Z
47\->\V:62\->\U
int 92rand+1\->\D
int 30rand+1\->\E
int 92rand+1\->\V
int 30rand+30\->\U
Lbl 1
getKey\->\K
If K=26
Then
1\->\B:0\->\C
End
If K=34
Then
1\->\C:0\->\B
End
If K=24
Then
\(-)\1\->\B:0\->\C
End
If K=25
Then
\(-)\1\->\C:0\->\B
End
If K=21
Pause 
D+B\->\D
E+C\->\E
pxl-Test(E,D)\->\F
If F=1
Then
Text(2,2,"YOU CRASHED")
Pause 
ClrDraw
ClrHome
Return
Stop
End

If P<30
P+1\->\P
If P=30
Then
int 2rand+1\->\\@\
If \@\=2
\(-)\1\->\\@\
0\->\Z
0\->\P
End

If pxl-Test(U,V+\@\)=1:Then
int 2rand+1\->\Z
If Z=2
\(-)\1\->\Z
0\->\\@\
If pxl-Test(U+Z,V)=1
\(-)\Z\->\Z
End
If pxl-Test(U+Z,V)=1:Then
int 2rand+1\->\\@\
If \@\=2
\(-)\1\->\\@\
0\->\Z
If pxl-Test(U,V+\@\)=1
\(-)\\@\\->\\@\
End

\@\+V\->\V
Z+U\->\U
pxl-Test(U,V)\->\F
If F=1
Then
Text(2,2,"CALC CRASHED")
Pause 
ClrDraw
ClrHome
Return
Stop
End
Pxl-On(U,V)
Pxl-On(E,D)
Goto 1
Stop
MIKE TILSTRA
\STOP82\
