@@ -4,6 +4,7 @@ import gleam/io
44import gleam/list
55import gleam/string
66import grid . { type Dir , type Grid , type XY }
7+ import pocket_watch
78
89pub type Input {
910 Input ( grid : Grid ( Entity ) , robot : XY , moves : List ( Dir ) )
@@ -15,6 +16,7 @@ pub type Entity {
1516}
1617
1718pub fn parse ( input : String ) -> Input {
19+ use <- pocket_watch . simple ( "parse" )
1820 case string . split ( input , "\n \n " ) {
1921 [ map , moves ] -> {
2022 let char_grid = grid . from_string ( map )
@@ -50,6 +52,7 @@ pub fn parse(input: String) -> Input {
5052}
5153
5254pub fn pt_1 ( input : Input ) {
55+ use <- pocket_watch . simple ( "part 1" )
5356 input . moves
5457 |> list . fold ( from : # ( input . grid , input . robot ) , with : step )
5558 |> fn ( state ) { state . 0 }
@@ -60,6 +63,7 @@ pub fn pt_1(input: Input) {
6063}
6164
6265pub fn pt_2 ( input : Input ) {
66+ use <- pocket_watch . simple ( "part 2" )
6367 let wider_grid = widen ( input . grid )
6468 let wider_robot = grid . xy_mul ( input . robot , # ( 2 , 1 ) )
6569 let # ( final_grid , _ ) =
@@ -266,7 +270,7 @@ fn wider_step_find_nonbox(
266270 frontmost_touches ,
267271 list . map ( frontmost_touches , grid . get ( grid , _) ) ,
268272 ) )
269- todo
273+ panic as "Unfinished case (not needed though)"
270274 }
271275 }
272276 }
0 commit comments