#include <stdio.h>
#include <locale.h>
#include <stdlib.h>
#include "common.h"
#include "definitions.h"
#include "gameMenu.h"
#include "gameCtrl.h"
Go to the source code of this file.
|
int | main (int argc, char *argv[]) |
| Main entry point of the program.
|
|
◆ main()
int main |
( |
int | argc, |
|
|
char * | argv[] ) |
Main entry point of the program.
Definition at line 14 of file xTetris.c.
14 {
15
16 int nChoices[2][4];
17 int menu, opt, key=
RESET;
18
19 setlocale(LC_CTYPE, "");
20
21 do{
24 }
26
27 nChoices[0][0]=2;
28 nChoices[1][0]=5;
29 nChoices[0][1]=6;
30 nChoices[1][1]=8;
31 nChoices[0][2]=nChoices[1][2]=9;
32 nChoices[0][3]=nChoices[1][3]=10;
33 menu=1;
34
35 do{
36 if(menu!=6 && menu!=7){
37 if(menu>=8 && menu<=10){
38 opt=menu-6;
39 menu=1;
40 }
41 else
42 opt=nChoices[0][menu-1];
43 menu =
choiceCtrl(menu, opt, nChoices[0][menu-1], nChoices[1][menu-1]);
44 }
45 else{
46
49 menu=1;
51 }
52 }
53 while(menu!=5);
54
56
58 return 0;
59}
void delayTimer(int time)
Call the system sleep.
int waitUserInput(void)
Loop until user press a valid key.
void clearCLI(void)
Call the system function to clear the cli.
void startGame(int mode)
Start the gameplay.