massage prelude into multiturtles; wip

This commit is contained in:
Scott Richmond 2025-07-05 15:57:05 -04:00
parent 4988ea6626
commit f1f954de46
2 changed files with 10 additions and 10 deletions

View File

@ -1071,49 +1071,49 @@ fn add_command! (turtle_id, command) -> {
} }
fn forward! { fn forward! {
"Moves the turtle forward by a number of steps. Alias: fd!" "Moves the turtle forward by a number of steps. Alias: `fd!`"
(steps as :number) -> add_command! (:turtle_0, (:forward, steps)) (steps as :number) -> add_command! (:turtle_0, (:forward, steps))
} }
let fd! = forward! let fd! = forward!
fn back! { fn back! {
"Moves the turtle backward by a number of steps. Alias: bk!" "Moves the turtle backward by a number of steps. Alias: `bk!`"
(steps as :number) -> add_command! (:turtle_0, (:back, steps)) (steps as :number) -> add_command! (:turtle_0, (:back, steps))
} }
let bk! = back! let bk! = back!
fn left! { fn left! {
"Rotates the turtle left, measured in turns. Alias: lt!" "Rotates the turtle left, measured in turns. Alias: `lt!`"
(turns as :number) -> add_command! (:turtle_0, (:left, turns)) (turns as :number) -> add_command! (:turtle_0, (:left, turns))
} }
let lt! = left! let lt! = left!
fn right! { fn right! {
"Rotates the turtle right, measured in turns. Alias: rt!" "Rotates the turtle right, measured in turns. Alias: `rt!`"
(turns as :number) -> add_command! (:turtle_0, (:right, turns)) (turns as :number) -> add_command! (:turtle_0, (:right, turns))
} }
let rt! = right! let rt! = right!
fn penup! { fn penup! {
"Lifts the turtle's pen, stopping it from drawing. Alias: pu!" "Lifts the turtle's pen, stopping it from drawing. Alias: `pu!`"
() -> add_command! (:turtle_0, (:penup)) () -> add_command! (:turtle_0, (:penup))
} }
let pu! = penup! let pu! = penup!
fn pendown! { fn pendown! {
"Lowers the turtle's pen, causing it to draw. Alias: pd!" "Lowers the turtle's pen, causing it to draw. Alias: `pd!`"
() -> add_command! (:turtle_0, (:pendown)) () -> add_command! (:turtle_0, (:pendown))
} }
let pd! = pendown! let pd! = pendown!
fn pencolor! { fn pencolor! {
"Changes the turtle's pen color. Takes a single grayscale value, an rgb tuple, or an rgba tuple. Alias: pc!" "Changes the turtle's pen color. Takes a single grayscale value, an rgb tuple, or an rgba tuple. Alias: `pencolour!`, `pc!`"
(color as :keyword) -> add_command! (:turtle_0, (:pencolor, color)) (color as :keyword) -> add_command! (:turtle_0, (:pencolor, color))
(gray as :number) -> add_command! (:turtle_0, (:pencolor, (gray, gray, gray, 255))) (gray as :number) -> add_command! (:turtle_0, (:pencolor, (gray, gray, gray, 255)))
((r as :number, g as :number, b as :number)) -> add_command! (:turtle_0, (:pencolor, (r, g, b, 255))) ((r as :number, g as :number, b as :number)) -> add_command! (:turtle_0, (:pencolor, (r, g, b, 255)))
@ -1125,14 +1125,14 @@ let pencolour! = pencolor!
let pc! = pencolor! let pc! = pencolor!
fn penwidth! { fn penwidth! {
"Sets the width of the turtle's pen, measured in pixels. Alias: pw!" "Sets the width of the turtle's pen, measured in pixels. Alias: `pw!`"
(width as :number) -> add_command! (:turtle_0, (:penwidth, width)) (width as :number) -> add_command! (:turtle_0, (:penwidth, width))
} }
let pw! = penwidth! let pw! = penwidth!
fn background! { fn background! {
"Sets the background color behind the turtle and path. Alias: bg!" "Sets the background color behind the turtle and path. Alias: `bg!`"
(color as :keyword) -> add_command! (:turtle_0, (:background, color)) (color as :keyword) -> add_command! (:turtle_0, (:background, color))
(gray as :number) -> add_command! (:turtle_0, (:background, (gray, gray, gray, 255))) (gray as :number) -> add_command! (:turtle_0, (:background, (gray, gray, gray, 255)))
((r as :number, g as :number, b as :number)) -> add_command! (:turtle_0, (:background, (r, g, b, 255))) ((r as :number, g as :number, b as :number)) -> add_command! (:turtle_0, (:background, (r, g, b, 255)))
@ -1234,7 +1234,7 @@ fn pendown? {
} }
fn pencolor { fn pencolor {
"Returns the turtle's pen color as an (r, g, b, a) tuple or keyword." "Returns the turtle's pen color as an (r, g, b, a) tuple or keyword. Alias: `pencolour`."
() -> do turtle_states > unbox > :turtle_0 > :pencolor () -> do turtle_states > unbox > :turtle_0 > :pencolor
} }

Binary file not shown.