/
boxes.toby
46 lines (35 loc) · 1.43 KB
/
boxes.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
// boxes.toby : Various cool geometrics with simple boxes.
function box(number size) returns nothing
//---------------------------------------------------------//
// Most functions in this package make use of this //
// function for cool stuff. //
// //
// params : (number) size == size of one side of box. //
// returns : void. //
//---------------------------------------------------------//
number i
for i = 1 to 4
goForward(size)
turnRight(90)
endfor
endfunction
function webBox(number size, number angle) returns nothing
//---------------------------------------------------------//
// Make a weblike pattern out of boxes. //
// //
// params : (number) size == size of one side of box. //
// (number) angle == amount of turn for each //
// box. Smaller number == //
// more boxes. //
// returns : void. //
//---------------------------------------------------------//
number i
for i = 1 to (360 / angle)
box(size)
turnRight(angle)
endfor
endfunction
function main() returns nothing
webBox(100, 2)
endfunction
// end of boxes.toby ...