Most of P1 was spent setting up the problem (more in the spoiler). I'll need to get my head wrapped around P2
3. I macro for path
Part 1 done! Part 2 looks like it'll take me a good while to wrap my head around so will come back to update this if I ever get round to finishing it!
Macro:
... Eric really loves his position-based problems!
The below link will give more insights to you.
Many thanks
Shanker V
Ha so I spent forever coding up part2 but thankfully it worked.
Finally done.
Direction | Current Area | Target Area | Direction in new area | axis direction | x in new area | y in new area |
R | A | D | L | reverse | 100 | 150-y+1 |
R | C | A | U | y+50 | 50 | |
R | D | A | L | reverse | 150 | 150-y+1 |
R | F | D | U | y-100 | 150 | |
L | B | E | R | reverse | 1 | 150-y+1 |
L | C | E | D | y+50 | 101 | |
L | E | B | R | reverse | 51 | 150-y+1 |
L | F | B | D | y-100 | 1 | |
U | A | F | U | x-100 | 200 | |
U | B | F | R | reverse | 1 | 150-y+1 |
U | E | C | R | 51 | x+50 | |
D | A | C | L | 100 | x-50 | |
D | D | F | L | 50 | y+100 | |
D | F | A | D | x | 200 |
Part 1 macro: dirty, inefficient and slow macro
https://github.com/AkimasaKajitani/AdventOfCode/tree/main/2022
I had to fold the cube on paper before I understood how to program part 2.
Workflows available here: https://github.com/clmc9601/Advent-of-Code-solutions/tree/main/2022%20Alteryx
take few days. and finally get it.
so from,
1st round: A move to B,:-) so this took a while - but I figure better late than never.
Along the way - also built a few helper macros - one to show the shape of the grid; one to generate test grids; etc....
Testing was key on this - start with generating a 1x1 cube in the required shape, test that across all transitions; then move to rotation on a 1x1; then move to a 2x2; then add in rotations and movement within a face; then move to 4x4; then add in blocks.
That way - didn't spend time backtracking - every single step was built on a previous solid step.
User problem shape:
Transition Map
The second half is specific to a given layout - and it says "if I leave the top of Face 1 - where do I end up". I am pretty sure that this could be worked out computationally given that there are only 11 possible nets, but didn't have an easy solution in mind, so I mapped this manually:
Iterative solver:
@SeanAdams Christmas in May! 😀 Love the detailed answer