Skip to content
This repository was archived by the owner on Jul 10, 2024. It is now read-only.

Commit 77aae16

Browse files
committed
fix: move variables
1 parent 6265c65 commit 77aae16

File tree

1 file changed

+12
-13
lines changed

1 file changed

+12
-13
lines changed

src/script.ts

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,9 @@ let y2: number;
7878
let flr2: Lvl;
7979
let sx1: number;
8080
let sy1: number;
81+
let px = 1;
82+
let py = 1;
83+
let old: number;
8184

8285
library.add(
8386
faXmark,
@@ -405,15 +408,15 @@ function pathCalculationInternals(
405408

406409
Object.values(stairs).forEach(
407410
([first, second]: Coords2D, index: number): void => {
408-
const distance =
409-
Math.abs(x1 - first) +
410-
Math.abs(y1 - second) +
411-
Math.abs(x2 - first) +
412-
Math.abs(y2 - second);
413-
414-
if (distance < minData.min) {
415-
minData = { min: distance, minIndex: index };
416-
}
411+
const distance =
412+
Math.abs(x1 - first) +
413+
Math.abs(y1 - second) +
414+
Math.abs(x2 - first) +
415+
Math.abs(y2 - second);
416+
417+
if (distance < minData.min) {
418+
minData = { min: distance, minIndex: index };
419+
}
417420
},
418421
);
419422

@@ -650,10 +653,6 @@ async function startApp(): Promise<void> {
650653
}
651654
window.startApp = startApp;
652655

653-
let px = 1;
654-
let py = 1;
655-
let old: number;
656-
657656
function onKeyDown(event: KeyboardEvent): void {
658657
switch (viewLvl) {
659658
case 1: {

0 commit comments

Comments
 (0)