Share your repls and programming experiences

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

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!

Comments
hotnewtop
Glare (236)

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

DynamicSquid (4631)

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

Glare (236)

@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 (4631)

@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 (236)

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

DynamicSquid (4631)

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

Combustion (10)

ur logic is actually so good dude. teach me LOL

Glare (236)

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

HasheeshEater (2)

Me lonely playing this alone :(

Combustion (10)

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

Glare (236)

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

lightningrock (148)

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 (236)

@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 ;)

SEIGE (0)

this is good!

Glare (236)

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

Coder100 (17125)

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

Glare (236)

@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 :)