-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdo-yo-know-me.js
43 lines (37 loc) · 1.52 KB
/
do-yo-know-me.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
var readlineSync = require('readline-sync');
var score = 0;
var userName = readlineSync.question("Enter your good name: ");
console.log("Welcome", userName);
console.log(userName,"DO YOU KNOW VIRENDRA \n");
var questions = [{'question': 'Where did Virendra live? ',
'answer': 'Malvani'},
{'question': 'What is currently Virendra studying? ',
'answer': 'Engineering'},
{'question': 'Is Virendra introvert or extrovert? ',
'answer': 'Introvert'},
{'question': 'What is the birth day of Virendra? ',
'answer': 'Tuesday'},
{'question': 'What is surname of Virendra? ',
'answer': 'Wadher'},
{'question': 'From which college does Virendra done diploma. ',
'answer': 'SBMP'},
{'question': 'What does Virendra like tea or coeffe? ',
'answer': 'Tea'}];
function youKnowMe(question, answer){
var userAnswer = readlineSync.question(question);
if (userAnswer.toLowerCase() === answer.toLowerCase()){
score += 1;
console.log("YAY! you're right :)");
console.log("\n");
}
else{
console.log("Sorry! Its wrong answer. :(");
console.log("\n");
}
}
for (var i = 0; i < questions.length; i++){
youKnowMe(questions[i].question, questions[i].answer);
}
console.log("Your Score: ", score);
console.log("Thanks for your valuable time :)");
console.log("Thanks to TANAY PRATAP SIR _/\\_");