-
Notifications
You must be signed in to change notification settings - Fork 0
/
string2.js
64 lines (49 loc) · 1.18 KB
/
string2.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
var input2;
var answer = 's = \'audacity\'';
var answer2 = 'print \'U\' + s[2:]';
function preload() {
}
function setup() {
setupVid(1600, 1000, ['string2.mp4']);
back.mousePressed(mindmap);
}
function mindmap() {
window.location.replace('anotherMind.html');
}
function draw() {
drawVid();
//Code for input box
if (md >= 29 && !inputSet) {
input = createInput('');
input.position(350, 600);
input2 = createInput('');
input2.position(350, 680);
inputButton = createButton('submit');
inputButton.position(350, 810);
inputButton.mousePressed(checkAnswer);
greeting = createElement('h2', saying);
greeting.position(435, 800);
textAlign(CENTER);
textSize(50);
inputSet = true;
}
//Code to remove input elements
if(md < 29 && inputSet) {
input.remove();
inputButton.remove();
input2.remove();
greeting.remove();
inputSet = false;
}
}
//CODE FOR INPUT BOX
function checkAnswer() {
if((input.value().trim() == answer) && (input2.value().trim() == answer2))
greeting.html('Correct!');
else
greeting.html('Incorrect!');
}
function mouseClicked() {
//Tests for X and Y
//createDiv('Mouse X :' + mouseX + 'Mouse Y :' + mouseY);
}