Uiua
Put this one off for a bit and I'll put off part two for even longer because I don't want to deal with any pyramid-shapes of boxes at the moment.
The code for part one feels too long but it works and runs <2s so I'm happy with it for now ^^
Run with example input here
Code
I decided to split the movement instructions lines further for aesthetic reasons when opening it in the online uiua pad since newlines are thrown out anyways.
$ ##########
$ #..O..O.O#
$ #......O.#
$ #.OO..O.O#
$ #[email protected].#
$ #O#..O...#
$ #O..O..O.#
$ #.OO.O.OO#
$ #....O...#
$ ##########
$
$ <vv>^<v^>v>^vv^v>v<>v^v<v<^vv<<<^><
$ <><>>v<vvv<>^v^>^<<<><<v<<<v^vv^v>^
$ vvv<<^>^v^^><<>>><>^<<><^vv^^<>vvv<
$ >><^^v>^>vv<>v<<<<v<^v>^<^^>>>^<v<v
$ ><>vv>v^v^<>><>>>><^^>vv>v<^^^>>v^v
$ ^<^^>v^^>v^<^v>v<>>v^v^<v>v^^<^^vv<
$ <<v<^>>^^^^>>>v^<>vvv^><v<<<>^^^vv^
$ <vvv>^>v<^^^^v<>^>vvvv><>>v^<<^^^^^
$ ^><^><>>><>^^<<^^v>>><^<v>^<vv>>v>>
$ >^v><>^v><<<<v>>v<v<v>vvv>^<><<>^><
$ ^>><>^v<><^vvv<^^<><v<<<<<><^v<<<><
$ <<^^<v<^^^><^>>^<v^><<<^>>^v<v^v<v^
$ >^>>^v>vv>^<<^v<>><<><<v<<v><>v<^vv
$ <<<>^^v^>^^>>><<^v>>v^v><^^>>^<>vv^
$ <><^^>^^^<><vvvvv^v<v<<>^v<v>v<<^><
$ <><<><<<^^<<<^<<>><<><^^^>^^<>^>v<>
$ ^^>vv<^v^v<vv>^<><v<^v>^^^>>>^^vvv^
$ >vvv<>>>^<^>>>>>^<<^v>^vvv<>^<><<v>
$ v^^>>><<^^<>>^v^<v^vv<>v^<<>^<^v^v>
$ <^<<<><<^<v><v<>vv>>v><v^<vv<>v^<<^
Pos β :Β°ββββΈβ@@
Move β (
βΈβ@.
β£(+ββ€.β‘(β β⧻)
βββ£(β¬@.β»βββ€.=β(⧻|β@#).)β
)β
β
)
PartOne β (
# &rs β &fo "input-15.txt"
ββ‘Β¬β¦·"\n\n".
β©Β°β‘Β°β
: β(β½β @\n.) βββ @\n.
ββββ"^>v<"
β’(ββββ’
β(β(⨬(β|β)βΏβ)
β(⨬(β(βββ‘)Move Pos
| β(ββββ‘)Move +βPos
)=ββΏβ)
⨬(β|β)βΏβ
)
| β 0⧻)
β
/+β‘/+Γ[100_1]ββ@O
)
PartTwo β (
""
)
&p "Day 15:"
&pf "Part 1: "
&p PartOne
&pf "Part 2: "
&p PartTwo