-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgame.js
45 lines (38 loc) · 1013 Bytes
/
game.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
// Variables Declared
var playerName;
var question1;
var question2;
var question3;
var one = document.getElementById('one');
var two = document.getElementById('two');
var three = document.getElementById('three')
// Ask Question 1
function question1(){
question1 = prompt('Does Roland live in Washington State?').toUpperCase();
if ((question1 === 'YES') || (question1 === 'Y')) {
one.innerHTML = "You are correct!";
} else {
one.innerHTML = "You are not correct.";
}
}
// Ask Question 2
function question2(){
question2 = prompt('Is Roland a Musician?').toUpperCase();
if ((question2 === 'YES') || (question2 === 'Y')) {
two.innerHTML = "You are correct!";
} else {
two.innerHTML = "You are not correct.";
}
}
// Ask Question 3
function question3(){
question3 = prompt('Is Roland a Cougar or a Husky?');
if ((question3 === 'cougar') || (question3 === 'Cougar')) {
three.innerHTML = "You are correct!";
} else {
three.innerHTML = "You are not correct.";
}
}
question1();
question2();
question3();