3 ms·
That code looks exactly like the LOGO-like language aimed towards children. I wrote during a hackathon[0]. But for compactness I forgo the newlines, so the lang
by siraben 5y ago
That code looks exactly like the LOGO-like language aimed towards children. I wrote during a hackathon[0]. But for compactness I forgo the newlines, so the language looks like this:
△ n = [ ↻ 30, ↑ n, ↻ 120, ↑ n, ↻ 120, ↑ n, right ]
When programming routines in Haskell:
square :: Float -> Turtle ()
square n = do
penDown
moveForward n
rotateTurtle 90
moveForward n
rotateTurtle 90
moveForward n
rotateTurtle 90
moveForward n
rotateTurtle 90
penUp
Recursion is forbidden and all loops are bounded.
[0] https://github.com/siraben/vpl/blob/4b5d39cbf8d16a988218e62f9cca5110ab794c4c/src/VPLEval.hs#L102 https://github.com/siraben/vpl/blob/4b5d39cbf8d16a988218e62f...