ludus-scripts/10print.ld

50 lines
641 B
Plaintext

let cell_size = 10
let slash_length = mult(cell_size, sqrt(2))
let cols = 20
let rows = 4
penwidth!(3)
fn forward_slash! () -> {
pd!()
rt!(0.125)
fd!(slash_length)
pu!()
bk!(slash_length)
lt!(0.125)
}
fn back_slash! () -> {
pu!()
fd!(cell_size)
pd!()
rt!(0.375)
fd!(slash_length)
pu!()
lt!(0.125)
bk!(cell_size)
lt!(0.25)
}
fn next_cell! () -> {
pu!()
rt!(0.25)
fd!(cell_size)
lt!(0.25)
}
repeat rows {
repeat cols {
if random([true, false])
then forward_slash!()
else back_slash!()
next_cell!()
}
lt!(0.25)
fd!(mult(cols, cell_size))
rt!(0.25)
back!(cell_size)
}