-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.c
72 lines (67 loc) · 2.62 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
/*
Copyright 2023 Anirudh Menon
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>. */
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
int main(void) {
char* lang = malloc(3 * sizeof(char));
if (lang == NULL) {
printf("Illegal memory error : 1. In order to protect your computer, the program will not proceed\n");
return 1;
}
printf(" / \\ \n");
printf(" / \\ \n");
printf(" / \\ \n");
printf(" / \\ \n");
printf(" / \\ \n");
printf(" | | \n");
printf(" | | \n");
printf(" | | \n");
printf(" | | \n");
printf(" | | \n");
printf(" | | \n");
printf(" | | \n");
printf(" | | \n");
printf(" | | \n");
printf(" / ( (§è!çàç!è \\ \n");
printf(" / è§ùm(§è;::;gg \\ \n");
printf("/ é çàŝùù!è(è \\ \n\n\n\n\n\n");
printf("Welcome to the game: Fly to the moon.\nIn this game you will fly to the moon in Artemis 3.\n3\n");
sleep(1);
printf("2\n");
sleep(1);
printf("1\n");
sleep(1);
printf("Launch!!!!\n");
printf("Please wait while this rocket goes to the moon.\nThis might take some time...\n");
sleep(10);
printf("Oh no!!!!\n");
sleep(1);
printf("The rocket software has crashed.\nWell,you should have known it when you wrote such important code in Ruby.\n");
sleep(1);
printf("You have a choice: Rewrite the code in Go, or rewrite it in C\n");
sleep(1);
printf("You decide.\n");
scanf("%s",lang);
if (strcmp(lang, "Go") == 0) {
printf("Oh man.\n");
sleep(1);
printf("The garbage collector failed.\n");
sleep(1);
printf("Well you deserve this for using Go on a mission critical operation.\nYou die.\n");
return 0;
} else if (strcmp(lang, "C") == 0) {
printf("You chose C.\nIt worked!\nNow when you go back home you can flex. :)\n");
sleep(2);
} else {
printf("Invalid choice.\n");
return 0;
}
free(lang);
printf("You returned home\n");
return 0;
}