Consider the following code (tetris-1a.exe), which shows a space with different color,
when the user press '1', '2', '3', ..., '7'.
#include <iostream>
#include <curses.h>
#include "wincursor.h"
int main()
{
char i, c;
Screen myScreen;
String sp(" ", 10, 10);
String v(myScreen.version(), 11, 10);
for (i=0; i<=7; i++)
{
sp.show(i+1, 40, i);
}
v.show();
myScreen.redraw();
while ( (c = myScreen.key() ) != 'q')
{
if ('0' <= c && c <= '7')
{
i = c - '0';
sp.show(10, 10, i);
myScreen.redraw();
}
}
return 0;
}