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}
|
return {...prev_state, visible: false}
|
||||||
}
|
}
|
||||||
case "background": {
|
case "background": {
|
||||||
background_color = curr_command.slice(1)
|
background_color = curr_command[1]
|
||||||
return prev_state
|
return prev_state
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -332,7 +332,7 @@ export function p5_calls (commands) {
|
||||||
p5_calls.push(call)
|
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)
|
p5_render_turtle(states[states.length - 1], p5_calls)
|
||||||
return p5_calls
|
return p5_calls
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,15 +1,15 @@
|
||||||
import {run, svg} from "./ludus.mjs"
|
import {run, svg} from "./ludus.mjs"
|
||||||
|
|
||||||
const code = `
|
const code = `
|
||||||
repeat 20 {
|
print! (random ())
|
||||||
repeat 100 {
|
print! (random ())
|
||||||
fd! (4)
|
print! (random ())
|
||||||
rt! (0.01)
|
print! (random ())
|
||||||
}
|
print! (random ())
|
||||||
pencolor! (random (colors))
|
print! (random ())
|
||||||
rt! (inv (20))
|
|
||||||
}`
|
`
|
||||||
|
|
||||||
const result = run(code)
|
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