-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplayground.html
65 lines (59 loc) · 882 Bytes
/
playground.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
<html>
<head>
<meta charset="UTF-8">
<title>Diane Playground</title>
<script src="diane.js"></script>
<link rel="stylesheet" type="text/css" href="playgroundStyle.css" />
</head>
<body>
<div id="playground"></div>
<script>
var app = Elm.Main.init({
node: document.getElementById('playground'),
flags: {
hasTrace: true,
adjustable: true,
program: `def FIB {
dup 2 swap < ? {
} else {
dup 1 swap - #FIB
swap 2 swap - #FIB
+
}
}
4 #FIB
def FIB_AGAIN {[
def LTE {[ @M @N
N M <
N M =
+
]}
def GO {[ @N
1 N #LTE ? {
N
} else {
1 N - #GO @X
2 N - #GO @Y
X Y +
}
]}
#GO
]}
4 #FIB_AGAIN
def FIB_FAST {[ @N
0 @CURR
1 @NEXT
while { N 0 < } do {
CURR NEXT +
NEXT @CURR
@NEXT
1 N - @N
}
CURR
]}
4 #FIB_FAST`
}
});
</script>
</body>
</html>