Skip to content
← Back to Community
Tic-Tac-Toe
Profile icon
CyanCoding

https://repl.it/@CyanCoding/Tic-Tac-Toe

As a fun side project, I built this awesome Tic-Tac-Toe game (with three AI levels) in May 2017.

Voters
Profile icon
HeathCaponera
Profile icon
maxcheese
Profile icon
DaCuteRaccoon
Profile icon
HenryyAlderr
Profile icon
MPoelsma
Profile icon
sojs
Profile icon
Itsmeme25
Profile icon
Joodsn
Profile icon
elcorreodeangel
Profile icon
iissmart
Comments
hotnewtop
Profile icon
RobertThompson4

If you do 7 then 8 then 9, you will win 95% of the time.

Profile icon
ebest

code warningserrors sure can kill!

and HOW did this get the 5th most votes in ALL the posts!?!?!?

-Ebest

Profile icon
maxballard

It works and all, but no tic tac toe program like this should be 2000 lines long. You can put a lot of the stuff you have into specific functions. You repeat yourself many times, and basically just hardcoded the game. This will work for a simple game like tic tac toe, but if you wanna progress farther as a programmer you need to actually learn how to program.

Profile icon
CyanCoding

@maxballard Haha, thanks for the tip. Do note though that I made this over a year and a half ago, and it's not even in the same language I use now. But yes, I have gotten over that bad habit.

Profile icon
Mello742

i beat impossible mode in 4 moves hahaha!!

Profile icon
TerrorbuildLuna

@Mello742 me too

Profile icon
applesX
Profile icon
E-Sheep

I beat the impossible level in 4 moves!!!!!!
Hahahahahahahahahahahahahaha!!!!!!!!!

Profile icon
DavidLi17

@YuAndy I did it in 3 moves!!!!!!!!!!!!!!!!!!!!

Profile icon
TonyWu4
Profile icon
SilvermoonCat

hmm I beat impossible in 3 moves, easier than normal mode

Profile icon
EphrySanthosh

I hacked the program by pressing x after telling it to play and telling the difficulty
hacked

Profile icon
codingduck

image
ummmmmm wut:| also scroll bar all that...

Profile icon
DavidLi17

@codingduck We like ducks. We can be friends!

Profile icon
DavidLi17
Profile icon
AmazingMech2418

image
Impossible mode seems to have lost its right for its name... It was actually very easy to beat...

Profile icon
applesX
Profile icon
RageMonster2010

I actually typed play in the comments smh

Profile icon
RageMonster2010

Pvp

Profile icon
RageMonster2010

Play

Profile icon
RageMonster2010

Play

Profile icon
johnnyfrancis

....
646 warnings generated.
 ./main
Uhh

Profile icon
Peaseboy2234

97ACA84E-1827-4FA5-8B23-4F2A52C877F6

Profile icon
NathanPp

i beat impossible in 5 moves pog

Profile icon
NathanPp

nobody upvote or downvote this ever again

Profile icon
zakdakidd

I like it

Profile icon
IsaacAlexander2

How do you start playing?

Profile icon
AaronMa4

@IsaacAlexander2 u just type in play

Profile icon
IsaacAlexander2

@AaronMa4 Thanks

Profile icon
MeetaGupta

Screenshot 2020-09-21 at 1.08.54 PM
The impossible level can be beaten in three moves!!! can make It better.

Profile icon
FloCal35

I beat the impossible mode

Profile icon
FlaminHotValdez

I was a bit surprised when a tic tac toe program took 2600+ lines of code, no tic tac toe should be that long. Also it generated 646 lines of code, and "Impossible" isn't really impossible(It's beatable in 3 moves)

Profile icon
DavidLi17

I beat the impossible level in 3 moves!!!!!!
Hahahahahahahahahahahahahaha!!!!!!!!!

Profile icon
DavidLi17

I beat the impossible level in 3 moves!
HHHHHHHHHHHHHHHHAAAAAAAAAAAAAAAAAAAAAAAHHHHHHHHHHHHHHHHHHHAAAAAAAAAAAAAAAAHHHHHHHHHHHHHHHHHHHHHHAAAAAAAAAAAAAAAAA!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
and beat it on first try!

Profile icon
[deleted]

cool game!

Profile icon
[deleted]

Nice job! Enjoyed playing.

Profile icon
Nanowrimoijk

beat impossible, thats what comes when you play against yourself =(

Profile icon
m_23s

DEAD

Profile icon
m_23s

SHUT UP MAN WHAT U GONNA DO BRUV/ I FIND YOU

Profile icon
honchkrowabcd

impossible isin't impossible