diff --git a/build/ludus.mjs b/build/ludus.mjs index 602863a..ddd35cc 100644 --- a/build/ludus.mjs +++ b/build/ludus.mjs @@ -121,7 +121,7 @@ function command_to_state (prev_state, curr_command) { case "pendown": { return {...prev_state, pendown: true} } - case "pendwith": { + case "penwidth": { const [_, width] = curr_command return {...prev_state, penwidth: width} } @@ -349,6 +349,7 @@ export function p5 (commands) { states.push(new_state) return new_state }, turtle_init) + console.log(states) const p5_calls = [...p5_call_root] for (let i = 1; i < states.length; ++i) { const prev = states[i - 1] diff --git a/build/p5_test.mjs b/build/p5_test.mjs index 10b0d9d..78cfc9f 100644 --- a/build/p5_test.mjs +++ b/build/p5_test.mjs @@ -4,6 +4,7 @@ const code = ` print! ("Hello, world!") pencolor! (colors :white) fd! (50) +pw! (3) ` const result = run(code)