/
boolTest.toby
51 lines (38 loc) · 983 Bytes
/
boolTest.toby
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
//------------------------------------------------------------
// boolTest.toby ... Should draw two large circles
// of dotted lines, connected in the center of
// TurtleSpace.
//
// - Tests IF statement, BOOLEAN intrinsic.
//
// Copyright (c) Lighting and Sound Technologies, 1998.
// Written by Ryan C. Gordon.
//------------------------------------------------------------
function main() returns nothing
boolean isDrawTime
boolean goRight
number i
disableFence()
isDrawTime = true
for i = 1 to 720
if (isDrawTime == true)
setPenDown()
isDrawTime = false
else
setPenUp()
isDrawTime = true
endif
goForward(10)
// this isn't meant to be
// efficient. This is a test.
if (i > 360)
goRight = true
endif
if (goRight)
turnRight(1)
else
turnLeft(1)
endif
endfor
endfunction
// end of boolTest.toby ...