build
This commit is contained in:
parent
d477782ff6
commit
ea80f81c33
|
@ -139,7 +139,7 @@ function command_to_state (prev_state, curr_command) {
|
|||
return {...prev_state, visible: false}
|
||||
}
|
||||
case "background": {
|
||||
background_color = curr_command.slice(1)
|
||||
background_color = curr_command[1]
|
||||
return prev_state
|
||||
}
|
||||
}
|
||||
|
@ -332,7 +332,7 @@ export function p5_calls (commands) {
|
|||
p5_calls.push(call)
|
||||
}
|
||||
}
|
||||
p5_calls[0] = ["background", background_color]
|
||||
p5_calls[0] = ["background", ...resolve_color(background_color)]
|
||||
p5_render_turtle(states[states.length - 1], p5_calls)
|
||||
return p5_calls
|
||||
}
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
import {run, svg} from "./ludus.mjs"
|
||||
|
||||
const code = `
|
||||
repeat 20 {
|
||||
repeat 100 {
|
||||
fd! (4)
|
||||
rt! (0.01)
|
||||
}
|
||||
pencolor! (random (colors))
|
||||
rt! (inv (20))
|
||||
}`
|
||||
print! (random ())
|
||||
print! (random ())
|
||||
print! (random ())
|
||||
print! (random ())
|
||||
print! (random ())
|
||||
print! (random ())
|
||||
|
||||
`
|
||||
|
||||
const result = run(code)
|
||||
|
||||
console.log(svg(result.io.turtle.data))
|
||||
console.log(result.io.stdout.data)
|
||||
|
|
4007
build/svg_test.svg
4007
build/svg_test.svg
File diff suppressed because it is too large
Load Diff
Before Width: | Height: | Size: 722 B After Width: | Height: | Size: 338 KiB |
Loading…
Reference in New Issue
Block a user