-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtrivial.c
68 lines (64 loc) · 1.13 KB
/
trivial.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#define __MAIN__
#include "inc/config.h"
int main(void)
{
CONTROLINT choice;
USER * user;
boot();
renderOpeningScreen();
do
{
choice = rendersMainMenu();
switch(choice)
{
case PLAY:
startGame();
break;
case NEW_USER:
registerNewUser();
break;
case TOP_10:
listBestPlayers();
break;
case LATEST_PLAYERS:
lastPlayers();
break;
case MY_ACCOUNT:
user = login(1);
if(user->id != 0)
{
do
{
choice = rendersAdmMenu(*user);
switch(choice)
{
case EDIT_ACCOUNT:
changeName(user);
break;
case DELETE_ACCOUNT:
choice = deleteAccount(*user);
break;
case INSERT_QUESTION:
insertQuestion();
break;
case CREATE_ADMINISTRATOR:
promoteUserToAdministrator();
break;
case RECOVER_PASSWORD:
recoverPassword();
break;
case EXIT:
choice = BACK_TO_MAIN_MENU;
}
}
while(choice != BACK_TO_MAIN_MENU);
}
free(user);
break;
}
}
while(choice != EXIT);
turnOff();
renderClosingScreen();
return EXIT_SUCCESS;
}