Skip to content
← Back to Community
Changing console text but for single variable
Profile icon
LCM7341

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?

Voters
Profile icon
MAYRA-ALEJANDR5
Profile icon
Jarrettjiaqi
Profile icon
J0tar0
Profile icon
LCM7341
Comments
hotnewtop
Profile icon
Michael8910

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.