> 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/k/koch_curve.md).

# Koch curve

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

```ruby
var rules = Hash(
    F => 'F+F--F+F',
)

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

    xoff: -210,
    yoff: -90,

    len:   8,
    angle: 60,
    color: 'dark green',
)

lsys.execute('F--F--F', 4, "koch_snowflake.png", rules)
```

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