I had a tutor, but he was horrible and told me you couldn't make text blink. I know have the code for sleep, and understand(I think) what I have to do, but I'm having trouble incorporating it. The code is long, i'm sorry. I'll start with my code and then the code I have for sleep, if anyone can help it's greatly appreciated.
Summary: text based matching game, the mis-matched names are supposed to blink for 1, 3, or 5 seconds which they decide in the beginning.
void reveal(int r1, int c1, int r2, int c2)
{
for (int i = 0; i < numRows; i++)
{
for (int j = 0; j < numColumns; j++)
{
if (r1 == i && c1 == j){
SetConsoleTextAttribute(handle, 15);
cout << names[i][j] << '\t';
sleep(input * 1000);
}
else if (r2 == i && c2 == j)
cout << names[i][j] << '\t';
else if (status[i][j] == true)
cout << names[i][j] << '\t';
else cout << blank << '\t';
}
cout << endl << endl;
}
im using conio and windows.h for sleep, but sleep is still saying its undefined.
windows, visual studios
IM THINKING:
//else if (status[i][j] == false { sleep for input*100}
after status[I][j] == true statement; but how would I make the word stay without sleeping for a variable amount of time? (in the beginning of the game, you choose 1, 3, or 5 seconds for the cards to be visible.
blinking text:
http://cppuni.blogspot.com/2009/02/blinking-colored-text-illusion.html