Ask coding questions

← Back to all posts
Changing console text but for single variable
LCM7341 (3)

So this is a little specific, but for my tic tac toe game i wanted to make the winning move go red. pretty simple. thing is, i want to change the printed board to show the full winning move without having a ton of if statements all over the place. soo is that possible? having variables have different text color when output?

MikeJMS8910 (234)

Hello there. I do not know the syntax for C++ but the easiest way for you to do this would probably just have one of those statements inside of a for loop. If you are looking for custom positions each time you can maybe just have an x and y value that changes once the loop is done for it to check that next.