-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.c
73 lines (69 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
68
69
70
71
72
73
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <string.h>
#include <time.h>
char dir[10000];
int main() {
srand(time(NULL));
cls();
printf("+------------------------+");
printf("\n| Death Command Roulette |");
printf("\n+------------------------+");
//printf("\a");
printair();
printf("\nSign the waiver> ");
fgets(dir, sizeof(dir), stdin);
dir[strcspn(dir, "\n")] = '\0';
cls();
printf("YOU SIGNED THE WAIVER.");
_sleep(1000);
printf("\nNOW. PLAY.");
_sleep(1000);
cls();
printf("+----------------------+");
printf("\n| It's time to play... |");
printf("\n+----------------------+");
printair();
printf("\nEnter the name of the file you want to put on the line> ");
fgets(dir, sizeof(dir), stdin);
dir[strcspn(dir, "\n")] = '\0';
while (true) {
printf("\nPress the ENTER key to spin.");
getchar();
int spin = (rand() % 6) + 1;
if (spin != 6) {
printf("\nSafe...");
}
else {
printf("\nGame over.");
remove(dir);
#ifdef _WIN32
system("color c0");
_sleep(100);
system("color 07");
_sleep(100);
break;
#else
_sleep(1000);
break;
#endif
}
}
return 0;
}
int cls() {
#ifdef _WIN32
system("cls");
#elif __APPLE__
system("clear");
#elif __linux__
system("clear");
#else
printf("Unknown operating system. Could not proceed.");
return 1;
#endif
}
int printair() {
printf("\n");
}