Код:
extern char* GAME_TITLE;
extern char* GAME_MENU;
extern int fmap[FMAP_COUNTS][4][4];
int t;
char* TITLE = "########### ########### ########### ######### ##### ### #######\n"
"# # # # # # # # # # # # # # #\n"
"# # # # # # # # # # # # # # \n"
" # ##### # ###### # ## # # \n"
" # # # # # # # # # # \n"
" # # # # # # # # # # #\n"
" ####### ########### ####### ### ##### ### ##### ###### \n\n";
char* MENU = "\t" "\x1A" "1. Start\n"
"\t 2. Start & Add Random Blocks\n"
"\t 3. Info\n"
"\t 4. Exit";
int Setmap[FMAP_COUNTS][4][4] =
{
{
{1, 1, 0, 0},
{1, 1, 0, 0},
{0, 0, 0, 0},
{0, 0, 0, 0}
},
{
{1, 0, 0, 0},
{1, 0, 0, 0},
{1, 0, 0, 0},
{1, 0, 0, 0}
},
{
{0, 0, 1, 0},
{1, 1, 1, 0},
{0, 0, 0, 0},
{0, 0, 0, 0}
},
{
{1, 1, 1, 0},
{0, 0, 1, 0},
{0, 0, 0, 0},
{0, 0, 0, 0}
},
{
{0, 1, 1, 0},
{1, 1, 0, 0},
{0, 0, 0, 0},
{0, 0, 0, 0}
},
{
{1, 1, 0, 0},
{0, 1, 1, 0},
{0, 0, 0, 0},
{0, 0, 0, 0}
},
{
{1, 1, 1, 0},
{0, 1, 0, 0},
{0, 0, 0, 0},
{0, 0, 0, 0}
}
};
INITIAL(18, 80); //Set screen parameters to 18 rows(_cTotal) and 80 columns(_lTotal)
GAME_TITLE = TITLE;
GAME_MENU = MENU;
memcpy(fmap, Setmap, sizeof(Setmap));
srand(PSW[38]); //srand((unsigned)time(NULL))
gotoxy(0,8);
printf(" PETER_A PRESENTS THE GAME\n");
Delay(3000);
gotoxy(0, _lTotal);
t = 10;
while(t--) {
putchar('\n');
Delay(100);
}
gotoxy(0,5);
printf( "%s", GAME_TITLE);
Delay(2000);
t = 9;
while(t--) {
putchar('\n');
Delay(100);
}
Delay(500);
printf("Press any key to begin... ");
getch(); if(kbhit()) getch();
gamemenu();
gotoxy(0, _lTotal);
t = 12;
while(t--) {
putchar('\n');
Delay(100);
}
gotoxy(0,8);
printf(" Bye-bye take care of yourself!!!\n");
printf(" :)");