wia/code/escape/hilbert.jl

22 lines
452 B
Julia

using Lindenmayer, Luxor
f(t::Turtle) = begin
t.pencolor = (0.0,0.0,0.0)
setline(4)
end
hilbert_curve = LSystem(Dict(
"L" => "*+RF-LFL-tFR+",
"R" => "*-LF+RFR+FL-"),
"3L")
drawLSystem(hilbert_curve,
forward = 25,
turn = 90,
iterations = 4,
startingx = -200,
startingy = -200,
filename = "./images/hilbert_curve.png",
backgroundcolor = "white",
asteriskfunction = f,
showpreview = true)