Plan for day 16 stands
This commit is contained in:
parent
5abbcae112
commit
0b74f11b8e
6 changed files with 327 additions and 0 deletions
141
day16/input
Normal file
141
day16/input
Normal file
|
@ -0,0 +1,141 @@
|
|||
#############################################################################################################################################
|
||||
#.......................#.....#...........#.......#...........#...#.....#.......#...#.........#.......#.#.................#...........#....E#
|
||||
#.#.#.#.#.#.#.###.#.###.#.#.###.#####.###.#####.###.###.#.#.#.#.#.#.#.#.#####.#.#.###.#.#####.#.#####.#.#.#######.#.#####.#.###.#######.#.#.#
|
||||
#.#.#.#.#.#.#...#.#.#.....#.#.......#...#.......#...#.#.........#.#.#.#.......#.#.....#...#.#.#.#...#.#.#.......#...#...#.#...#.........#.#.#
|
||||
#.#.#.#.#.#.###.#.#.#####.#.#.#######.#.#####.###.#.#.#.#.###.#.###.#.#######.#.#########.#.#.#.#.###.#.#####.#.###.###.#.#.#######.#####.#.#
|
||||
#.#.#.#.#...#.#.#.#.......#.....#...#.#.#.....#...#...#.#...#...#...#.....#...#...#...#...#.#...#.....#.#.........#...#.#.....#...#.....#...#
|
||||
#.#.#.#.###.#.#.#.###.#.#.#######.#.###.#######.###.###.#.#.#####.###.###.#.#####.#.#.#.###.#####.#####.#.###.#######.#.###.#.#.#.#########.#
|
||||
#.....................#...........#...#.#...#...#.....#...#.#.....#...#.#.#.....#.#.#...#.......#.....#...#.#.......#.#.....#...#.#...#...#.#
|
||||
#.###.#.#.#.#.#####.###########.#####.#.#.#.#.###.#.#.#####.#.#####.#.#.#.#####.#.#.#####.#####.#####.###.#.#.#####.#.#.#########.#.#.#.#.#.#
|
||||
#.#...#...#...#...#...#.........#.......#.........#...#...#...#.....#...#.....#.#.#...#.....#...#...#...#.#...................#.#...#.#.#.#.#
|
||||
#.#.###.#####.#.#####.#.#######.#.#######.#########.#.#.#######.###.###.#####.#.#.###.#.###.#.###.#####.#.#.#.#.###########.#.#.#####.#.#.#.#
|
||||
#.#.#...#...#.#.#.....#...#...#.#.#.......#.......#.#.#.....#.#...#.#...#...#.#.......#.#...#.....#.....#...#.......#.................#.#.#.#
|
||||
#.#.#.###.#.#.#.#.#.#####.#.#.#.###.#######.###.#.#.#.#.#.#.#.#.###.#.#####.#.###########.#########.#######.#.#####.#.#########.###.#.#.#.#.#
|
||||
#.#.#...#.#...#.#.#.#.....#.#...#...#.....#...#.#.#.#.#.#.#.#...#...............#.......#.#...#.....#.....#.......#.#.......#.#.....#.#.#...#
|
||||
#.#.###.#.#####.#.###.###.#.#####.###.#.#.#.###.#.#.#.#.#.#.#####.###.#.#######.###.#.#.#.#.#.#.#####.###.###.#####.#.#####.#.#####.#.#.###.#
|
||||
#.#...#...#.....#.......#...#.....#...#.#.#.#...#...#.#.#.#.......#.#.#.#.....#...#.#.#.#.#.#.........#.............#.#.....#...............#
|
||||
#.###.#######.#.#########.#.#.#####.###.###.#.#######.###.#########.#.#.#.###.###.#.#.#.#.#.#####.#####.#############.#.#####.###.#.#####.#.#
|
||||
#.....#...#...#.#.#.......#...#...#...#.....#.....#.#.....#.#...........#.#.#.#...#.#.#.#.#.#.....#...#.......#.......#.#...#.....#.........#
|
||||
#.#####.#.#.#.#.#.#.#######.#.#.#####.#########.#.#.#######.#.###.#####.#.#.#.#.###.#.#.#.#.#.#####.#.#.#####.#.#######.#.###.#.###.###.#.#.#
|
||||
#.......#...#...#.#.#...#...#.#.........#.....#.#.#.....#.....#...#...#.#.#...#...#.#.#...#.#.#...#.#.#.#...#...#.......#.....#.........#.#.#
|
||||
#.#.#########.#.#.#.#.#.#.###.#####.#.###.###.###.#.#####.#####.#.#.#.###.#.#####.#.#.###.#.#.#.#.#.#.#.###.#####.#######.#.###########.#.#.#
|
||||
#.#.....#.....#...#.#.#.#.....#.....#.#...#.......#.#.....#.....#.#.#...#.#.....#.#.#.#...#.#.#.#.#.#.............#.....#...#...............#
|
||||
#.###.#.#.###.###.#.#.#.###.###.#####.#.#.#########.#.#######.###.#.###.#.#####.#.###.#####.#.###.#.#########.#####.###.#.#.#.#.###.#.#.###.#
|
||||
#...#.#.#.........#...#.#...#...#...#.#.....#.......#...#...#.#...#...#.#...#.#.#...#...#...#.#...#.....#.....#.......#...#.#.#...#...#.....#
|
||||
###.###.#####.#########.#.###.#.#.#.#.#####.#.#########.#.#.#.#.#####.#.###.#.#.###.#.#.#.###.#.#####.###.###########.#####.#.###.#####.#.#.#
|
||||
#.......#.......#...#...#.#...#.#.#...#.....#.........#...#.#...#...#.#.....#.#.#...#.#...#...#.......#...#...........#...#.....#.........#.#
|
||||
#########.###.#.#.#.#.###.#.###.#.#####.#####.#######.#####.#.#.###.#.#######.#.#.###.#####.###.#.#.###.#####.#########.#.#####.#######.###.#
|
||||
#.........#...#.....#...#.#...#...#.....#.....#...........#.#.#.....#...#.....#...#...#.....#...#.#...#.....#.#...#...........#.#.....#...#.#
|
||||
#.#########.#.#####.###.#.###.#####.#####.#########.#.###.#.#.#####.###.#.#.#.#####.#####.###.###.#.#####.#.#.#.#.#.#.###.#.###.#.#.#.#.#.#.#
|
||||
#.#.......#.#...#...#...#.#.....#...#.....#.#.......#...#.#.#...#...#.....#.....#...#.....#.....#...#...#.#.#.#.#.........#.#...#.#.#.#.#.#.#
|
||||
#.###.#####.#.#.#.###.#.#.#.#####.###.#####.#.#.###.###.###.###.#.###.###.###.#.#.#.###.###.#.#######.#.#.#.#.#.#######.###.#.#####.#.#.#.#.#
|
||||
#...#.#.....#...#.#...#.#.#...#...#.#.#...#...#...#...#.....#...#...#...#.#.#.#...#.#...#...#.#.......#.#.#.....#...#...#...#.#.....#.#.#...#
|
||||
###.#.#.###.#.###.#.###.#.#####.###.#.#.#.###.###.###.#######.#########.#.#.#.#####.#.#.###.#.#.#######.#.#.#####.#.#.###.#.#.###.###.#.#####
|
||||
#.............#...#.#...#.....#...#.....#...#.#...#...#.......#.........#...#.......#.....#...#...#.#...#.#.......#.#.....#.#.....#...#.#...#
|
||||
#.###.###.#.###.###.#.#######.#.#.#.#######.#.#.###.###.###.#.#.###########.#############.#######.#.#.#############.#.#.#.#.#####.#####.#.#.#
|
||||
#...#...#.#...#.#...#...#.....#.#.#.#...#...#.#...#.#.#.#...#.#.#.#.....#...#.......#.....#.....#.#.#.#.....#.....#.#.#...#.....#.#.....#.#.#
|
||||
#.#.###.#.#.#.#.#.#######.#####.#.###.#.#.###.###.#.#.#.#.#####.#.#.###.#.#####.###.#.#####.###.#.#.#.###.#.#.###.#.#.#########.#.#.###.#.#.#
|
||||
#.#.#...#...#.#.#.......#...#...#.....#.#...#.#.#.#.#...#.....#.#...#.#...#...#.......#.....#.#...#.#.....#...#...#.#...#.....#...#.#.....#.#
|
||||
###.#.#.#.###.#.#######.###.#######.###.###.#.#.#.#.###.#####.#.###.#.#####.#.#.#######.#####.#####.###########.###.###.###.#####.#.#.#####.#
|
||||
#...#.....#...#.#.....#...#.#.....#.#...#...#...#.#...#.......#...#.........#.#...#.........#...#.......#.....#.#...#...#...#.....#.#.#...#.#
|
||||
#.#####.#.#.###.#.###.#.#.#.#.###.#.#.###.#####.#.###.#.#########.###########.###.#########.#.###.###.#.#.###.#.#.#.#.###.###.###.#.###.#.#.#
|
||||
#.#...#...#.#...#.#.....#.#...#.#.#.#.#...#.....#.#.#.#.........#.....#.....#...#...#...#...#.........#.#.#...#.....#.#.#.....#...#...#.#.#.#
|
||||
#.#.#.#.#.#.#.###.#######.#####.#.###.#.#########.#.#.#######.#.#####.#.###.###.###.#.#.#.###########.###.#.#########.#.#.#####.#####.#.#.#.#
|
||||
#...#.#...#...#.......#...#.....#.#...#.#...........................#.#...#...#.....#.#...#.........#.....#.#.........#...#.#...#...#...#...#
|
||||
#.###.#.#.#####.#####.#.###.###.#.#.###.#.#########################.#.###.###.#####.#.#####.#######.#######.#.#######.###.#.#.#.#.#.#######.#
|
||||
#.......#.......#.....#.#...#.#.#.#...#...#...#.....#.....#.....#...#...#.#...#.............#.....#.#...#...#...........#...#.#.#.#.......#.#
|
||||
#.#.###.#####.#.#.#####.#.###.#.#.#.#.#####.#.#.###.#.#.#.#.###.#.###.###.#.###.#######.#####.#.###.#.#.#.#####.#######.#####.###.###.#.###.#
|
||||
#.....#.#.....#.#.#...#.#.....#...#.#.......#.....#...#.#.....#...#.......#...#...#...#.....#.#.#...#.#.#.#.....#...#...#...#.....#...#.#...#
|
||||
#.#####.#.#####.#.#.#.#.#####.#######.###############.#############.###.#####.#####.#.#####.###.#.###.#.#.#.#####.#.#.###.#.#######.#####.###
|
||||
#...#...#.#...#.#.#.#...#...#.#.....#.#...............#...........#.....#...#.#...#.....#.....#.#...#.#...#...#...#.#.....#.#...#...#...#...#
|
||||
#.#.#.#.#.#.#.###.#.#####.###.###.#.###.#########.#.###.#########.#######.#.#.#.#.#.###.#####.#.###.#.#######.#.###.#######.#.#.#.###.#.###.#
|
||||
#.....#.....#...#.......#...#.....#.#...#.........#.#...#.....#.....#.....#.#...#.#...#.#...#...#...#.........#...#.....#.....#.#.#...#.....#
|
||||
#.#####.#######.#.#####.#.#.#######.#.###.#####.###.#.#####.#.#.###.#.#####.#####.###.#.#.#.###.#.#####.###.#.###.#####.#######.#.#.#########
|
||||
#.........#...#.#.....#.#.#.....#.#.#...#...#...#...#.#.....#.#...#...#.........#.....#...#.#.#.#...#.....#.#...#.#...#...#.#.....#.#.......#
|
||||
#.#####.#.###.#.#####.#.###.###.#.#.###.#.#.#.#####.#.###.#.#####.#############.###.#####.#.#.#.###.#.###.#.#.###.###.###.#.#.#####.###.###.#
|
||||
#.#.......#...#.#.....#...........#.....#.#...#.....#.....#.#...#.#.......#...#...........#.#.....#.......#...#.........#.#.....#...#...#...#
|
||||
#.#.#######.###.#.###########.###########.###.#.###.###.#.#.#.#.#.#.#####.###.#.#.#######.#.#####.#######.#####.#########.#######.###.###.###
|
||||
#.#...#...........#...#.......#...........#.#.....#...#...#.#.#...#...#.#...#...#.......#.#...#...#.....#.......#...#...#.........#.....#.#.#
|
||||
#.###.#############.#.#.#######.#######.###.#.###.###.#####.#.#######.#.###.#####.#####.#####.#.###.###.###.#####.#.#.#.#.#############.#.#.#
|
||||
#...#.#.........#...#.#...#.#...#.....#...#...#.#...#.#...#.#.......#...#...#.....#...#.......#...#...#...#...#...#...#.#.#.............#.#.#
|
||||
#.#.#.#.#######.#.###.###.#.#.###.###.###.#.###.###.###.#.#.#####.###.###.#.#.#####.#.###########.###.###.###.#.#######.#.#.#.#.#########.#.#
|
||||
#...#...#.....#.#...#.......#.#...........#.#.....#.....#...#...#.....#...#.#.#.#...#...........#.#.#...#.#...#...#...#.#.#...#...#.....#...#
|
||||
#.#######.#.###.#.#.#.#######.#.#.#####.###.#.###########.###.#.#######.###.#.#.#.#.#############.#.#.#.#.#.#####.#.###.#.#.#####.#.#.#####.#
|
||||
#...#.....#...#.#.#...#.......#.#.#...#.....#.#.........#...#.#.........#...#.#.#.#.......#...#.......#.#.#.#.....#.#...#.#.....#.#.#.......#
|
||||
###.#.#######.#.#######.#######.###.#.#.#####.#.#.#####.#####.#########.#####.#.#.#####.#.#.#.#.#######.#.###.#.###.#.#.#.#######.#.#########
|
||||
#.#.#...#.....#.......#.....#.....#.#...#.....#.#.#...........#.....#...#...#.#...#...#.#...#.....#.....#.....#.....#...#.......#.#.....#...#
|
||||
#.#.#####.#########.#.#####.#.###.#.#####.###.#.#.#.#.#.#######.#####.#.#.#.#.#.###.#.#.###########.#############.#.###.#######.#.#####.###.#
|
||||
#.#.....#.#.......#.#...#...#.#.#.#.#.....#...#.#.#.#.#...#...........#.#.#...#.#...#.#...#.....#...#.....#.......#...#.....#.#.............#
|
||||
#.#####.#.#.#.#.#.#####.#.###.#.#.#.#.#####.###.###.#.###.#.###########.#.#######.###.#.#.#.###.#.###.#####.#.###.###.#####.#.#######.###.#.#
|
||||
#.#.....#...#...#...#...#.#...#.#.#.#...#.#...#.....#...#...#...........#.........#.#...#.#.#.#.#.#...#.....#.#...........#.#.......#.#...#.#
|
||||
#.#.#########.#.###.#.###.#.###.#.#.###.#.###.#######.#.#.###.###############.#####.###.###.#.#.#.#.#.#.#####.#.#.#########.###.###.#.#.###.#
|
||||
#.#.#.......#.#.#.....#...#.....#.#.....#...#.#.....#.#.#.#.......#.....#...#.....#...#.....#.#...#.#.......#.#...#...#.....#...#.#...#.#...#
|
||||
#.#.###.###.#.#.###.###.#######.#.#######.#.#.#.###.#.#.#.#######.#.#####.#.#.#.#.#.#.#######.#######.#####.#.#.###.#.#.#####.###.###.#.###.#
|
||||
#...#...#.#...#...#...#.......#.#.#.......#.#.#...#.#.#.#.#...#...#.......#.#.#.#...#.....#.....#...#.....#.#.#.#...#...#.#.................#
|
||||
#.###.###.###.###.#.#.#######.###.#.#####.###.###.#.###.#.#.#.#.#.#########.#.#.#####.###.###.#.#.#.###.#.###.#.#.###.#.#.#.#.#########.#.#.#
|
||||
#.#...#.........#...#...#...#.#...#.....#.#.....#.#.#...#.#.#.#.#.....#.......#...#...#...#...#...#.....#.#...#...#.#.#.#...#.........#...#.#
|
||||
#.#.###.###.#.#.#######.#.#.#.#.#####.#.#.#.#####.#.#.###.#.#.#.#.#####.#####.#.#.###.#.###.#############.#.#######.#.#.#.###########.#####.#
|
||||
#.....................#.#.#...#.....#...#...#...#.#.#.#.#.#.#...#.#...#.#.#...#.#.......#.......#.........#...#.......#.#...#.......#...#...#
|
||||
#######.#.#.###.#.###.#.#.#####.#.###.#######.#.#.#.#.#.#.#.###.###.#.#.#.#.###.#.#.#.#.###.#.#.#.###########.#.#######.###.#####.###.#.#.###
|
||||
#.......#...#...#.#...#.#.#...#.......#...#...#.#.#.#.#...#...#.#...#...#...#...#.#.#.#...#.#.#...#...#.......#...#.....#.#.................#
|
||||
#.#.#####.###.###.###.#.#.#.###.#######.#.#.###.#.#.#.###.###.#.#.#######.#######.#.#.###.#.#.#.###.#.#.#.#.###.###.#####.#.#.#.#.#.#######.#
|
||||
#.#.#...............#...#.#...#.#.......#.#...#.#.#.#...#...#.#.#.#...#...#.......#.#.#...#.#.#...#.#.#...#...#.#...#.......#.#.#.#.....#...#
|
||||
#.#.#.#.#######.###.###.#.#.#.#.#.#####.#.#.#.#.#.#.###.###.#.#.#.#.###.###.#.#####.#.#.#####.###.#.#.#####.#.#.#.#######.#.#.#.#.#####.#.###
|
||||
#.............#...#.#...#.#.#...#...#...#.#.#.#...#.....#.....#.#.#...#...#.....#...#.#...#...#...#.#.......#...#.#.........#.#.....#...#...#
|
||||
#.#.#.#.#.#.#.###.#.#.###.#.#######.#.#.#.###.#.#########.#######.#.#.###.#.###.###.#####.#.###.###.#############.#.###.###.#.#.#####.#.###.#
|
||||
#.................#.#...#.#.......#.#.#.#.#...#.#.......#...#.....#.#...#.#...#.#...#...#.#.#...#...#.............#.....#...#.....#...#...#.#
|
||||
#.#.#######.###.###.###.#.#####.###.#.#.#.#.###.#.#####.#.#.#.#########.#.#.###.#.###.#.#.#.#.#.###.#.#############.###.#.###.###.#.#####.#.#
|
||||
#.....#...#...#.#...#...#.#.....#...#.#.#.#.#...#.#...#...#.#.#.........#.#.#...#.....#.#...#...#...#.....#...#...#.#.#...#.......#.#.....#.#
|
||||
#.###.#.#####.#.#.#######.#.###.#.###.###.#.#####.###.###.#.#.#.###.#####.#.#.###.#####.#######.#.#.#####.###.#.#.#.#.#########.###.#.#####.#
|
||||
#.#...#.....#...#.#.....#...#...#...#.....#.#...#.#...#...#.#.#...#...#...#.#...#.#...#.......#...#.....#...#.#.#...#.#.......#...#.#.#.....#
|
||||
#.#.###.#.#######.#.###.#####.###.#.#.#####.#.#.#.#.#.#.#.###.#.###.#.#.#####.#.#.#.#.#######.###.###.#####.#.#.#####.#.#.###.#.#.#.###.#####
|
||||
#...#...#...#.....#...#.......#...#.#.#.....#.#...#.#.#.#.#...#...#.#.......#.#.#.#.#.......#...#.#.........#.#.#.#.....#...#.#.#.#.....#...#
|
||||
#.#######.#.#.###.###.###.#########.#.#.###.#.#####.#.#.#.#.###.#.#########.###.#.#####.#.#.#.###.#.#########.#.#.#.#######.#.###.#########.#
|
||||
#.......#.#.#.#.....#.#...........#.#.#.#...#.#.....#.#.#.#.#...#.......#.......#.......#...#...#.#.#.........#.#.#.#.....#.#.....#.......#.#
|
||||
#.#####.###.#.#####.#.###.###.###.#.#.#.#####.#.#.###.#.###.###.#######.#############.#.###.###.#.#.#####.#####.#.#.#.#####.#####.#####.#.#.#
|
||||
#.....#.#...#.....#.#...#.#...#.....#.#...#...#.#...#.#.....#...#.......#.......#.......#.....#...#.....#.#...#.#.#.#.#.................#.#.#
|
||||
#.###.#.#.#.#####.#.###.###.#####.###.#.#.#.###.#.#.#.#######.###.#######.#####.#########.###.#########.#.#.#.#.#.#.#.#.#################.#.#
|
||||
#.....#.#.#...#.#.#...#.....#.....#...#.#.#.#...#...#.........#.#...#...#...#...................#.....#.#...#...#.#...#.#.......#.....#...#.#
|
||||
#.###.#.#.###.#.#.#########.#.###.###.#.#.#.#.###.#############.###.###.#.#.#########.###########.###.#.###.#####.###.#.#.#####.#####.#.###.#
|
||||
#.....#.#.#.#.#.#.#.....#...#.#.#...#...#.#.#.#...........#.......#...#...#...#...#.#...#.........#.#.#...#...#.......#.............#.#.#...#
|
||||
#.#.#.#.#.#.#.#.#.#.#.###.###.#.###.###.#.#.###.###.###.#.###.###.###.#######.#.#.#.###.#.#####.#.#.#.#.#.###.#####################.#.#.###.#
|
||||
#.#.#...#.#.....#...#.....#.#...#.#...#...#...#.........#.....#.....#.......#.#.#...#...#.#...#.....#.#.#.#.#.........#.....#...#...#.#.....#
|
||||
#.###.###.#################.###.#.###.#######.#######.###.#.#####.#########.#.#.#####.###.#.#######.#.###.#.#########.#.###.#.#.#.###.#####.#
|
||||
#.....#.......#...........#.#...#...#...#.....#.....#.#...#.#...#.#.....#.#...........#...#.........#.....#.........#...#.#...#...#...#.....#
|
||||
#.###.#######.#.#####.###.#.#.###.#.###.#.###.#.###.#.#.###.#.#.###.#.#.#.#####.#.#####.#####.###.#.#######.###.#########.#########.#.#.#####
|
||||
#...............#.#...#.......#.#.#...#...#.....#...#.#...#...#.....#.#.#.....#.#.....#.....#.#...#.........#...#.......#.....#.....#.#...#.#
|
||||
#####.#####.#.###.#.###.#####.#.#.###.###.#.#######.#####.###########.#.###.#.#.###.#.#####.#.#.#####.#######.###.###.###.###.#.###.#####.#.#
|
||||
#.......#...#.#...#.#...#.....#.....#.#.....#.....#.......#...........#.#...#.#...#.#.......#.#...#...#...#...#...#.#.....#.#...#.#.....#.#.#
|
||||
#.###.#.#.###.#.###.#.###.#####.###.#.#.#.###.###.#########.###########.#.#######.#.#########.###.#.###.#.#.###.###.#######.#####.#####.#.#.#
|
||||
#...#.#.#...#.#.#...#...#.#.....#...#...#.....#.#.....#.........#...#.#.#.#.......#...#.#.....#...#...#.#.#.....#.....#.......#...#.....#.#.#
|
||||
#.#.#.#.###.#.#.#.#####.#.###.###.#######.#####.#####.#.#.#####.#.#.#.#.#.#.#######.#.#.#.#####.#####.#.#.#####.#.###.#.#.#####.#.#.###.#.#.#
|
||||
#.#.#...#...#.#.#.#.....#...#...#.#.....#.#.........#...#.....#...#.#.#.#.#.#.....#.#.#.#...#.#.#.....#.#.......#...#...#.#.....#.#...#.#...#
|
||||
#.#.#####.###.#.#.#########.#.#.#.#.###.#.#####.#.#.###.###########.#.#.#.#.#.###.###.#.###.#.#.#######.###########.#####.#.#####.###.#####.#
|
||||
#.#.......#.....#.....#...#.#.#...#.#...#.#...#.#.#.#...#...#...#...........#...#.#...#.....#.#.#.....#...........#.....#.#...#.....#...#...#
|
||||
#.#########.#########.#.#.#.#######.#.###.#.#.###.###.###.#.#.#.#.#########.###.#.#.#####.###.#.#.###.#####.#.#.#######.#.###.#.#######.#.###
|
||||
#.........#.#.#.....#...#...........#.#.....#...#.#...#...#...#.#.#.........#...#...#...#...#.#...#.#.....#.#.#.....#...#.....#.....#...#.#.#
|
||||
###.#.#####.#.#.###.#####.###########.#########.#.#.###.#####.#.#.#.#########.#######.#.###.#.#####.#####.#.#.###.###.#############.#.#.#.#.#
|
||||
#.#.#.#.....#.#.#.#.......#.........#.....#.......#.#.#...#.....#.#.#...#.........#...#.#.....#.....#.....#.#...#.........#...............#.#
|
||||
#.#.#.#.#####.#.#.#######.#.#####.#######.#######.#.#.#.#.#.#.#.#.#.###.#.#######.#.###.#####.###.#.#.#####.#.#########.###.#####.#.#.###.#.#
|
||||
#...#.........#.#...#...#.#...#...#.....#...........#.#.#.#.#.#...#.#...#.#.....#...#.#.....#.#...#.#.......#.#.....#...#...#...#.#.#...#.#.#
|
||||
#.###########.#.#.#.#.#.#.#.#.#####.###.#############.#.#.#.#.#.###.#.###.#.#.#######.#####.#.#.###.#######.###.###.#####.###.###.#.###.#.#.#
|
||||
#.....#.....#...#.#...#...#.#.........#.............#...#.#.#...#...#.#...#.#...........#...#...#...#.............#.#.....#.....#.#...#...#.#
|
||||
#####.#.#.###.#.###.#.#####.#########.#####.#######.#####.#.#####.###.#.###.#####.#####.#.#######.#.#.#########.#.#.#.#####.###.#.###.#####.#
|
||||
#...#.#.#.....#...#.#.....#...#...#...#.....#.....#.#...#.#...#...#.....#...#.....#.#...#...#...#.........#.......#.#.....#.#...#.#.......#.#
|
||||
#.###.#########.#.#.#####.#.###.#.#####.#########.#.#.#.#.#####.###.#####.###.#####.#.#####.###.###.###.#.###.#####.#.###.###.#.#.#.#####.#.#
|
||||
#...#.........#.#.#.....#.#.#...#.#...#.#.......#.#...#.#.#.....#...#.....#...#.......#...#.#.....#.#...#.#...#.....#.#...#...#.#...#...#.#.#
|
||||
#.#.#########.#.#.#.#####.###.###.#.#.#.#.###.#.#.#####.#.#.###.#.#########.###.#########.#.#.###.#.#.###.#.###.#####.#.#.#.###.#######.#.#.#
|
||||
#.#.....#.....#.#.#.....#...#.#.#...#...#...#.#.#.....#.#.#.#.....#.........#.#...#.....#.#.#.......#...#.#.#...#.....#.#.....#...#.....#.#.#
|
||||
###.###.###.#.###.#.#.#.###.#.#.#########.###.#.#.#.###.#.#.#.#.#####.#######.###.###.#.#.#.###.#.###.###.#.#.###.#####.#.###.#####.#.###.#.#
|
||||
#...#.......#.....#.#...#.#...#...................#.#.....#.#.#.......#.........#.....#.#.#...#.....#.#...#.#...#...#...#...#.....#.#...#...#
|
||||
#.#########.#######.#.#.#.#########.#.#####.###.#####.#####.#.#.#######.#.#############.#.###.###.###.#.###.###.#.###.###.#.#####.#.###.###.#
|
||||
#.........#.#...#...#.#.......#.....#.#...#...#.#...#.#.....#.#.......#.#.......#.....#.#...#...#.#...#.#.....#.#.#...#.....#...#...#.#...#.#
|
||||
#.#######.#.#.#.#.###.#######.#.###.#.#.#####.###.#.#.#.#####.#.#####.#####.###.#.###.#.#.#.###.###.###.#.###.#.#.#.###.#.###.#######.#.###.#
|
||||
#.#.....#.#...#.#...#.......#...#...#...#.....#...#...........................#...#...#...#...#.....#.#.#.#.....#.#.........................#
|
||||
#.#.###.#.#########.#.#####.#.#######.###.#####.#######.#.#.#.#.#####.#.#.#######.#.#####.#####.#####.#.#.#####.#.###.###.#####.#.###.#######
|
||||
#.#.#...#.........#...................#...#.....#.....#...#.#.#.....#.#.#...#...#.#.......#...#.#.............................#.#.....#.....#
|
||||
#.#.#.#.#######.#.#.#.#.#######.#######.###.#####.#.#######.#.#.###.#.#.###.#.#.#####.###.#.#.#.#.#####.#.#.#####.#.###.#.#.#.#.#.###.#.###.#
|
||||
#.......#.#.....#.#...#.....#...#.....#.#...#.....#.#.......#.................#.#...#...#...#.#...#.....#.#.#.....#.#.#.....#.#.#...#.#.#...#
|
||||
#.###.#.#.#.#########.#####.#.###.###.#.#.###.#####.#.#########.#.#####.#.###.#.#.#.#####.###.#####.#####.#.#######.#.###.###.#.#.#.#.#.#.###
|
||||
#S....#...#...............#.......#...#.......#.....#...........#.......#.....#...#.......#.........#...............#...........#.#.....#...#
|
||||
#############################################################################################################################################
|
129
day16/main.go
Normal file
129
day16/main.go
Normal file
|
@ -0,0 +1,129 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"math"
|
||||
|
||||
"git.mstar.dev/mstar/goutils/sliceutils"
|
||||
|
||||
"git.mstar.dev/mstar/aoc24/util"
|
||||
)
|
||||
|
||||
// A crossing is a path location with 3 or 4 other paths next to it
|
||||
type Crossing struct {
|
||||
At util.Vec2
|
||||
LowestScore int
|
||||
LowestFrom int // Index into list of crossings
|
||||
}
|
||||
|
||||
var (
|
||||
DirUp = util.Vec2{X: 0, Y: -1}
|
||||
DirRight = util.Vec2{X: 1, Y: 0}
|
||||
DirDown = util.Vec2{X: 0, Y: 1}
|
||||
DirLeft = util.Vec2{X: -1, Y: 0}
|
||||
)
|
||||
|
||||
var startDir = DirRight
|
||||
|
||||
// Get the size of the bord
|
||||
func getSize(lines []string) util.Vec2 {
|
||||
return util.Vec2{X: int64(len(lines[0])), Y: int64(len(lines))}
|
||||
}
|
||||
|
||||
// Count the paths next to a given positon
|
||||
func countPathsAt(lines [][]rune, at util.Vec2) int {
|
||||
center := lines[at.Y][at.X]
|
||||
if center == '#' {
|
||||
return 0
|
||||
}
|
||||
if center == 'E' {
|
||||
return 1
|
||||
}
|
||||
if center == 'S' {
|
||||
return 1
|
||||
}
|
||||
acc := 0
|
||||
if util.SafeGet(lines, at.Up()) != '#' {
|
||||
acc++
|
||||
}
|
||||
if util.SafeGet(lines, at.Down()) != '#' {
|
||||
acc++
|
||||
}
|
||||
if util.SafeGet(lines, at.Left()) != '#' {
|
||||
acc++
|
||||
}
|
||||
if util.SafeGet(lines, at.Right()) != '#' {
|
||||
acc++
|
||||
}
|
||||
return acc
|
||||
}
|
||||
|
||||
func findAllCrossings(lines [][]rune) []Crossing {
|
||||
out := []Crossing{}
|
||||
|
||||
for iy, line := range lines {
|
||||
for ix := range line {
|
||||
vec := util.Vec2{X: int64(ix), Y: int64(iy)}
|
||||
pathCount := countPathsAt(lines, vec)
|
||||
if pathCount >= 3 {
|
||||
out = append(out, Crossing{At: vec, LowestScore: math.MaxInt, LowestFrom: -1})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return out
|
||||
}
|
||||
|
||||
// Convert a list of crossings into x y map of pointers to those crossings
|
||||
func crossingListToPointerMap(crossings []Crossing) map[int64]map[int64]*Crossing {
|
||||
return nil
|
||||
}
|
||||
|
||||
func findStart(lines [][]rune) util.Vec2 {
|
||||
for iy, line := range lines {
|
||||
for ix, char := range line {
|
||||
if char == 'S' {
|
||||
return util.Vec2{X: int64(ix), Y: int64(iy)}
|
||||
}
|
||||
}
|
||||
}
|
||||
// Return invalid positon if none found
|
||||
return util.Vec2{X: -1, Y: -1}
|
||||
}
|
||||
|
||||
func findEnd(lines [][]rune) util.Vec2 {
|
||||
for iy, line := range lines {
|
||||
for ix, char := range line {
|
||||
if char == 'E' {
|
||||
return util.Vec2{X: int64(ix), Y: int64(iy)}
|
||||
}
|
||||
}
|
||||
}
|
||||
// Return invalid positon if none found
|
||||
return util.Vec2{X: -1, Y: -1}
|
||||
}
|
||||
|
||||
func walk(area [][]rune, from util.Vec2, dir util.Vec2) {
|
||||
// Idea: walk forward from start until crossing or wall
|
||||
// At crossing, defer a walker for both sides (if not walled off) but prioritise forwards
|
||||
// Keep track of current score, one crossing = 1 point
|
||||
// walking length doesn't matter because negligable compared to turn cost
|
||||
// At crossing, check if own score is lower than current score
|
||||
// If it is, update score and set own origin
|
||||
|
||||
// Special case:
|
||||
// If at end, update end "crossing" following the earlier rules
|
||||
}
|
||||
|
||||
func main() {
|
||||
inputLines := util.FileContentToNonEmptyLines(util.LoadFileFromArgs())
|
||||
// size := getSize(inputLines)
|
||||
area := sliceutils.Map(inputLines, func(t string) []rune { return []rune(t) })
|
||||
crossings := findAllCrossings(area)
|
||||
|
||||
start := findStart(area)
|
||||
// Start always has the lowest score
|
||||
crossings = append(crossings, Crossing{At: start, LowestScore: math.MinInt, LowestFrom: -1})
|
||||
end := findEnd(area)
|
||||
// While end is just another "crossing"
|
||||
crossings = append(crossings, Crossing{At: end, LowestScore: math.MaxInt, LowestFrom: -1})
|
||||
}
|
15
day16/sample
Normal file
15
day16/sample
Normal file
|
@ -0,0 +1,15 @@
|
|||
###############
|
||||
#.......#....E#
|
||||
#.#.###.#.###.#
|
||||
#.....#.#...#.#
|
||||
#.###.#####.#.#
|
||||
#.#.#.......#.#
|
||||
#.#.#####.###.#
|
||||
#...........#.#
|
||||
###.#.#####.#.#
|
||||
#...#.....#.#.#
|
||||
#.#.#.###.#.#.#
|
||||
#.....#...#.#.#
|
||||
#.###.#.#.#.#.#
|
||||
#S..#.....#...#
|
||||
###############
|
17
day16/sample2
Normal file
17
day16/sample2
Normal file
|
@ -0,0 +1,17 @@
|
|||
#################
|
||||
#...#...#...#..E#
|
||||
#.#.#.#.#.#.#.#.#
|
||||
#.#.#.#...#...#.#
|
||||
#.#.#.#.###.#.#.#
|
||||
#...#.#.#.....#.#
|
||||
#.#.#.#.#.#####.#
|
||||
#.#...#.#.#.....#
|
||||
#.#.#####.#.###.#
|
||||
#.#.#.......#...#
|
||||
#.#.###.#####.###
|
||||
#.#.#...#.....#.#
|
||||
#.#.#.#####.###.#
|
||||
#.#.#.........#.#
|
||||
#.#.#.#########.#
|
||||
#S#.............#
|
||||
#################
|
|
@ -10,3 +10,12 @@ func SliceSwap[T any](s []T, x, y int) {
|
|||
s[x] = s[y]
|
||||
s[y] = tmp
|
||||
}
|
||||
|
||||
func SafeGet[T any](s [][]T, at Vec2) T {
|
||||
var none T
|
||||
if at.X < 0 || at.Y < 0 || at.Y >= int64(len(s)) || at.X >= int64(len(s[0])) {
|
||||
return none
|
||||
}
|
||||
|
||||
return s[at.Y][at.X]
|
||||
}
|
||||
|
|
16
util/vec.go
16
util/vec.go
|
@ -15,3 +15,19 @@ func (v Vec2) Add(a Vec2) Vec2 {
|
|||
func (v Vec2) Eq(a Vec2) bool {
|
||||
return v.X == a.X && v.Y == a.Y
|
||||
}
|
||||
|
||||
func (v Vec2) Up() Vec2 {
|
||||
return v.Add(Vec2{0, -1})
|
||||
}
|
||||
|
||||
func (v Vec2) Down() Vec2 {
|
||||
return v.Add(Vec2{0, 1})
|
||||
}
|
||||
|
||||
func (v Vec2) Left() Vec2 {
|
||||
return v.Add(Vec2{-1, 0})
|
||||
}
|
||||
|
||||
func (v Vec2) Right() Vec2 {
|
||||
return v.Add(Vec2{1, 0})
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue