-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathlevel2.js
69 lines (59 loc) · 1.86 KB
/
level2.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
65
66
67
68
69
// Level 2 content is set
//Level 2 JavaScript
sessionStorage.setItem("levelx", 2);
var GameSpeed = 200;
var TimeInSeconds = 120;
function setcanoncontent(){
ssno = Math.floor(Math.random() * 5) + 1;
switch(ssno){
case 1: canoncontent = ss1sum;
break;
case 2: canoncontent = ss2sum;
break;
case 3: canoncontent = ss3sum;
break;
case 4: canoncontent = ss4sum;
break;
case 5: canoncontent = ss5sum;
break;
}
canon.innerHTML = "<p style='color: white;padding-left:46px;'><b>" + canoncontent + "</b></p>";
}
function setss1content(){
r1 = Math.floor(Math.random() * 19) + 6;
r2 = Math.floor(Math.random() * 9) + 1;
ss1sum = r1 - r2;
ss1.innerHTML = "<p style='color: white;padding-top:53px;padding-left:85px;'>" + r1 + " - " + r2 + "</p>";
}
function setss2content(){
r1 = Math.floor(Math.random() * 19) + 6;
r2 = Math.floor(Math.random() * 9) + 1;
ss2sum = r1 - r2;
ss2.innerHTML = "<p style='color: white;padding-top:53px;padding-left:85px;'>" + r1 + " - " + r2 + "</p>";
}
function setss3content(){
r1 = Math.floor(Math.random() * 19) + 6;
r2 = Math.floor(Math.random() * 9) + 1;
ss3sum = r1 - r2;
ss3.innerHTML = "<p style='color: white;padding-top:53px;padding-left:85px;'>" + r1 + " - " + r2 + "</p>";
}
function setss4content(){
r1 = Math.floor(Math.random() * 19) + 6;
r2 = Math.floor(Math.random() * 9) + 1;
ss4sum = r1 - r2;
ss4.innerHTML = "<p style='color: white;padding-top:53px;padding-left:85px;'>" + r1 + " - " + r2 + "</p>";
}
function setss5content(){
r1 = Math.floor(Math.random() * 19) + 6;
r2 = Math.floor(Math.random() * 9) + 1;
ss5sum = r1 - r2;
ss5.innerHTML = "<p style='color: white;padding-top:53px;padding-left:85px;'>" + r1 + " - " + r2 + "</p>";
}
function ifsumcorrect(ss, cc){
if(ss == cc){
return 1;
}
else{
return 0;
}
}