ludus/build/svg_test.mjs

23 lines
292 B
JavaScript
Raw Permalink Normal View History

2024-11-03 22:19:11 +00:00
import {run, svg, stdout} from "./ludus.mjs"
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
`
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))