ludus-scripts/koch.ld

22 lines
275 B
Plaintext
Raw Normal View History

2024-06-11 21:37:04 +00:00
& koch curve
let length = 10
let angle = 0.25
2024-06-11 21:37:04 +00:00
fn koch! {
(0) -> fd! (length)
(n) -> {
koch! (dec (n))
lt! (angle)
2024-06-11 21:37:04 +00:00
koch! (dec (n))
rt! (angle)
2024-06-11 21:37:04 +00:00
koch! (dec (n))
rt! (angle)
2024-06-11 21:37:04 +00:00
koch! (dec (n))
lt! (angle)
2024-06-11 21:37:04 +00:00
koch! (dec (n))
}
}
& koch! (3)