Day 22: Monkey Map [AOC2022 Python] @0xdf
Day 22: Monkey Map [AOC2022 Python]  @0xdf
Uploaded December 2022 | Updated November 2026, 3 hours ago
For Advent of Code 2022 Day 22, I'm given a map that's made up of walls and empty spaces. The shape of the map is irregular, and it turns out, it can be folder together to make a cube. In part 1, I'll walk around in the 2D space, but in part 2, I'll have to walk around the cube in 3D space. I'll solve this an ugly way, hard-coding the edges that connect rather than getting them algorithmicly.

Code 2022 AOC: gitlab.com/0xdf/aoc2022
Challenge Link: adventofcode.com/2022/day/22

☕ Buy Me A Coffee: buymeacoffee.com/0xdf

#adventofcode #python

[00:00] Introduction
[00:26] Part 1 description
[02:40] Setup constant dictionaries to handle directions, turns
[03:26] World class, init to parse input
[06:43] step function to take a step in the current facing
[08:19] turn function to update facing based on turn instruction
[08:30] run function to loop over all instructions and return score
[08:43] Creating World
[09:15] Running part 1, solving
[09:46] Part 2 description
[11:16] Looking at the sides on example and input
[11:37] Strategy Discussion
[12:41] Change to step function
[12:52] parse_edges function
[14:34] Running to solve
[14:51] Conclusion
Day 22: Monkey Map [AOC2022 Python]
0xdf |

Day 22: Monkey Map [AOC2022 Python]

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER