dragon_curve.sf 345 B

12345678910111213141516171819202122232425
  1. #!/usr/bin/ruby
  2. # https://rosettacode.org/wiki/Dragon_curve
  3. include('LSystem/LSystem.sf')
  4. var rules = Hash(
  5. x => 'x+yF+',
  6. y => '-Fx-y',
  7. )
  8. var lsys = LSystem(
  9. width: 600,
  10. height: 600,
  11. xoff: -430,
  12. yoff: -380,
  13. len: 8,
  14. angle: 90,
  15. color: 'dark green',
  16. )
  17. lsys.execute('Fx', 11, "dragon_curve.png", rules)