From 13856cb8b23206b1c34604316f5ca8029aa15f4f Mon Sep 17 00:00:00 2001 From: Scott Richmond Date: Wed, 23 Oct 2024 16:44:51 -0400 Subject: [PATCH] fix penwidth bug --- build/ludus.mjs | 3 ++- build/p5_test.mjs | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) 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)