build
This commit is contained in:
parent
5ed314de15
commit
066edb00b5
Binary file not shown.
|
@ -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 {
|
||||
|
|
BIN
build/out.wasm
BIN
build/out.wasm
Binary file not shown.
|
@ -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)
|
||||
|
||||
|
|
|
@ -1,106 +1,41 @@
|
|||
<?xml version="1.0" standalone="no"?>
|
||||
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" style="background-color:rgb(0 0 0); background-opacity: 1" viewBox="-866.0173929337993 -866.0173929338016 1676.162696000903 1676.1626960009057">
|
||||
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" style="background-color:rgb(0 0 0); background-opacity: 1" viewBox="NaN NaN NaN 120">
|
||||
|
||||
<g transform="scale(-1, 1) rotate(180)">
|
||||
|
||||
<line x1="0" y1="0" x2="3.061616997868383e-14" y2="500" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
|
||||
<line x1="0" y1="0" x2="6.123233995736766e-15" y2="100" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
|
||||
|
||||
<line x1="3.061616997868383e-14" y1="500" x2="500.00000000000006" y2="500" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
|
||||
<line x1="6.123233995736766e-15" y1="100" x2="100" y2="100" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
|
||||
|
||||
<line x1="500.00000000000006" y1="500" x2="500.0000000000001" y2="0" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
|
||||
<line x1="100" y1="100" x2="0,0" y2="0" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
|
||||
|
||||
<line x1="500.0000000000001" y1="0" x2="1.1368683772161603e-13" y2="-6.123233995736766e-14" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
|
||||
|
||||
<line x1="1.1368683772161603e-13" y1="-6.123233995736766e-14" x2="293.892626146237" y2="404.50849718747344" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
|
||||
|
||||
<line x1="293.892626146237" y1="404.50849718747344" x2="698.4011233337105" y2="110.61587104123663" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
|
||||
|
||||
<line x1="698.4011233337105" y1="110.61587104123663" x2="404.50849718747384" y2="-293.892626146237" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
|
||||
|
||||
<line x1="404.50849718747384" y1="-293.892626146237" x2="2.2737367544323206e-13" y2="-2.8421709430404007e-13" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
|
||||
|
||||
<line x1="2.2737367544323206e-13" y1="-2.8421709430404007e-13" x2="475.5282581475771" y2="154.5084971874731" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
|
||||
|
||||
<line x1="475.5282581475771" y1="154.5084971874731" x2="630.0367553350503" y2="-321.01976096010384" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
|
||||
|
||||
<line x1="630.0367553350503" y1="-321.01976096010384" x2="154.50849718747332" y2="-475.528258147577" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
|
||||
|
||||
<line x1="154.50849718747332" y1="-475.528258147577" x2="-2.842170943040401e-14" y2="-1.1368683772161603e-13" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
|
||||
|
||||
<line x1="-2.842170943040401e-14" y1="-1.1368683772161603e-13" x2="475.5282581475765" y2="-154.5084971874746" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
|
||||
|
||||
<line x1="475.5282581475765" y1="-154.5084971874746" x2="321.01976096010196" y2="-630.0367553350511" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
|
||||
|
||||
<line x1="321.01976096010196" y1="-630.0367553350511" x2="-154.50849718747457" y2="-475.5282581475766" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
|
||||
|
||||
<line x1="-154.50849718747457" y1="-475.5282581475766" x2="1.1368683772161603e-12" y2="-4.547473508864641e-13" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
|
||||
|
||||
<line x1="1.1368683772161603e-12" y1="-4.547473508864641e-13" x2="293.8926261462368" y2="-404.5084971874748" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
|
||||
|
||||
<line x1="293.8926261462368" y1="-404.5084971874748" x2="-110.61587104123754" y2="-698.4011233337105" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
|
||||
|
||||
<line x1="-110.61587104123754" y1="-698.4011233337105" x2="-404.5084971874731" y2="-293.89262614623607" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
|
||||
|
||||
<line x1="-404.5084971874731" y1="-293.89262614623607" x2="1.3642420526593924e-12" y2="-5.115907697472721e-13" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
|
||||
|
||||
<line x1="1.3642420526593924e-12" y1="-5.115907697472721e-13" x2="1.3948582226380762e-12" y2="-500.0000000000005" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
|
||||
|
||||
<line x1="1.3948582226380762e-12" y1="-500.0000000000005" x2="-499.9999999999986" y2="-500.00000000000057" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
|
||||
|
||||
<line x1="-499.9999999999986" y1="-500.00000000000057" x2="-499.9999999999987" y2="-5.684341886080801e-13" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
|
||||
|
||||
<line x1="-499.9999999999987" y1="-5.684341886080801e-13" x2="1.3073986337985843e-12" y2="-5.684341886080801e-13" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
|
||||
|
||||
<line x1="1.3073986337985843e-12" y1="-5.684341886080801e-13" x2="-293.8926261462343" y2="-404.508497187475" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
|
||||
|
||||
<line x1="-293.8926261462343" y1="-404.508497187475" x2="-698.4011233337087" y2="-110.61587104123936" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
|
||||
|
||||
<line x1="-698.4011233337087" y1="-110.61587104123936" x2="-404.5084971874733" y2="293.8926261462352" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
|
||||
|
||||
<line x1="-404.5084971874733" y1="293.8926261462352" x2="1.0800249583553523e-12" y2="-4.547473508864641e-13" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
|
||||
|
||||
<line x1="1.0800249583553523e-12" y1="-4.547473508864641e-13" x2="-475.528258147575" y2="-154.5084971874763" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
|
||||
|
||||
<line x1="-475.528258147575" y1="-154.5084971874763" x2="-630.0367553350509" y2="321.0197609600998" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
|
||||
|
||||
<line x1="-630.0367553350509" y1="321.0197609600998" x2="-154.50849718747486" y2="475.52825814757574" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
|
||||
|
||||
<line x1="-154.50849718747486" y1="475.52825814757574" x2="9.663381206337363e-13" y2="-3.410605131648481e-13" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
|
||||
|
||||
<line x1="9.663381206337363e-13" y1="-3.410605131648481e-13" x2="-475.5282581475769" y2="154.50849718747014" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
|
||||
|
||||
<line x1="-475.5282581475769" y1="154.50849718747014" x2="-321.0197609601066" y2="630.0367553350482" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
|
||||
|
||||
<line x1="-321.0197609601066" y1="630.0367553350482" x2="154.50849718747122" y2="475.5282581475776" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
|
||||
|
||||
<line x1="154.50849718747122" y1="475.5282581475776" x2="7.105427357601002e-13" y2="-2.2737367544323206e-13" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
|
||||
|
||||
<line x1="7.105427357601002e-13" y1="-2.2737367544323206e-13" x2="-293.89262614623954" y2="404.5084971874708" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
|
||||
|
||||
<line x1="-293.89262614623954" y1="404.5084971874708" x2="110.61587104123151" y2="698.401123333711" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
|
||||
|
||||
<line x1="110.61587104123151" y1="698.401123333711" x2="404.5084971874717" y2="293.8926261462399" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
|
||||
|
||||
<line x1="404.5084971874717" y1="293.8926261462399" x2="6.252776074688882e-13" y2="-2.8421709430404007e-13" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
|
||||
<line x1="0,0" y1="0" x2="0,0100" y2="0" stroke="rgb(0 0 0)" stroke-opacity="1" stroke-width="white"/>
|
||||
|
||||
|
||||
<g transform="translate(6.252776074688882e-13, -2.8421709430404007e-13)rotate(359.9999999999994)">
|
||||
<g transform="translate(0,0100, 0)rotate(90)">
|
||||
<polygon points="0 20 -13.226237306473037 -15.00222139260919 13.226237306473037 -15.00222139260919" stroke="none" fill="rgb(255 255 255)" fill-opacity="0.5882352941176471"/>
|
||||
<line x1="0" y1="20" x2="0" y2="0" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1" />
|
||||
<line x1="0" y1="20" x2="0" y2="0" stroke="rgb(0 0 0)" stroke-opacity="1" stroke-width="white" />
|
||||
</g>
|
||||
|
||||
</g>
|
||||
|
||||
<ludus>
|
||||
|
||||
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
|
||||
|
||||
|
||||
</ludus>
|
||||
</svg>
|
||||
|
||||
|
|
Before Width: | Height: | Size: 7.7 KiB After Width: | Height: | Size: 1.2 KiB |
|
@ -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))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user