-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.c
67 lines (61 loc) · 1.66 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
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
/**
* @file main.c
* @author Ayomide Suara ([email protected])
*
* main - driver function for entire game
*
* @date 2022-08-20
*
*/
#include <stdio.h>
#include <windows.h>
#include "main.h"
int main()
{
char choice;
START:
system("cls");
system("color 0e");
printf(
"888888P dP a88888b. d888888P .d888888 a88888b. d888888P .88888. 88888888\n"
" 88 88 d8\' `88 88 d8\' 88 d8\' `88 88 d8\' `8b 88 \n"
" 88 88 88 88 88aaaaa88a 88 88 88 88 a88aaaa \n"
" 88 88 88 88 88 88 88 88 88 88 88 \n"
" 88 88 Y8. .88 88 88 88 Y8. .88 88 Y8. .8P 88 \n"
" dP dP Y88888P\' dP 88 88 Y88888P\' dP `8888P\' 88888888\n"
);
printf("\n ===========================\n");
printf("\t WELCOME!\n");
printf(" ===========================\n");
BEGIN:
Sleep(500);
printf("\n============================\n");
printf("How do you wish to play?\n");
printf("A. Against the computer\n");
printf("B. Against a friend\n\n");
printf("X. Exit Game\n\t\t==> ");
scanf("%s", &choice);
if (choice == 'A' || choice == 'a')
{
system("color 0a");
singlePlayer();
}
else if (choice == 'B' || choice == 'b')
{
system("color 0b");
multiPlayer();
}
else if (choice == 'X' || choice == 'x')
{
printf("\nBYE! Come Back Soon\n");
Sleep(2000);
system("color 07");
exit(0);
}
else
printf("ERROR! Invalid Option\n\n");
goto BEGIN;
printf("Start Over?");
goto START;
return 0;
}