http://git.tuvimen.i2p/aoc2024/tree/06/sol.c
findguard ( data , datal , & x , & y )) return ret ; uchar dir = 0 ; while ( 1 ) { if (( dir == 2 && x == datal -1 ) || ( dir == 1 && data [ x ][ y + 1 ] == 0 ) || ( dir == 0 && x == 0 ) || ( dir == 3 && y == 0 )) { ret ++ ; break ; } size_t pos [ 4 ][ 2 ] = { { x -1 , y }, { x , y + 1 }, { x + 1 , y }, { x , y -1 }, }; size_t * d = pos [ dir ]; if ( data [ d [ 0 ]][ d [ 1 ]] == '#' ) {...