Skip to content
← Back to Community
Text Based Tic-Tac-Toe
Profile icon
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
Profile icon
TheOceanFace
Profile icon
adsarebbbad
Profile icon
arnavratna
Profile icon
MichelleArabian
Profile icon
Gr8est
Profile icon
Garvicator
Profile icon
JasonLiu19
Profile icon
Fire-Wizard
Profile icon
1941012720
Profile icon
DynamicSquid
Comments
hotnewtop
Profile icon
Coder100

Wow! Nice!

Profile icon
Glare

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

Profile icon
DynamicSquid

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

Profile icon
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?

Profile icon
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

Profile icon
Glare

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

Profile icon
Summit

hmph i like endl @DynamicSquid

Profile icon
DynamicSquid

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

Profile icon
Combustion

ur logic is actually so good dude. teach me LOL

Profile icon
Glare

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

Profile icon
HasheeshEater

Me lonely playing this alone :(

Profile icon
Combustion

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

Profile icon
Glare

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

Profile icon
lightningrock

I know this is a bit late, but um... here's a bug:
image
Basically, if you just spam the keys and the enter button, it will just keep printing that even after you stop.

Profile icon
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 ;)

Profile icon
lightningrock

oh ok @Glare

Profile icon
SEIGE

this is good!

Profile icon
Glare

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

Profile icon
SEIGE

@Glare np ;)

Profile icon
Coder100

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

Profile icon
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 :)