programs/april_modified.toby
author Ryan C. Gordon <icculus@icculus.org>
Tue, 18 Mar 2008 02:05:22 +0000
changeset 499 96e88f292dc8
parent 1 d7cb562e4e24
permissions -rw-r--r--
Updated Lua from 5.1.1 to 5.1.3.
function main() returns nothing
	// april kicks ass
	flower()
endfunction


function flower() returns nothing
	number i
	number bob
	number direction

	direction = 1

	bob = 0

	for i = 10 to 100 step 5
		bob = bob + direction
	
		if (bob >= 12)
			bob = 11
			direction = -1
		endif

		if (bob <= 0)
			bob = 0
			direction = 1
		endif

		setPenColor(bob)
		webbox(i)
	endfor

endfunction


function webbox(number m) returns nothing
	number i

	for i = 1 to 360 / 10
		box(m)
		turnRight(10)

	endfor
endfunction


function box(number size) returns nothing

	number i

	for i = 1 to 4
		goForward(size)
		turnRight(90)
	endfor

endfunction