From 3a51c2997b7542eb3492e2b9b1e212d641e1852c Mon Sep 17 00:00:00 2001 From: twentylemon Date: Sat, 14 Dec 2024 23:58:42 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20rename=20`Quadrants#seq`=20to=20?= =?UTF-8?q?`toSeq`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/scala/org/lemon/advent/lib/2d/Area.scala | 2 +- src/main/scala/org/lemon/advent/year2024/Day14.scala | 2 +- src/test/scala/org/lemon/advent/lib/2d/AreaTest.scala | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/scala/org/lemon/advent/lib/2d/Area.scala b/src/main/scala/org/lemon/advent/lib/2d/Area.scala index 64e6888..475653f 100644 --- a/src/main/scala/org/lemon/advent/lib/2d/Area.scala +++ b/src/main/scala/org/lemon/advent/lib/2d/Area.scala @@ -131,4 +131,4 @@ case class Area(xRange: Range, yRange: Range): builder.toString case class Quadrants(topLeft: Area, topRight: Area, bottomLeft: Area, bottomRight: Area): - def seq: Seq[Area] = Seq(topLeft, topRight, bottomLeft, bottomRight) + def toSeq: Seq[Area] = Seq(topLeft, topRight, bottomLeft, bottomRight) diff --git a/src/main/scala/org/lemon/advent/year2024/Day14.scala b/src/main/scala/org/lemon/advent/year2024/Day14.scala index 82e9d84..497a617 100644 --- a/src/main/scala/org/lemon/advent/year2024/Day14.scala +++ b/src/main/scala/org/lemon/advent/year2024/Day14.scala @@ -17,7 +17,7 @@ private object Day14: topLeft = quadrants.topLeft.dropRight(1).dropBottom(1), topRight = quadrants.topRight.dropBottom(1), bottomLeft = quadrants.bottomLeft.dropRight(1), - ).seq.map(quad => robits.count(r => quad.contains(r._1))) + ).toSeq.map(quad => robits.count(r => quad.contains(r._1))) def part1(input: String, example: Boolean) = val area = if example then Area(11, 7) else Area(101, 103) diff --git a/src/test/scala/org/lemon/advent/lib/2d/AreaTest.scala b/src/test/scala/org/lemon/advent/lib/2d/AreaTest.scala index 6802196..823d4b5 100644 --- a/src/test/scala/org/lemon/advent/lib/2d/AreaTest.scala +++ b/src/test/scala/org/lemon/advent/lib/2d/AreaTest.scala @@ -102,7 +102,7 @@ class AreaTest extends UnitTest: } test("quadrants cover the area") { - check((area: Area) => area.quadrants.seq.flatMap(_.toSeq).toSet == area.toSet) + check((area: Area) => area.quadrants.toSeq.flatMap(_.toSeq).toSet == area.toSet) } test("area encloses itself") {