aboutsummaryrefslogtreecommitdiff
path: root/examples/dragon.fco
blob: 1240bf06c2386b24e12180abf3088be66df9efb2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
# Generates the sequence of turns needed to draw a dragon curve;
# see: http://en.wikipedia.org/wiki/Dragon_curve
def dragon(n turns)
    if =(n 0)
        ""
    else
        +(+(dragon(-(n 1) "R") turns) dragon(-(n 1) "L"))
    end
end

def main()
    display(dragon(5 ""))
end