-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
70 lines (69 loc) · 1.69 KB
/
index.html
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
<html>
<head>
<title>Code Poetry</title>
<link href="code.css" rel="stylesheet"/>
</head>
<body>
<h1>Code Poems</h1>
<div class="poem">
<h3 id="calm">Calm</h3>
<div class="js">
<span>
<span class="keywd">const</span>
<span class="fn">calm</span> <span class="op">=</span>
x <span class="op">=></span> <span class="op">{</span>
<span class="fnbody">
x <span class="op">!=</span> <span class="const">PERFECT</span>
<span class="op">&&</span> <span class="fn">learn();</span>
<span class="op">}</span>
</span>
</span>
</div>
</div>
<div class="poem">
<h3 id="again">Again</h3>
<pre>
function again(x) {
if (x == SUCCESS) {
return x;
} else {
try {
again(x);
} catch (err) {
console.log(err);
}
}
}
</pre>
</div>
<br>
<h3 id="chickens">Chickens</h3>
<p class="comment">eggs: Date[]</p>
<pre>
function birdCount(eggs) {
let chickens = 0;
const today = new Date();
for (let i=0; i<=eggs.length; i++) {
if (eggs[i] <= today) {
// egg is hatched
chickens++;
} else {
// do not count
}
}
return chickens;
}
</pre>
<br>
<h3 id="dagobah">Dagobah</h3>
<pre>
function dagobah(task) {
try {
task();
} catch(err) {
console.log('No! Try not! Do or do not, there is no try.');
}
}
</pre>
</body>
</html>