-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.c
35 lines (34 loc) · 1.23 KB
/
main.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
#include <stdio.h>
#include <stdlib.h>
#include "game.h"
int main(){
char choice;
system("toilet \"Snake\" -f mono12 -W --filter border --filter gay | sed \'s/^/ /\'");
while (1){
printf("\t\t\t\t\t\t\tGo to Settings: S\n");
printf("\t\t\t\t\t\t\tPrint Leaderboard: L\n");
printf("\t\t\t\t\t\t\tExit: Q\n");
printf("\t\t\t\t\t\t\tPlay: P\n");
fflush(stdin);
scanf(" %c",&choice);
if (choice == 'P'){
if(main_game()){
printf("Something went wrong during the game\n");
return 1;
}else{
printf("Going back to main menu\n");
system("toilet \"Snake\" -f mono12 -W --filter border --filter gay | sed \'s/^/ /\'");
}
}else if(choice == 'S'){
printf("Settings not implemented yet\n");
}else if(choice == 'L'){
printf("Leaderboard not implemented yet\n");
}else if(choice == 'Q'){
printf("Thank you for playing 😄\n");
break;
}else if (choice != '\n'){
printf("Not a valid command\n");
}
}
return 0;
}