ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests Early 2026. Make sure to check your account preferences in my.alteryx.com to make sure you have filled out your security questions. Learn more here
Start Free Trial

General Discussions

Discuss any topics that are not product-specific here.

Advent of Code 2020 - BaseA Style (Day 12)

Jean-Balteryx
16 - Nebula
16 - Nebula

Discussion thread for day 12 of the Advent of Code : https://adventofcode.com/2020/day/12

16 RÉPONSES 16
jdunkerley79
ACE Emeritus
ACE Emeritus

I probably should have gone spatial but kept it simple

Révélation
day12.jd.jpg

Lots of multi-row tools...
- Worked out and normalised the facing angle (so 0 for East, 90 for South, etc...)
- Tracked X and Y separately as easiest
- For WP should have treated as spatial but kept as string instead
AkimasaKajitani
17 - Castor
17 - Castor

Day12!

 

Part 1 is simple. I mainly use the Multi-row formula at both part.

But I think it was a mild problem compared to the last few days.

 

Révélation
At part 2 I must rotate the x,y. So I have needed to use Iterative macro because of having to use previous record of x,y.

AkimasaKajitani_0-1607756401281.png

Part 2 Iterative Macro :
AkimasaKajitani_2-1607756434466.png

 

 AS anonymous user #1105310

dsmdavid
Bolide

First foray into "let's use multirow tools instead of macro" world. It was fun, although maybe a bit out of control for part II

Révélation
dsmdavid_0-1607762702869.png

 

Révélation
I'm not capable of thinking like that, so I needed to build a macro first. Then translate the logic into the multirow, then go for the single tooldsmdavid_1-1607762941548.png
dsmdavid_2-1607763085178.png


with the use of these helpers to do find/replace like a mad man

dsmdavid_0-1607763335976.png

 

 

patrick_digan
17 - Castor
17 - Castor
Révélation
Simple multi-row for part 1 (which I found out in part 2 wouldn't fit all cases but worked for part 1 thankfully. Part 2 I moved to an iterative macro.
patrick_digan_0-1607778650980.png

Macro for part 2:

patrick_digan_1-1607778682426.png

 

Steph_Maddrell
Astéroïde

It's seriously ugly (10 multi-row formula tools, a nested IF with 20 conditions and an iterative macro for good measure) but at least it runs in 3 seconds which is an improvement on the 2 hours from yesterday!

 

Part A:

Révélation
stephM_0-1607780360402.png

 

Part B:

Révélation
stephM_1-1607780488105.png

Part B iterative macro: 

Révélation
stephM_2-1607780534332.png
Balders
Bolide

my submission to the golf overlords

 

Révélation
refactoring the instructions to turn "W" into "E", "S" into "N", "L" into "R" made the multi-rows easier to handle.

They'd also look a lot neater in a language with implicit type conversion, there are ToString() and ToNumber(GetWord()) functions everywhere.

Screenshot 2020-12-12 135959.png

Edit: Oh I could definitely smush the two multi-rows in part 2 into 1 multi-row as they're both of the same Switch([instr],...) function and use a coord format "wx wy bx by dir dist" but I'll leave that as an exercise to the reader.
peter_gb
Boule de feu

Got in a right pickle with that but had a nice solution in the end.

Trusty iterative! Tried multirow but it gives me a headache 😄

 

Révélation
12.png

12_1.png

 It didn't begin well...

Révélation
12_chaos.png

 Had fun with animating the routes though!

Révélation
peter_gb
Boule de feu

A simple solution after getting into a bit of a mess on this one...

Révélation
12.png12_1.png

  

I'm also enjoying animating the results!

Révélation
peter_gb
Boule de feu

Iterative for me! Got in a pickle to start with but got there in the end 🙂

Révélation
12.png12_1.png

  

 Enjoying animating the results too..!

Révélation
12_1_img.png12_2_img.png

  

https://public.tableau.com/profile/petergb#!/vizhome/12_2_16077851001790/Route2

Étiquettes
Auteurs des meilleures solutions