Screen.pause()
function
will suspend the program for at least 1 second, and asked whether there
is any way to shorten the pause.
Actually, Windows provides a function Sleep()
which suspends your program in the unit of milliseconds. Therefore, you
may Sleep(300) if you want to suspend your program for 0.3 seconds.
void draw_block(int n, int y0, int x0)
which will draw the nth block at position (y0, x0) in its default color.
void erase_block(int n, int y0, int x0)
which will draw the nth block at position (y0, x0) in COLOR_PAIR(0),
which effectively erase the block.
for (i = 1; i <= 7; i++)
{
for (int y = 0; y < 20; y++)
{
draw_block(i, y, 2 * i);
myScreen.redraw();
Sleep(300); // milliseconds
erase_block(i, y, 2 * i);
}
}