Share your repls and programming experiences

← Back to all posts
CyanCoding (2192)

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

RobertThompson4 (12)

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

ebest (672)

code warningserrors sure can kill!

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


maxballard (8)

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.

CyanCoding (2192)

@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.

YuAndy (75)

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

SilvermoonCat (458)

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

EphrySanthosh (1)

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

codingduck (9)

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

AmazingMech2418 (1102)

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

NathanPp (9)

i beat impossible in 5 moves pog

NathanPp (9)

nobody upvote or downvote this ever again

MeetaGupta (0)

The impossible level can be beaten in three moves!!! can make It better.

FloCal35 (671)

I beat the impossible mode

FlaminHotValdez (715)

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)

DavidLi17 (14)

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

DavidLi17 (14)

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


cool game!


Nice job! Enjoyed playing.

Nanowrimoijk (64)

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

m_23s (0)


honchkrowabcd (6)

impossible isin't impossible

OwenBradstreet (130)

Proud :)

Spyder101 (7)

Holy cow great job! The code works smooth and he difficulties hold up their reputation...

zacdisbury (0)

well well well that's cool

FiveCubed (15)

Why do you have it look at every spot on the board to test for a win?

CyanCoding (2192)

@fivecubed: This way it can make sure you won, regardless of the win spots.