12345678910111213141516171819202122232425 |
- #!/usr/bin/ruby
- # https://rosettacode.org/wiki/Peano_curve
- include('LSystem/LSystem.sf')
- var rules = Hash(
- l => 'lFrFl-F-rFlFr+F+lFrFl',
- r => 'rFlFr+F+lFrFl-F-rFlFr',
- )
- var lsys = LSystem(
- width: 500,
- height: 500,
- xoff: -50,
- yoff: -50,
- len: 5,
- angle: 90,
- color: 'dark green',
- )
- lsys.execute('l', 4, "peano_curve.png", rules)
|