-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
47 lines (33 loc) · 1.07 KB
/
index.html
File metadata and controls
47 lines (33 loc) · 1.07 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
<!DOCTYPE>
<html>
<head>
<title>Ask the Helix!</title>
</head>
<body style="width:99%">
<div style="display:block;margin:auto;text-align:center">
<img src="./img/helix.png" width="500" height="400" />
<h1>What is your question, mortal?</h1>
<input type="text" id="question"/>
<input type="button" id="submitB" value="Ask!" onclick="javascript:answer();"/>
<h2 id="answerText"></h2>
</div>
<script>
answers = ['A', 'B', 'Down', 'Up', 'Left', 'Right', 'Select', 'Start', 'Start9', 'Yes', 'No',
'ASH, this is not the time to do that!', 'The Dome is near!', 'Praise me!', 'RIOT!', 'Raise your Dongers!',
'Guys we need to ... Misty!', 'Learn Rollout!', 'Masterball? Too easy...'];
function getHash(text) {
var sum = 0;
for(var i = 0; i < text.length; i++)
sum += text.charCodeAt(i);
return sum % answers.length;
}
function makeAnswer(text) {
document.getElementById("answerText").innerHTML = text;
}
function answer() {
var code = getHash(document.getElementById('question').value);
makeAnswer(answers[code]);
}
</script>
</body>
<html>