-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
110 lines (99 loc) · 2.54 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
#!/usr/bin/env node
import chalk from 'chalk';
import chalkAniamtion from 'chalk-animation';
import figlet from 'figlet';
import gradient from 'gradient-string';
import inquirer from 'inquirer';
let xboxGamerTag;
const sleep = (ms = 2000) => new Promise((r) => setTimeout(r, ms));
async function welcome(){
console.clear();
console.log(chalk.blue('Welcome to the ' + chalk.cyan.bold('Hyperlands Quiz')));
await sleep();
}
async function askName(){
console.clear();
const answers = await inquirer.prompt({
name: 'xbox_gamertag',
type: 'input',
message: 'What is you xbox gamertag?',
default(){
return 'Steve69';
},
});
xboxGamerTag = answers.xbox_gamertag;
}
async function question1(){
console.clear();
const answers = await inquirer.prompt({
name: 'question_1',
type: 'list',
message: 'What is the Hyperlands IP?',
choices: [
'play.hyperlandsmc.net',
'play.hyperlands.net',
'play.hyperlandsmc.com',
'play.hyperlands.com',
],
});
if(answers.question_1 === 'play.hyperlandsmc.net'){
await question2();
} else {
await lost();
}
}
async function question2(){
console.clear();
const answers = await inquirer.prompt({
name: 'question_2',
type: 'list',
message: 'What is the least popular gamemode on Hyperlands',
choices: [
'Bedwars',
'Skywars',
'TheBridge',
'Duels',
'BuildUHC',
],
});
if(answers.question_2 === 'BuildUHC'){
await question3();
} else {
await lost();
}
}
async function question3(){
console.clear();
const answers = await inquirer.prompt({
name: 'question_3',
type: 'list',
message: 'Who is the owner of Hyperlands?',
choices: [
'Stodgy',
'Demotism',
'FreeGaemingHear',
'FeeGamingHear',
'FreeGamingHere',
'FeeGamingHere',
],
});
if(answers.question_3 === 'FreeGamingHere'){
await winner();
} else {
await lost();
}
}
async function winner(){
figlet(`GG, ${xboxGamerTag}`, function(err, data) {
console.clear();
console.log(gradient('cyan', 'blue')(data));
});
}
async function lost(){
figlet(`You lose. ${xboxGamerTag}`, function(err, data) {
console.log(gradient('cyan', 'blue')(data));
});
}
await welcome();
await askName();
await question1();