programs/psychedelic3.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.
icculus@1
     1
function main() returns nothing
icculus@1
     2
    number i
icculus@1
     3
icculus@1
     4
    for i = 1 to 360 step 2
icculus@1
     5
        circle()
icculus@1
     6
        turnRight(2)
icculus@1
     7
    endfor
icculus@1
     8
endfunction
icculus@1
     9
icculus@1
    10
icculus@1
    11
function circle() returns nothing
icculus@1
    12
    number i
icculus@1
    13
	number color
icculus@1
    14
icculus@1
    15
    for i = 1 to 360
icculus@1
    16
icculus@1
    17
		color = round(random() * 10) + 1
icculus@1
    18
		setPenColor(color)
icculus@1
    19
        goForward(3)
icculus@1
    20
        turnRight(1)
icculus@1
    21
    endfor
icculus@1
    22
endfunction
icculus@1
    23
icculus@1
    24
icculus@1
    25
icculus@1
    26
icculus@1
    27
icculus@1
    28