'I've wanted to make this game for decades and finally am able to!
'This game was made on August 13, 2019 by Ken G.
'This is Freeware.
_TITLE "Tic-Tac-Toe by Ken G." PRINT " Play against the computer in this classic game of Tic-Tac-Toe." PRINT " Whoever gets 3 in a row wins." PRINT " Choose a sqace by using your mouse." PRINT " Press Space Bar to begin." st:
start:
t = 0
turn = 0
'Draw Grid
'Vertical Lines
LINE (220, 100)-(240, 410), _RGB32(255, 255, 255), BF
LINE (360, 100)-(380, 410), _RGB32(255, 255, 255), BF
'Horizontal Lines
LINE (90, 185)-(510, 205), _RGB32(255, 255, 255), BF
LINE (90, 305)-(510, 325), _RGB32(255, 255, 255), BF
Go:
mouseWheel = 0
checkwin:
'Check to see if you won.
turn = turn + 1
won:
a(tt) = 0
b(tt) = 0
t = 0
LOCATE 4, 27:
PRINT "Press the Space Bar to play again." again:
computer:
'Check to win.
'Last space gone.
'First space gone.
'Middle space gone.
'Check to block.
'Last space gone.
'First space gone.
'Middle space gone.
'Computer decides a random space.
computerchoice:
'Cat's Game
catsgame:
a(tt) = 0
b(tt) = 0
t = 0
LOCATE 4, 27:
PRINT "Press the Space Bar to play again." again2:
'Check to see if the computer won.
check:
turn = turn + 1
t = 0
compwon:
a(tt) = 0
b(tt) = 0
t = 0
LOCATE 4, 27:
PRINT "Press the Space Bar to play again." again3:
'This part draws the computer's circle.
compspace1:
t = 0
b(1) = 1
compspace2:
t = 0
b(2) = 1
compspace3:
t = 0
b(3) = 1
compspace4:
t = 0
b(4) = 1
compspace5:
t = 0
b(5) = 1
compspace6:
t = 0
b(6) = 1
compspace7:
t = 0
b(7) = 1
compspace8:
t = 0
b(8) = 1
compspace9:
t = 0
b(9) = 1
'This last part draws your X.
space1:
a(1) = 1
t = 1
space2:
a(2) = 1
t = 1
space3:
a(3) = 1
t = 1
space4:
a(4) = 1
t = 1
space5:
a(5) = 1
t = 1
space6:
a(6) = 1
t = 1
space7:
a(7) = 1
t = 1
space8:
a(8) = 1
t = 1
space9:
a(9) = 1
t = 1