forked from PencilCode/jquery-turtle
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathclip.html
More file actions
45 lines (42 loc) · 842 Bytes
/
clip.html
File metadata and controls
45 lines (42 loc) · 842 Bytes
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
<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("Movexy test.");
asyncTest("Draws does a few movexy displacements.", function() {
speed(Infinity);
pen(blue);
fd(100); rt(90);
fd(100); rt(90);
fd(100); rt(90);
fd(100); rt(90);
pen(null);
var a = new Sprite;
ok(a.touches(blue));
drawon(a);
dot(red, 20);
move(20);
dot(red, 20);
fd(20);
dot(red, 20);
a.move(20, 20);
ok(a.touches(blue));
a.clip()
ok(!a.touches(blue));
a.fd(50);
ok(a.touches(blue));
a.lt(45);
ok(a.touches(blue));
a.bk(80);
ok(a.touches(blue));
a.lt(30);
ok(!a.touches(blue));
a.move(-20);
ok(a.touches(blue));
start();
});
</script>