From 3f45cddfb18089e448ebc520494eba32c03e2799 Mon Sep 17 00:00:00 2001 From: LordBaryhobal Date: Sun, 3 Dec 2023 11:24:33 +0100 Subject: [PATCH] minor improvement --- src/day3/Puzzle1.scala | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/day3/Puzzle1.scala b/src/day3/Puzzle1.scala index 04f0fcc..d797681 100644 --- a/src/day3/Puzzle1.scala +++ b/src/day3/Puzzle1.scala @@ -63,8 +63,8 @@ object Puzzle1 { var y: Int = 0 var x: Int = 0 - while (y < schematic.length) { - while (x < schematic(y).length) { + while (y < height) { + while (x < width) { val c: Char = schematic(y)(x) if ('0' <= c && c <= '9') { val number: String = getNumber(x, y)