A particular character on the screen
I have a program with lots of random letters in it, and it is constantly changing them.
How might I make a particular character on the screen one color, and then as the row scrolls up, the new character that was there is the same color?
This is for a console program with Microsoft VC++ 6.0
So if my screen started as
AZYFAYDUFY
DIOWrYEOR
FDOIYEWRO
DOYIDOIGE
when it changed to
DIOWRYEOR
FDOIyEWRO
DOYIDOIGE
AIEYARONA
because it scrolled up, how would I make that one lowercase letter always one color?
Code:
HANDLE stdOut = GetSTDHandle(STD_OUTPUT_HANDLE);
int main()
{
.....
//make red text
SetConsoleTextAttribute(stdOut, FOREGROUND_RED | FOREGROUND_INTENSITY);
cout << randchar << flush;
Thats a truncated version of my code... that is how I'd make it red, but it randomly chooses a number between 1 and 16, and then it decides on a letter using a switch statement (10 as a number is A). If it wasn't constantly outputing random characters, this would be easy.
Note: that cout isn't how I have it to display, but you'd need my whole code for it.
[email protected] is my email if you want the whole program's source.