> For the complete documentation index, see [llms.txt](https://trizen.gitbook.io/sidef-lang/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://trizen.gitbook.io/sidef-lang/programming_tasks/p/penrose_tiling.md).

# Penrose tiling

Using the LSystem class defined at [Hilbert curve](https://rosettacode.org/wiki/Hilbert_curve#Sidef).

```ruby
var rules = Hash(
    a => 'cE++dE----bE[-cE----aE]++',
    b => '+cE--dE[---aE--bE]+',
    c => '-aE++bE[+++cE++dE]-',
    d => '--cE++++aE[+dE++++bE]--bE',
    E => '',
)

var lsys = LSystem(
    width:  1000,
    height: 1000,

    scale: 1,
    xoff: -500,
    yoff: -500,

    len:   40,
    angle: 36,
    color: 'dark blue',
)

lsys.execute('[b]++[b]++[b]++[b]++[b]', 5, "penrose_tiling.png", rules)
```

Output image: [Penrose tiling](https://github.com/trizen/rc/blob/master/img/penrose-tiling-sidef.png)
