forked from fabrikate/JavaLava
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsevenwesteros.html
More file actions
74 lines (71 loc) · 2.8 KB
/
sevenwesteros.html
File metadata and controls
74 lines (71 loc) · 2.8 KB
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
<script type="text/javascript">
var guess, answer, welcome, question, answer
//Can you name the seven kingdoms of westeros?
welcome = confirm("Welcome ASOIF and GOT nerds. Here your Westeros knowledge will be put to the test... Can you name all Seven kingdoms of Westeros?");
alert("Don't include 'The' when naming the kingdoms")
if (welcome){
//var question, answer,guess_prompt
question = ["What is the largest kingdom in Westeos?", "Which mountain kingdom has the castle Eyrie?", "The warden of this kingdom has a fish as his sigil", "This prosperous kingdom houses the family that always pays their debts", "This kingdom is known for its termultous weather and the Baratheon family", "This kingdom houses the family whos words are 'Growing strong'", "This southern kingdom is mostly dessert and snakes."]
answer = ["North", "Vale", "Riverlands", "Westerlands", "Stormlands","Reach","Dorne"]
i = 0
for (i = 0; i <7; i++) {
guess = prompt(question[i])
if (answer[i] === guess){
alert("Correct, you are smart enough to survive in Westeros!")
}else{
alert("Wrong, Ser Ilyn pays you a visit.")
}
};
//for i
//for loop with a function, use i as the counter. you can put the counter in the sub
/*guess_compare_answer = function(guess){
var kingdom_north = "North"
if (guess === kingdom_north){
alert("That's correct! Do you have some Stark heritage?");
}
else{
alert("Winter is coming and you have failed.");
console.log(guess);
}
var kingdom_vale = "Vale"
if (guess === kingdom_vale){
alert("Correct, clearly you have made the journey up the mountain to the Eyrie");
}else{
alert("Wrong, you are thrown out of the moon door.");
}
var kingdom_riverlands = "Riverlands"
if (guess === kingdom_riverlands){
alert("Yes, that's right. Swim on and be unharmed.");
}else{
alert("No, You decide to attend a wedding at the Frey's...and well you know what can happen at Frey weddings!");
}
var kingdom_rock = "Westerlands"
if (guess === kingdom_rock){
alert("Yes, you must have the cunning of Lan the clever.");
}else{
alert("No, thats wrong. A Lannister always pays their debts");
}
var kingdom_storm = "Stormlands"
if (guess === kingdom_storm){
alert("That's right! I see the foundation of your knowledge is as strong as Storm's End");
}else{
alert("No, thats wrong. Much like the former castles of Storm's End you crumple and fall.")
}
var kingdom_reach = "Reach"
if(guess === kingdom_reach){
alert("Yes! Your knowledge grows strong.");
}else{
alert("That answer is like the thorn on a Tyrell rose. Its hurts its so wrong.");
}
var kingdom_dorne = "Dorne"
if (guess === kingdom_dorne){
alert("Unbowed, Unbent, Unbroken: Your answer is right");
}else{
alert("Thats wrong. You're bit by a dornish viper.")
}
}*/
}
else{
alert("Whimp!")
}
</script>