forked from PencilCode/jquery-turtle
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathfield.html
More file actions
43 lines (43 loc) · 800 Bytes
/
field.html
File metadata and controls
43 lines (43 loc) · 800 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
43
<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("Field test.");
asyncTest("Moves the field to translate the turtle.", function() {
speed(Infinity);
var homepos = pagexy();
pen(red);
fd(100);
rt(90);
fd(100);
rt(90);
fd(100);
rt(90);
fd(100);
rt(90);
pen(null);
$('#field').bk(100);
ok(!touches(red));
fd(100);
ok(touches(red));
fd(100);
ok(touches(red));
home();
ok(!touches(red));
moveto(homepos);
ok(touches(red));
$('#field').fd(100);
ok(touches(red));
bk(100);
ok(touches(red));
bk(100);
ok(!touches(red));
done(function() {
start();
});
});
</script>