-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
114 lines (100 loc) · 2.49 KB
/
script.js
File metadata and controls
114 lines (100 loc) · 2.49 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
var count = 0;
//------------------------------------------------------------------------------ <= 80 character limit
//|||||
//function that starts cooking and calls lemon or sugar
function startCooking() {
count++
var step_s__p_ = "";
if (count == 1) {
step_s__p_ = lemon();
} else if (count == 2) {
step_s__p_ = water();
}else if (count == 3) {
step_s__p_ = sugar();
}else if (count == 4) {
step_s__p_ = mix();
}else if (count == 5) {
step_s__p_ = lemonslice();
}else if (count == 6) {
step_s__p_ = umbrella();
}else if (count == 7) {
step_s__p_ = boil();
}else if (count == 8) {
step_s__p_ = pork();
}
cook(step_s__p_);
}
//|||||
//function that adds to the step input
function cook(step_s__p_) {
document.body.append(step_s__p_);
}
//|||||
//function that gets you lemon juice
function lemon() {
return "squeezing lemons(在挤柠檬)";
document.write("\n");
}
//|||||
//function that gets you lemon juice
function water() {
return "adding in 2 cups of icy crisp water(加2杯冷水) ";
document.write("<br>");
}
//|||||
//function that adds in sugar
function sugar() {
return "adding a healthy dose of sugar (加一点🤏糖) ";
document.write("<br>");
}
//|||||
//function that mixes everything up
function mix() {
return "mixing in sugar (搅匀糖)";
document.write ("<br>");
}
//|||||
//function that adds lemon aesthetic
function lemonslice() {
return "adding a freshly cut lemon slice (加柠檬片)";
document.write ("<br>");
}
//|||||
//function that adds cute umbrella
function umbrella() {
return "adding a cocktail umbrella to top things off! (加纸伞) ";
}
//|||||
//function that adds starts the hotpot
function boil() {
return "adding water, salt, and pepper (加水, 盐和胡椒) ";
}
//|||||
//function that adds starts the hotpot
function pork() {
return "adding raw pork ";
}
//|||||
//function that counts down recursively
function countdown(n) {
if(n==0){
return "0!!!";
} else{
document.body.append(n);
countdown(n-1);
}
}
//|||||
//function that authenticates user
function authenticate(username, password){
if(password == reverse(username)+"idiotsandwich"){
location.href = 'cook.html';
} else{
"You idiot sandwich, that isn't the correct password!"
}
}
//|||||
//function that returns a reverse string
function reverse(s){
return s.split("").reverse().join("");
}