-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
159 lines (126 loc) · 3.45 KB
/
index.js
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
const chalk = require('chalk');
const readlineSync = require('readline-sync');
const ctx = new chalk.Instance({ level: 3 });
console.log(chalk.green.bold("Welcome👋 There is a " + chalk.red("IMPOSTER") + " among us"));
console.log(chalk.yellow("_____________________________________________\n"));
let score = 0;
let userName = readlineSync.question(chalk.inverse.bold(' Can I know your name?') + chalk.bold(' YOU KINDA SUS! \n '));
console.log('Hi ' + chalk.red(userName) +
" Landing you to the spaceship now\n");
console.log(chalk.rgb(255, 0, 255)("You will be asked few questions related to among us. Answer them carefully and complete the tasks"))
console.log(chalk.inverse.bold.yellow("Note: Type the Correct Option {not the answer} and Press enter\n"))
let Questions = [
{
question: `1. Which Room Would You Swipe A Card In?
a: Admin
b: Cafe
c: Kitchen
d: Kitchen\n`,
answer: "a"
},
{
question: `2. Which Of These Isn't A Map On The Game?
a: The Skeld
b: MIRA HQ
c: Polus
d: Chima\n`,
answer: "d"
},
{
question: `3.Where Do You Find The Engine Fuel?
a: Navigation
b: Lower Engine
c: Upper Engine
d: Storage\n`,
answer: "d"
},
{
question: `4.What Do You Clear From The Skeld O2 Filter?
a: Rocks
b: Fuel
c: Paper
d: Leaves\n`,
answer: "d"
},
{
question: `5. What Is The Max Number Of Imposters??
a: One
b: Two
c: Three
d: Five\n`,
answer: "c"
},
{
question: `6. How Many Wires Do You Connect When Fixing Wiring?
a: Four
b: Five
c: Three
d: Six\n`,
answer: "a"
},
{
question: `7.What's the minimum number of players needed?
a: Four
b: Three
c: Two
d: One\n`,
answer: "a"
},
{
question: `8. What's the name of the real-life game that Among Us is based on?
a: Monsters
b: Warewolf
c: Trick n TReat
d: Devil\n`,
answer: "b"
},
{
question: `9. What are the names of the two teams in Among Us?
a: Imposters and crewmates
b: Imposters and astronuts
c: Imposters and classmates
d: Imposters and devils\n`,
answer: "a"
},
{
question: `10. What's the planet called???
a: Bolus
b: Polus
c: Potos
d: Bolo\n`,
answer: "b"
},
];
var highScores = [
{
name: "Hamsa",
score: 10,
},
{
name: "Nikki",
score: 10,
},
]
function play(question, choices, answer) {
var userAnswer = readlineSync.question(question);
if (userAnswer === answer) {
console.log(chalk.green.bold("Right answer ✔️"));
score = score + 1;
console.log(chalk.rgb(153, 0, 204)("Your Current score:" + chalk.rgb(255, 255, 0)(score)))
} else {
console.log(chalk.rgb(204, 0, 0).bold("Wrong ❌"));
console.log(chalk.rgb(153, 0, 204)("Your Current score:" + score))
console.log("The right answer is " + chalk.rgb(255, 136, 0).bold(answer + "\n"))
}
}
for (i = 0; i < Questions.length; i++) {
play(Questions[i].question, Questions[i].choices, Questions[i].answer)
}
console.log(chalk.yellow("_____________________________________________\n"));
console.log(chalk.rgb(255, 0, 102)("Your Total score : " + score));
console.log("HIGH SCORES ARE:");
for (var j=0; j<highScores.length; j++) {
console.log( highScores[j].name + ": " + highScores[j].score);
}
console.log(" Send screenshot of your scores to me \n")
console.log("Share this with your crewmates. Have a nice day😄")