From b40b1c48405be6b25de58885fe909010a77ac1f5 Mon Sep 17 00:00:00 2001 From: "Maurits van Riezen (mousetail)" Date: Wed, 13 Mar 2024 20:31:38 +0100 Subject: [PATCH] simplify cursor logic --- src/scripts/interpreter.ts | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/scripts/interpreter.ts b/src/scripts/interpreter.ts index bc730f2..93520c5 100644 --- a/src/scripts/interpreter.ts +++ b/src/scripts/interpreter.ts @@ -289,11 +289,6 @@ export function step(o: ProgramState) { o.cursor[0] += o.cursor_direction[0]; o.cursor[1] += o.cursor_direction[1]; - const program_size = [ - o.program.reduce((a, b) => Math.max(a, b.length), 0), - o.program.length - ] - - o.cursor[1] = (o.cursor[1] + o.program.length[1]) % o.program.length[1]; + o.cursor[1] = (o.cursor[1] + o.program.length) % o.program.length; o.cursor[0] = (o.cursor[0] + o.program[o.cursor[1]].length) % o.program[o.cursor[1]].length; } \ No newline at end of file