# 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