Compare commits
7 Commits
8d6026d934
...
ec8d27fa4c
Author | SHA1 | Date | |
---|---|---|---|
ec8d27fa4c | |||
|
406247d10d | ||
|
597719b6aa | ||
|
f18bcbd4b6 | ||
882a623257 | |||
|
5272c5030c | ||
|
e3a9ffc481 |
4
pkg/rudus.d.ts
vendored
4
pkg/rudus.d.ts
vendored
|
@ -14,8 +14,8 @@ export interface InitOutput {
|
|||
readonly __wbindgen_malloc: (a: number, b: number) => number;
|
||||
readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
||||
readonly __wbindgen_export_6: WebAssembly.Table;
|
||||
readonly closure353_externref_shim: (a: number, b: number, c: any) => void;
|
||||
readonly closure366_externref_shim: (a: number, b: number, c: any, d: any) => void;
|
||||
readonly closure355_externref_shim: (a: number, b: number, c: any) => void;
|
||||
readonly closure368_externref_shim: (a: number, b: number, c: any, d: any) => void;
|
||||
readonly __wbindgen_start: () => void;
|
||||
}
|
||||
|
||||
|
|
|
@ -146,11 +146,11 @@ export function ludus(src) {
|
|||
}
|
||||
|
||||
function __wbg_adapter_18(arg0, arg1, arg2) {
|
||||
wasm.closure353_externref_shim(arg0, arg1, arg2);
|
||||
wasm.closure355_externref_shim(arg0, arg1, arg2);
|
||||
}
|
||||
|
||||
function __wbg_adapter_44(arg0, arg1, arg2, arg3) {
|
||||
wasm.closure366_externref_shim(arg0, arg1, arg2, arg3);
|
||||
wasm.closure368_externref_shim(arg0, arg1, arg2, arg3);
|
||||
}
|
||||
|
||||
async function __wbg_load(module, imports) {
|
||||
|
@ -306,8 +306,8 @@ function __wbg_get_imports() {
|
|||
const ret = false;
|
||||
return ret;
|
||||
};
|
||||
imports.wbg.__wbindgen_closure_wrapper1089 = function(arg0, arg1, arg2) {
|
||||
const ret = makeMutClosure(arg0, arg1, 354, __wbg_adapter_18);
|
||||
imports.wbg.__wbindgen_closure_wrapper1080 = function(arg0, arg1, arg2) {
|
||||
const ret = makeMutClosure(arg0, arg1, 356, __wbg_adapter_18);
|
||||
return ret;
|
||||
};
|
||||
imports.wbg.__wbindgen_init_externref_table = function() {
|
||||
|
|
BIN
pkg/rudus_bg.wasm
(Stored with Git LFS)
BIN
pkg/rudus_bg.wasm
(Stored with Git LFS)
Binary file not shown.
4
pkg/rudus_bg.wasm.d.ts
vendored
4
pkg/rudus_bg.wasm.d.ts
vendored
|
@ -9,6 +9,6 @@ export const __wbindgen_free: (a: number, b: number, c: number) => void;
|
|||
export const __wbindgen_malloc: (a: number, b: number) => number;
|
||||
export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
||||
export const __wbindgen_export_6: WebAssembly.Table;
|
||||
export const closure353_externref_shim: (a: number, b: number, c: any) => void;
|
||||
export const closure366_externref_shim: (a: number, b: number, c: any, d: any) => void;
|
||||
export const closure355_externref_shim: (a: number, b: number, c: any) => void;
|
||||
export const closure368_externref_shim: (a: number, b: number, c: any, d: any) => void;
|
||||
export const __wbindgen_start: () => void;
|
||||
|
|
|
@ -79,7 +79,7 @@ export function svg (commands, code) {
|
|||
const new_state = command_to_state(prev_state, this_command)
|
||||
all_states[turtle_id].push(new_state)
|
||||
}
|
||||
let maxX = -Infinity, maxY = -Infinity, minX = Infinity, minY = Infinity
|
||||
let maxX = 0, maxY = 0, minX = 0, minY = 0
|
||||
for (const states of Object.values(all_states)) {
|
||||
for (const {position: [x, y]} of states) {
|
||||
maxX = Math.max(maxX, x)
|
||||
|
@ -90,8 +90,8 @@ export function svg (commands, code) {
|
|||
}
|
||||
const [r, g, b] = resolve_color(background_color)
|
||||
if ((r+g+b)/3 > 128) set_turtle_color([0, 0, 0, 150])
|
||||
const view_width = (maxX - minX) * 1.2
|
||||
const view_height = (maxY - minY) * 1.2
|
||||
const view_width = Math.max((maxX - minX) * 1.2, 200)
|
||||
const view_height = Math.max((maxY - minY) * 1.2, 200)
|
||||
const margin = Math.max(view_width, view_height) * 0.1
|
||||
const x_origin = minX - margin
|
||||
const y_origin = -maxY - margin
|
||||
|
|
|
@ -503,11 +503,10 @@ impl World {
|
|||
|
||||
fn report_process_end(&mut self) {
|
||||
let result = self.active_result().clone().unwrap();
|
||||
let msg = match result {
|
||||
Ok(value) => format!("Process {} returned with {}", self.active_id().unwrap(), value.show()),
|
||||
Err(panic) => format!("Process {} panicked with {}", self.active_id().unwrap(), crate::errors::panic(panic))
|
||||
};
|
||||
self.send_ludus_msg(msg);
|
||||
if let Err(panic) = result {
|
||||
let msg = format!("Process :{} panicked: {}", self.active_id().unwrap(), crate::errors::panic(panic));
|
||||
self.send_ludus_msg(msg)
|
||||
}
|
||||
}
|
||||
|
||||
pub async fn run(&mut self) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user