tictacto TI-83 Source Code - Skip Header

tictacto TI-83 Source Code

This is intended to be the human readable version of the source code for Tic-Tac-Toe. This version is intended to work only on the TI-83 Texas Instruments graphic calculator. Also available: Documentation about "Tic-Tac-Toe" and versions of the program for other calculators and in other formats.

Any line that begins with a backslash is a comment and should not be entered into the calculator. (Comments have been colored green) For an authoritative copy of this program's source code that can be imported to the calculator via a computer, consult the text version of Tic-Tac-Toe source code for the TI-83, along with the character reference. The special character reference also gives an overview of all non-ASCII characters for the calculator, and shows the menus in which they can be found.

\start83\
\comment=Copyright Stephen Ostermiller 1996-2001
\protected=FALSE
\name=TICTACTO
FnOff 
ZStandard
ZInteger
CoordOff
AxesOff
Vertical -28
Vertical -9
Line(-47,12,9,12
Line(-47,-7,9,-7
Text(57,12,"TIC TAC TOE"
Text(6,8,7
Text(6,27,8
Text(6,46,9
Text(25,8,4
Text(25,27,5
Text(25,46,6
Text(44,8,1
Text(44,27,2
Text(44,46,3
-1→A
0→O
0→P
0→Q
0→T
0→U
0→V
0→S
0→Z
0→Θ
Lbl 1
If A=1
Text(28,75,"O"
If A=-1
Text(28,75,"X"
Lbl 2
getKey→B
If B=72
Then
If O≠0
Goto 2
6→C
8→D
A→O
Goto 3
End
If B=73
Then
If P≠0
Goto 2
6→C
27→D
A→P
Goto 3
End
If B=74
Then
If Q≠0
Goto 2
6→C
46→D
A→Q
Goto 3
End
If B=82
Then
If T≠0
Goto 2
25→C
8→D
A→T
Goto 3
End
If B=83
Then
If U≠0
Goto 2
25→C
27→D
A→U
Goto 3
End
If B=84
Then
If V≠0
Goto 2
25→C
46→D
A→V
Goto 3
End
If B=92
Then
If S≠0
Goto 2
44→C
8→D
A→S
Goto 3
End
If B=93
Then
If Z≠0
Goto 2
44→C
27→D
A→Z
Goto 3
End
If B=94
Then
If Θ≠0
Goto 2
44→C
46→D
A→Θ
Goto 3
End
Goto 2
Lbl 3
If A=-1
Text(C,D,"X"
If A=1
Text(C,D,"O"
If abs(S+T+O)=3
Then
Line(-38,22,-38,-16
Goto 4
End
If abs(Z+U+P)=3
Then
Line(-19,22,-19,-16
Goto 4
End
If abs(Θ+V+Q)=3
Then
Line(0,22,0,-16
Goto 4
End
If abs(O+U+Θ)=3
Then
Line(-38,22,0,-16
Goto 4
End
If abs(S+U+Q)=3
Then
Line(-38,-16,0,22
Goto 4
End
If abs(O+P+Q)=3
Then
Line(-38,22,0,22
Goto 4
End
If abs(T+U+V)=3
Then
Line(-38,3,0,3
Goto 4
End
If abs(S+Z+Θ)=3
Then
Line(-38,-16,0,-16
Text(34,69,"WINS"
Goto 4
End
If SZΘTUVOPQ≠0
Then
Text(28,69,"CATS"
Text(34,68,"GAME"
Goto 5
End
-A→A
Goto 1
Lbl 4
Text(34,69,"WINS"
Lbl 5
Text(16,68,"GAME"
Text(22,69,"OVER"
Pause 
CoordOn
AxesOn
ZStandard
Disp 
\stop83\