diff --git a/build/ludus.jimage b/build/ludus.jimage index 7bec23f..b8f27dc 100644 Binary files a/build/ludus.jimage and b/build/ludus.jimage differ diff --git a/build/out.mjs b/build/out.mjs index 291715c..6db76f1 100644 --- a/build/out.mjs +++ b/build/out.mjs @@ -6489,7 +6489,7 @@ var __emscripten_stack_alloc = (a0) => (__emscripten_stack_alloc = wasmExports[' var _emscripten_stack_get_current = () => (_emscripten_stack_get_current = wasmExports['emscripten_stack_get_current'])(); var ___cxa_is_pointer_type = createExportWrapper('__cxa_is_pointer_type', 1); var dynCall_jiji = Module['dynCall_jiji'] = createExportWrapper('dynCall_jiji', 5); -var ___emscripten_embedded_file_data = Module['___emscripten_embedded_file_data'] = 1819956; +var ___emscripten_embedded_file_data = Module['___emscripten_embedded_file_data'] = 1820168; function invoke_i(index) { var sp = stackSave(); try { diff --git a/build/out.wasm b/build/out.wasm index f85d1f2..12f69a9 100755 Binary files a/build/out.wasm and b/build/out.wasm differ diff --git a/build/svg_test.mjs b/build/svg_test.mjs index bfea4b6..1594d67 100644 --- a/build/svg_test.mjs +++ b/build/svg_test.mjs @@ -1,14 +1,21 @@ import {run, svg} from "./ludus.mjs" const code = ` -pencolor! (colors :white) -repeat 10 { - repeat 4 { - fd! (500) - rt! (0.25) - } - rt! (0.1) -}` + +let home = unbox (turtle_state) + +fd! (100) +rt! (0.25) +fd! (100) + +loadstate! (home) + +rt! (0.25) +fd! (100) + +do turtle_state > unbox + +` const result = run(code) diff --git a/build/svg_test.svg b/build/svg_test.svg index 8b9d844..ee87a49 100644 --- a/build/svg_test.svg +++ b/build/svg_test.svg @@ -1,106 +1,41 @@ - + - + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + - + -pencolor! (colors :white) -repeat 10 { - repeat 4 { - fd! (500) - rt! (0.25) - } - rt! (0.1) -} + +let home = unbox (turtle_state) + +fd! (100) +rt! (0.25) +fd! (100) + +loadstate! (home) + +rt! (0.25) +fd! (100) + +do turtle_state > unbox + + diff --git a/prelude.ld b/prelude.ld index 76c50c9..683fe67 100644 --- a/prelude.ld +++ b/prelude.ld @@ -1227,8 +1227,8 @@ fn hideturtle! { fn loadstate! { "Sets the turtle state to a previously saved state." (state) -> { - let #{position, heading, pendown?, pencolor, penwidth, visible?} = state - add_command! ((:loadstate, position, heading, visible?, pendown?, penwidth, pencolor)) + let #{:position (x, y), heading, pendown?, pencolor, penwidth, visible?} = state + add_command! ((:loadstate, x, y, heading, visible?, pendown?, penwidth, pencolor)) } }