Compare commits

...

7 Commits

Author SHA1 Message Date
ec8d27fa4c trying lfs again
Former-commit-id: 8d6026d934
2025-07-07 15:53:20 -04:00
Scott Richmond
406247d10d premerge
Former-commit-id: 2619e3ee56
2025-07-07 15:49:13 -04:00
Scott Richmond
597719b6aa release build
Former-commit-id: 7e1034f7d1
2025-07-07 15:45:03 -04:00
Scott Richmond
f18bcbd4b6 remove process return spam
Former-commit-id: 5ee4d87db7
2025-07-07 15:44:08 -04:00
882a623257 Merge branch 'main' of alea.ludus.dev:twc/ludus
Former-commit-id: 3360e0d96b
2025-07-07 13:53:11 -04:00
Scott Richmond
5272c5030c release build
Former-commit-id: 14e4cf93ae
2025-07-07 13:25:50 -04:00
Scott Richmond
e3a9ffc481 improve svg background box logic
Former-commit-id: 4134a69fcc
2025-07-07 13:25:31 -04:00
6 changed files with 17 additions and 18 deletions

4
pkg/rudus.d.ts vendored
View File

@ -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;
}

View File

@ -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)

Binary file not shown.

View File

@ -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;

View File

@ -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

View File

@ -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) {