Skip to content

Commit 8ca34c9

Browse files
committed
Encode the pads
1 parent cbd5892 commit 8ca34c9

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

day21/src/day21.scala

+14
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
import scala.io.Source
22

3+
case class Vec2(x: Int, y: Int)
4+
5+
val NUMPAD = Map(
6+
(Vec2(0, 0), '1'), (Vec2(1, 0), '2'), (Vec2(2, 0), '3'),
7+
(Vec2(0, 1), '4'), (Vec2(1, 1), '5'), (Vec2(2, 1), '6'),
8+
(Vec2(0, 2), '7'), (Vec2(1, 2), '7'), (Vec2(2, 2), '8'),
9+
(Vec2(1, 3), '9'), (Vec2(2, 3), 'A'),
10+
)
11+
12+
val ARROWPAD = Map(
13+
(Vec2(1, 0), '^'), (Vec2(2, 0), 'A'),
14+
(Vec2(0, 1), '<'), (Vec2(1, 1), 'v'), (Vec2(2, 1), '>'),
15+
)
16+
317
@main def main(path: String) =
418
val input = Source.fromFile(path).getLines.toList
519
println(s"$input")

0 commit comments

Comments
 (0)