forked from PencilCode/jquery-turtle
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathcontinuations.html
More file actions
55 lines (52 loc) · 1.6 KB
/
continuations.html
File metadata and controls
55 lines (52 loc) · 1.6 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
<script src="lib/qunit.js"></script>
<link href="lib/qunit.css" rel="stylesheet">
<script src="lib/jquery.js"></script>
<script src="../jquery-turtle.js"></script>
<body>
<div id="qunit"></div>
<script>
eval($.turtle());
module("Continuation style test.");
asyncTest("Exercises continuation-passing style on various apis.", function() {
speed(10, function() {
equal($.fx.speeds.turtle, 100);
pen(red, function() {
ok(true);
rt(360, 100, function() {
ok(touches(red));
pen(null, function() {
fd(100, function() {
ok(!touches(red));
speed(Infinity, function() {
equal($.fx.speeds.turtle, 0);
equal(Math.round(direction()), 0);
lt(90, function() {
equal(Math.round(direction()), -90);
bk(100, function() {
ok(touches(red));
jump(0, -100, function() {
ok(!touches(red));
turnto(0, function() {
ok(!touches(red));
move(0, -100, function() {
ok(touches(red));
moveto(0, 0, function() {
ok(touches(red));
play({tempo: 1000}, 'c', function() {
ok(touches(red));
start();
});
});
});
});
});
});
});
});
});
});
});
});
});
});
</script>