12345678910111213141516171819202122232425 |
- #!/usr/bin/ruby
- # https://rosettacode.org/wiki/Hilbert_curve
- include('LSystem/LSystem.sf')
- var rules = Hash(
- a => '-bF+aFa+Fb-',
- b => '+aF-bFb-Fa+',
- )
- var lsys = LSystem(
- width: 600,
- height: 600,
- xoff: -50,
- yoff: -50,
- len: 8,
- angle: 90,
- color: 'dark green',
- )
- lsys.execute('a', 6, "hilbert_curve.png", rules)
|