2024-11-03 22:19:11 +00:00
|
|
|
import {run, svg, stdout} from "./ludus.mjs"
|
2024-07-31 23:25:22 +00:00
|
|
|
|
|
|
|
const code = `
|
2024-11-03 22:19:11 +00:00
|
|
|
let start = unbox (turtle_state)
|
2024-11-03 21:45:20 +00:00
|
|
|
fd! (100)
|
2024-11-03 22:19:11 +00:00
|
|
|
rt! (0.25)
|
|
|
|
fd! (100)
|
2024-11-03 21:45:20 +00:00
|
|
|
|
2024-11-03 22:19:11 +00:00
|
|
|
loadstate! (start)
|
|
|
|
& home! ()
|
2024-11-03 21:45:20 +00:00
|
|
|
|
|
|
|
rt! (0.25)
|
|
|
|
fd! (100)
|
2024-11-03 22:19:11 +00:00
|
|
|
lt! (0.25)
|
2024-11-03 21:45:20 +00:00
|
|
|
|
|
|
|
`
|
2024-07-31 23:25:22 +00:00
|
|
|
|
|
|
|
const result = run(code)
|
|
|
|
|
2024-11-03 22:19:11 +00:00
|
|
|
// console.log(stdout(result))
|
|
|
|
|
2024-08-01 22:50:09 +00:00
|
|
|
console.log(svg(result.io.turtle.data))
|