programs/nicki.toby
author Ryan C. Gordon <icculus@icculus.org>
Wed, 18 Apr 2001 23:47:38 +0000
changeset 1 d7cb562e4e24
permissions -rw-r--r--
Initial revision
icculus@1
     1
number color
icculus@1
     2
icculus@1
     3
function main() returns nothing
icculus@1
     4
	disableFence()
icculus@1
     5
	hideturtle()
icculus@1
     6
	flower(50, 100, 1)	
icculus@1
     7
endfunction 
icculus@1
     8
icculus@1
     9
icculus@1
    10
function flower(number start, number end, number hop) returns nothing
icculus@1
    11
// nicki is cool
icculus@1
    12
icculus@1
    13
	number joe
icculus@1
    14
	number color = 0
icculus@1
    15
	number direction = 1
icculus@1
    16
icculus@1
    17
	for joe = start to end step hop
icculus@1
    18
		color = color + direction
icculus@1
    19
icculus@1
    20
		if (color > 11)
icculus@1
    21
			color = 11
icculus@1
    22
			direction = -1
icculus@1
    23
		endif
icculus@1
    24
icculus@1
    25
		if (color < 0)
icculus@1
    26
			color = 0
icculus@1
    27
			direction = 1
icculus@1
    28
		endif
icculus@1
    29
icculus@1
    30
		setPenColor(color)
icculus@1
    31
		webbox(joe)
icculus@1
    32
	endfor
icculus@1
    33
endfunction
icculus@1
    34
icculus@1
    35
function webbox(number size) returns nothing
icculus@1
    36
	number x
icculus@1
    37
icculus@1
    38
	for x = 1 to 360 / 10
icculus@1
    39
		octogon(size)
icculus@1
    40
		turnRight(15)
icculus@1
    41
	endfor
icculus@1
    42
endfunction
icculus@1
    43
icculus@1
    44
icculus@1
    45
function octogon(number size) returns nothing
icculus@1
    46
	number i
icculus@1
    47
icculus@1
    48
	for i = 1 to 8
icculus@1
    49
		goForward(size)
icculus@1
    50
		turnRight(45)
icculus@1
    51
	endfor
icculus@1
    52
endfunction
icculus@1
    53