PicOXO

Made in 557 chars of Pico-8 for the TweetTweetJam 4.

Tic-tac-toe. You know the rules. Try to align 3 blue squares or prevent the computer to align its red squares.

Use right arrow to move, X to play. Press ENTER and "Reset cart" to restart.

Made as a personal challenge after wondering for some time: "Would it be possible to make a human vs CPU Tic-Tac-Toe in 560 chars or less?". That's what happens after watching Wargames too much.

Here's the complete code, just copy & paste in Pico-8 to get the whole game:

function u(n,i)e=n%8*2sset(q[e],q[e+1],i or 8)end
q={6,1,6,2,6,2,7,2,8,1,8,0,8,0,7}l=1palt(0,sset(1,7,8)==1)p=0::_::i=0o=p cls(1)if btnp(5)then
i=12k=0
if(l==7)_=p==w%8 and v or w
if l==9then
_=v
if(p==v%8)_=p+2k=7v=_+4w=s+4
end
if l==3then
a=(_+p)%4-2k=7z=_+a*2w=z+4v=_+a
s=p
if(abs(r-p)>2)r+=8
if(p%2<1)k=9z=(r+p)/2v=z+4
_=z
end
if l==5then
_=v
if(p==v%8)_=w k=7v=p-2w=p+3
end
if l<2then
k=5v=p+3w=p-3_=p-1
if(p%2<1)k=3_=p+4r=p
end
u(_)l=k end
sspr(0,6,3,3,9,9,99,99)u(o,i)
if(btnp(1))p+=1
while(sget(q[p%8*2],q[p%8*2+1])>0)p+=1
p%=8u(p,l%2*7)flip()goto _

Leave a comment

Log in with itch.io to leave a comment.