Share your repls and programming experiences

← Back to all posts
Text Based Tic-Tac-Toe
Glare

Hello everyone. It's been a while since I last posted. I just wanted to share this text-based Tic-Tac-Toe game that I made. It checks for ties, can be played multiple times, and keeps score. I hope you guys enjoy and thanks for checking this out!

Voters
TheOceanFace
adsarebbbad
arnavratna
MichelleArabian
Gr8est
Garvicator
JasonLiu19
Fire-Wizard
1941012720
DynamicSquid
Comments
hotnewtop
Coder100

Wow! Nice!

Glare

@Coder100 Thanks for playing! Glad you like it :)

DynamicSquid

Cool! Some tips though: don't use using namespace std, and use '\n' instead of endl

Glare

@DynamicSquid Thanks for the tips. I see so many using std:: instead of using namespace std;. Why would you not use the second option and avoid writing std:: all the time. Is it just to save 1 line of code?

DynamicSquid

@Glare What if you have a variable called cout? Or maybe a function called pow? It may seems rare, but it's good practice, especially when working with other libraries

Glare

@DynamicSquid That's true. I haven't really made a program with the name cout, but good point though.

Summit

hmph i like endl @DynamicSquid

DynamicSquid

@Summit its slow. Its adds a newline, and flushes the console which is unnecessary most of the time

Combustion

ur logic is actually so good dude. teach me LOL

Glare

@Combustion I'm glad you like it! I'll be making a tutorial soon :)

HasheeshEater

Me lonely playing this alone :(

Combustion

@HasheeshEater if he made it an AI that would be so sick fr

Glare

@Combustion I think that's the next step. Just have to learn some algorithms first.

lightningrock

I know this is a bit late, but um... here's a bug:

Basically, if you just spam the keys and the enter button, it will just keep printing that even after you stop.

Glare

@lightningrock Well of course, you're probably putting char types instead of an int. This is a very basic program it won't expect you to do this. I'll manage this when I make the AI version though ;)

lightningrock

oh ok @Glare

SEIGE

this is good!

Glare

@SEIGE Thank you! Thank for checking it out :)

SEIGE

@Glare np ;)

Coder100

Why do all functions have a void argument? This isn't C btw ;)

Glare

@Coder100 You're right. I was actually doing this to teach my friend. He codes in C so he kept telling to put it so I just did lol. I removed them now though :)