1234567891011121314151617181920212223242526 |
- #!/usr/bin/ruby
- # https://rosettacode.org/wiki/Sierpinski_arrowhead_curve
- include('LSystem/LSystem.sf')
- var rules = Hash(
- x => 'yF+xF+y',
- y => 'xF-yF-x',
- )
- var lsys = LSystem(
- width: 550,
- height: 500,
- xoff: -20,
- yoff: -30,
- len: 4,
- turn: -90,
- angle: 60,
- color: 'dark green',
- )
- lsys.execute('xF', 7, "sierpiński_arrowhead_curve.png", rules)
|