We have extended our Early Bird Tickets for Inspire 2023! Discounted pricing goes until February 24th. Save your spot!

General Discussions

Discuss any topics that are not product-specific here.

Advent of Code 2022 Day 22 (BaseA Style)

AlteryxCommunityTeam
Alteryx Community Team
Alteryx Community Team
Discussion thread for day 22 of the Advent of Code - https://adventofcode.com/2022/day/22
8 REPLIES 8
mmontgomery
8 - Asteroid

Most of P1 was spent setting up the problem (more in the spoiler). I'll need to get my head wrapped around P2

Spoiler
1. Setup coordinate so each point has 4 adjacent points defined to account for empty space/falling off map
2. Generate direction and I used 360 degree calcs to determine overall direction 

3. I macro for path

mmontgomery_1-1671732762894.png

 

mmontgomery_0-1671732743738.png

 

 

DataNath
16 - Nebula

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!

 

Spoiler
Workflow:

DataNath_0-1671748113091.png


Macro:

DataNath_1-1671748231880.png

Just for fun - my rough path. Obviously can't show wrapping too well:

DataNath_2-1671748387268.png

... Eric really loves his position-based problems! 

Williams589
6 - Meteoroid

So tell me that what is the Advent of Code 2022 Day 22.


@AlteryxCommunityTeam ACAeronet Sign In wrote:
Discussion thread for day 22 of the Advent of Code - https://adventofcode.com/2022/day/22 
ShankerV
13 - Pulsar
patrick_digan
17 - Castor
17 - Castor

Ha so I spent forever coding up part2 but thankfully it worked.

Spoiler
Definitely a slow and steady approach moving a single cell each iteration.
patrick_digan_0-1672837566357.png


patrick_digan_1-1672837594893.png

 

 

AkimasaKajitani
16 - Nebula
16 - Nebula

Finally done.

 

Spoiler
I solved part 1 straight forward.
But it took long time to solve part 2 because debugging is too difficult more than part 1.

Firstly I tried to solve part 2 by modifying the part 1 macro but failed because my part 1 macro is dirty and inefficient. So I remake the macro for part 2 which is simple and clean. After that, I compared the results of 2 version macro and finished debugging.

And I also created the following to help debug(I printed this image and acctually assembled it).
AoC_2022_22_6.png
And I made the following table from above image.

DirectionCurrent AreaTarget AreaDirection in new areaaxis directionx in new areay in new area
RADLreverse100150-y+1
RCAU y+5050
RDALreverse150150-y+1
RFDU y-100150
LBERreverse1150-y+1
LCED y+50101
LEBRreverse51150-y+1
LFBD y-1001
UAFU x-100200
UBFRreverse1150-y+1
UECR 51x+50
DACL 100x-50
DDFL 50y+100
DFAD x200


AkimasaKajitani_0-1673162400530.png

Part 1 macro: dirty, inefficient and slow macro

AkimasaKajitani_1-1673162439662.png

Part 2 macro : efficiently, simple and fast. This is only for my input. If it is the same as my cubic development, it will work well.
AkimasaKajitani_2-1673162477604.png

 


 

 https://github.com/AkimasaKajitani/AdventOfCode/tree/main/2022

clmc9601
13 - Pulsar
13 - Pulsar

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

 

Spoiler
My approach was to create all of the consecutive coordinates based on the instructions, then cut the movement off once it reached a wall. I wrapped the movement around based on min and max row and column coordinates. For Part 2, I basically created a coordinate conversion table to translate between absolute map coordinates and relative coordinates for rotating around the cube. I made one mistake in Part 2 that took several weeks to solve: I originally precalculated the facing direction. This became problematic when the directions "switch" around the cube. To correct it, I needed to calculate direction based on the previous iteration's direction.

Main workflowMain workflowIterative macroIterative macroWorkflow to create the conversion tableWorkflow to create the conversion tableInput code in sectionsInput code in sectionsInput code as on a flattened cube (referenced in the conversion table workflow)Input code as on a flattened cube (referenced in the conversion table workflow)

Pang_Hee_Choy
10 - Fireball

take few days. and finally get it.

Spoiler
part1: easy with min and max for x and y.

part2: view lot of post still can't figure out. the last mile, the formula mistake.

do the most stupid way. hardcode all the next step for all transition. point the corner for ease of imagine.
Pang_Hee_Choy_0-1674027020626.png

so from, 

1st round: A move to B,
become,
1st round: A move till transit point, adjust face
2nd round: transit point move to B.



it takes slightly more time but easier to check. 
Labels