From 37bb33ee55a098880adcf8f8efbcc7265853dc5e Mon Sep 17 00:00:00 2001 From: Dmitrii Morozov Date: Mon, 23 Jun 2025 13:37:33 +0200 Subject: Fix out of range problem --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index 4e19d97..99dee7f 100755 --- a/index.html +++ b/index.html @@ -40,7 +40,7 @@ let j = 0; for (let i = 0; i < targetCount; i++) { - while (j < distances.length - 1 && distances[j+1] < targetDist) j++; + while (j < distances.length - 2 && distances[j+1] < targetDist) j++; const d1 = distances[j]; const d2 = distances[j+1]; -- cgit v1.2.3