12345678910111213141516171819202122232425 |
- #!/usr/bin/ruby
- # https://rosettacode.org/wiki/Dragon_curve
- include('LSystem/LSystem.sf')
- var rules = Hash(
- x => 'x+yF+',
- y => '-Fx-y',
- )
- var lsys = LSystem(
- width: 600,
- height: 600,
- xoff: -430,
- yoff: -380,
- len: 8,
- angle: 90,
- color: 'dark green',
- )
- lsys.execute('Fx', 11, "dragon_curve.png", rules)
|