I made a tic tac toe game for the Puzzle Compo a few years ago. Since the board is deleted, I guess I'll upload a new zip of it with source, I'll warn you though, the source is messy.
Here is the source for the hardest computer that I programmed.
if turn#=2
if playsound#=0 then wait 2000
if playsound#=0 then stop sound 1
if playsound#=0 then play sound 2
text 540,310,"It Is My Turn."
paste image 12,540,370,transparent
wait 500
went#=0
move#=0
rem move# goes from 1 to 3 so.... Yah...
rem see if I'm about to win
if move#=0
if a#+b#=12 and c#=0 and went#=0
inc xnum#,1
sprite xnum#,70,228,12
c#=6
went#=1
went#=went+1
turn#=4
endif
if b#+c#=12 and a#=0 and went#=0
inc xnum#,1
sprite xnum#,70,30,12
a#=6
went#=4
went#=went+1
turn#=1
endif
if a#+c#=12 and b#=0 and went#=0
inc xnum#,1
sprite xnum#,70,130,12
b#=6
went#=4
went#=went+1
turn#=1
endif
if a#+d#=12 and g#=0 and went#=0
inc xnum#,1
sprite xnum#,350,30,12
g#=6
went#=1
went#=went+1
turn#=1
endif
if g#+d#=12 and a#=0 and went#=0
inc xnum#,1
sprite xnum#,70,30,12
a#=6
went#=1
went#=went+1
turn#=4
endif
if a#+g#=12 and d#=0 and went#=0
inc xnum#,1
sprite xnum#,200,30,12
d#=6
went#=1
went#=went+1
turn#=4
endif
if a#+e#=12 and i#=0 and went#=0
inc xnum#,1
sprite xnum#,350,238,12
i#=6
went#=1
went#=went+1
turn#=4
endif
if e#+i#=12 and a#=0 and went#=0
inc xnum#,1
sprite xnum#,70,30,12
a#=6
went#=1
went#=went+1
turn#=4
endif
if a#+i#=12 and e#=0 and went#=0
inc xnum#,1
sprite xnum#,200,130,12
e#=6
timer#=500
turn#=4
endif
if d#+e#=12 and f#=0 and went#=0
inc xnum#,1
sprite xnum#,200,238,12
f#=6
went#=1
went#=went+1
turn#=4
endif
if e#+f#=12 and d#=0 and went#=0
inc xnum#,1
sprite xnum#,200,30,12
d#=6
went#=1
went#=went+1
turn#=1
endif
if d#+f#=12 and e#=0 and went#=0
inc xnum#,1
sprite xnum#,200,130,12
e#=6
went#=1
went#=went+1
turn#=4
endif
if g#+h#=12 and i#=0 and went#=0
inc xnum#,1
sprite xnum#,350,238,12
i#=6
went#=1
turn#=4
endif
if h#+i#=12 and g#=0 and went#=0
inc xnum#,1
sprite xnum#,350,30,12
g#=6
went#=1
turn#=4
endif
if g#+i#=12 and h#=0 and went#=0
inc xnum#,1
sprite xnum#,350,130,12
h#=6
went#=1
went#=went+1
turn#=4
endif
if b#+e#=12 and h#=0 and went#=0
inc xnum#,1
sprite xnum#,350,130,12
h#=6
went#=1
went#=went+1
turn#=4
endif
if e#+h#=12 and b#=0 and went#=0
inc xnum#,1
sprite xnum#,70,130,12
b#=6
went#=1
went#=went+1
turn#=4
endif
if b#+h#=12 and e#=0 and went#=0
inc xnum#,1
sprite xnum#,200,130,12
e#=6
went#=1
went#=went+1
turn#=4
endif
if c#+f#=12 and i#=0 and went#=0
inc xnum#,1
sprite xnum#,350,238,12
i#=6
went#=1
went#=went+1
turn#=4
endif
if f#+i#=12 and c#=0 and went#=0
inc xnum#,1
sprite xnum#,70,228,12
c#=6
went#=1
went#=went+1
turn#=4
endif
if c#+i#=12 and f#=0 and went#=0
inc xnum#,1
sprite xnum#,200,238,12
f#=6
went#=1
went#=went+1
turn#=4
endif
if c#+e#=12 and g#=0 and went#=0
inc xnum#,1
sprite xnum#,350,30,12
g#=6
went#=1
went#=went+1
turn#=4
endif
if g#+e#=12 and c#=0 and went#=0
inc xnum#,1
sprite xnum#,70,228,12
c#=6
went#=1
went#=went+1
turn#=4
endif
if c#+g#=12 and e#=0 and went#=0
inc xnum#,1
sprite xnum#,200,130,12
e#=6
went#=1
went#=went+1
turn#=4
endif
if a#+e#=12 and i#=0 and went#=0
inc xnum#,1
sprite xnum#,350,238,12
i#=6
went#=1
went#=went+1
turn#=4
endif
if i#+e#=12 and a#=0 and went#=0
inc xnum#,1
sprite xnum#,70,30,12
a#=6
went#=1
went#=went+1
turn#=4
endif
if a#+i#=12 and e#=0 and went#=0
inc xnum#,1
sprite xnum#,200,130,12
e#=6
went#=1
went#=went+1
turn#=4
endif
wait 100
move#=1
endif
rem see if p1 is about to win.
if move#=1
if a#+b#=2 and c#=0 and went#=0
inc xnum#,1
sprite xnum#,70,228,12
c#=6
went#=1
turn#=4
endif
if b#+c#=2 and a#=0 and went#=0
inc xnum#,1
sprite xnum#,70,30,12
a#=6
went#=1
turn#=4
endif
if a#+c#=2 and b#=0 and went#=0
inc xnum#,1
sprite xnum#,70,130,12
b#=6
went#=1
turn#=4
endif
if a#+d#=2 and g#=0 and went#=0
inc xnum#,1
sprite xnum#,350,30,12
g#=6
went#=1
turn#=4
endif
if g#+d#=2 and a#=0 and went#=0
inc xnum#,1
sprite xnum#,70,30,12
a#=6
went#=1
turn#=4
endif
if a#+g#=2 and d#=0 and went#=0
inc xnum#,1
sprite xnum#,200,30,12
d#=6
went#=1
turn#=4
endif
if a#+e#=2 and i#=0 and went#=0
inc xnum#,1
sprite xnum#,350,238,12
i#=6
went#=1
turn#=4
endif
if e#+i#=2 and a#=0 and went#=0
inc xnum#,1
sprite xnum#,70,30,12
a#=6
went#=1
turn#=4
endif
if a#+i#=2 and e#=0 and went#=0
endif
if d#+e#=2 and f#=0 and went#=0
inc xnum#,1
sprite xnum#,200,238,12
f#=6
went#=1
turn#=4
endif
if e#+f#=2 and d#=0 and went#=0
inc xnum#,1
sprite xnum#,200,30,12
d#=6
went#=1
turn#=4
endif
if d#+f#=2 and e#=0 and went#=0
inc xnum#,1
sprite xnum#,200,130,12
e#=6
went#=1
turn#=4
endif
if g#+h#=2 and i#=0 and went#=0
inc xnum#,1
sprite xnum#,350,238,12
i#=6
went#=1
turn#=4
endif
if h#+i#=2 and g#=0 and went#=0
inc xnum#,1
sprite xnum#,350,30,12
g#=6
went#=1
turn#=4
endif
if g#+i#=2 and h#=0 and went#=0
inc xnum#,1
sprite xnum#,350,130,12
h#=6
went#=1
turn#=4
endif
if b#+e#=2 and h#=0 and went#=0
inc xnum#,1
sprite xnum#,350,130,12
h#=6
went#=1
turn#=4
endif
if e#+h#=2 and b#=0 and went#=0
inc xnum#,1
sprite xnum#,70,130,12
b#=6
went#=1
turn#=4
endif
if b#+h#=2 and e#=0 and went#=0
inc xnum#,1
sprite xnum#,200,130,12
e#=6
went#=1
turn#=4
endif
if c#+f#=2 and i#=0 and went#=0
inc xnum#,1
sprite xnum#,350,238,12
i#=6
went#=1
turn#=4
endif
if f#+i#=2 and c#=0 and went#=0
inc xnum#,1
sprite xnum#,70,228,12
c#=6
went#=1
turn#=4
endif
if c#+i#=2 and f#=0 and went#=0
inc xnum#,1
sprite xnum#,200,238,12
f#=6
went#=1
turn#=4
endif
if c#+e#=2 and g#=0 and went#=0
inc xnum#,1
sprite xnum#,350,30,12
g#=6
went#=1
turn#=4
endif
if g#+e#=2 and c#=0 and went#=0
inc xnum#,1
sprite xnum#,70,228,12
c#=6
went#=1
turn#=4
endif
if c#+g#=2 and e#=0 and went#=0
inc xnum#,1
sprite xnum#,200,130,12
e#=6
went#=1
turn#=4
endif
if a#+e#=2 and i#=0 and went#=0
inc xnum#,1
sprite xnum#,350,238,12
i#=6
went#=1
turn#=4
endif
if i#+e#=2 and a#=0 and went#=0
inc xnum#,1
sprite xnum#,70,30,12
a#=6
went#=1
turn#=4
endif
if a#+i#=2 and e#=0 and went#=0
inc xnum#,1
sprite xnum#,200,130,12
e#=6
went#=1
turn#=4
endif
move#=3
endif
if move#=3
rem logical movement
rem if x goes to corner go to center
if a#=1 and e#=0 and went#=0
inc xnum#,1
sprite xnum#,200,130,12
e#=6
went#=1
turn#=4
endif
if g#=1 and e#=0 and went#=0
inc xnum#,1
sprite xnum#,200,130,12
e#=6
went#=1
turn#=4
endif
if c#=1 and e#=0 and went#=0
inc xnum#,1
sprite xnum#,200,130,12
e#=6
went#=1
turn#=4
endif
if i#=1 and e#=0 and went#=0
inc xnum#,1
sprite xnum#,200,130,12
e#=6
went#=1
turn#=4
endif
if a#=1 and i#=1 and e#=6
pc#=rnd(9)
ran#=1
goto random
endif
if g#=1 and c#=1 and e#=6
pc#=rnd(9)
ran#=1
goto random
endif
move#=4
endif
rem logical thinking part 2
rem if x goes to center go to edge
if move#=4
if e#=1 and a#=0 and went#=0
inc xnum#,1
sprite xnum#,70,30,12
a#=6
went#=1
turn#=4
endif
if e#=1 and c#=0 and went#=0
inc xnum#,1
sprite xnum#,70,228,12
c#=6
went#=1
turn#=4
endif
if e#=1 and g#=0 and went#=0
inc xnum#,1
sprite xnum#,350,30,12
g#=6
went#=1
turn#=4
endif
if e#=1 and i#=0 and went#=0
inc xnum#,1
sprite xnum#,350,238,12
i#=6
went#=1
turn#=4
endif
move#=5
endif
rem step two of if x goes to outside
if move#=5
if a#=1 and c#=1 and e#=6 and b#=6 and d#=0 and went#=0
inc xnum#,1
sprite xnum#,200,30,12
d#=6
went#=1
turn#=4
endif
if a#=1 and g#=1 and e#=6 and d#=6 and b#=0 and went#=0
inc xnum#,1
sprite xnum#,70,130,12
b#=6
went#=1
turn#=4
endif
if g#=1 and i#=1 and h#=6 and e#=6 and f#=0 and went#=0
inc xnum#,1
sprite xnum#,200,238,12
f#=6
went#=1
turn#=4
endif
if i#=1 and c#=1 and e#=6 and f#=6 and b#=0 and went#=0
inc xnum#,1
sprite xnum#,70,130,12
b#=6
went#=1
turn#=4
endif
move#=6
endif
rem if player goes in b#,d#,h#,f#
if move#=6
if b#=1 and went#=0
pc#=rnd(9)
ran#=1
goto random
endif
if d#=1 and went#=0
pc#=rnd(9)
ran#=1
goto random
endif
if h#=1 and went#=0
pc#=rnd(9)
ran#=1
goto random
endif
if f#=1 and went#=0
pc#=rnd(9)
ran#=1
goto random
endif
move#=7
endif
rem Random Movement, if needed. I think not though. Maybe?
rem Also if the player goes into b# or d# or h# or f#
if move#=7
PC#=RND(9)
endif
rem if player 1 goes to the little middle thingS
goto winningcheck3
endif
Warning though: This code is very messy and is not meant for running with max FPS. I was in my unknowledgeable stage
Take heed, never take advantage of the things you need, never let your self be overcome by greed. Walk a strigh line, pick up your speed and try. Everyone deserves a piece of the pie By: Shaggy