programs/colorBlocks.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

    number i

    for i = 0 to 15
        setPenColor(i)
        fillBlock(i * 20, (i + 1) * 20)
    endfor

endfunction


function fillBlock(number start, number stop) returns nothing

    number i

    setPenDown()

    for i = start to stop
        setTurtleXY(0, i)
        setAngle(0)
        goForward(30)
    endfor

endfunction