char gameMenu( char );
//---------------------------------------------------------------------------
#pragma argsused
int main(int argc, char* argv[])
{
char choice;
int b = 1;
int r = 4;
int g = 2;
while ( choice != 27 )
{
gameMenu ( choice );
switch ( choice )
{
case ' ':
cout << "\a";
break;
case 'b':
case 'B':
textbackground ( b );
clrscr();
break;
case 'r':
case 'R':
textbackground ( r );
clrscr();
break;
case 'g':
case 'G':
textbackground ( g );
clrscr();
break;
default: cout << "That is not a valid choice!" << endl << endl;
}
}
return 0;
}
//---------------------------------------------------------------------------
//
//
//
//
//---------------------------------------------------------------------------
char gameMenu( char choice )
{
cout << "Press the Esc key to exit" << endl <<
"The space bar to make a beep" << endl <<
"b to make the screen Blue" << endl <<
"r to make the screen red" << endl <<
"g ro make the screen green" << endl << endl << ":";
choice = getch();
clrscr();
return choice;
}
//---------------------------------------------------------------------------