Get Inspire insights from former attendees in our AMA discussion thread on Inspire Buzz. ACEs and other community members are on call all week to answer!

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 REPLIES 16
jdunkerley79
ACE Emeritus
ACE Emeritus

I probably should have gone spatial but kept it simple

Spoiler
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.

 

Spoiler
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
11 - 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

Spoiler
dsmdavid_0-1607762702869.png

 

Spoiler
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
Spoiler
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
8 - Asteroid

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:

Spoiler
stephM_0-1607780360402.png

 

Part B:

Spoiler
stephM_1-1607780488105.png

Part B iterative macro: 

Spoiler
stephM_2-1607780534332.png
Balders
11 - Bolide

my submission to the golf overlords

 

Spoiler
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
9 - Comet

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 😄

 

Spoiler
12.png

12_1.png

 It didn't begin well...

Spoiler
12_chaos.png

 Had fun with animating the routes though!

Spoiler
peter_gb
9 - Comet

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

Spoiler
12.png12_1.png

  

I'm also enjoying animating the results!

Spoiler
peter_gb
9 - Comet

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

Spoiler
12.png12_1.png

  

 Enjoying animating the results too..!

Spoiler
12_1_img.png12_2_img.png

  

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

Labels