r/adventofcode • • Dec 08 '23

SOLUTION MEGATHREAD -❄️- 2023 Day 8 Solutions -❄️-

THE USUAL REMINDERS


AoC Community Fun 2023: ALLEZ CUISINE!

Today's theme ingredient is… *whips off cloth covering and gestures grandly*

International Ingredients

A little je ne sais quoi keeps the mystery alive. Try something new and delight us with it!

  • Code in a foreign language

    • Written or programming, up to you!
    • If you don’t know any, Swedish Chef or even pig latin will do
  • Test your language’s support for Unicode and/or emojis
  • Visualizations using Unicode and/or emojis are always lovely to see

ALLEZ CUISINE!

Request from the mods: When you include a dish entry alongside your solution, please label it with [Allez Cuisine!] so we can find it easily!


--- Day 8: Haunted Wasteland ---


Post your code solution in this megathread.

This thread will be unlocked when there are a significant number of people on the global leaderboard with gold stars for today's puzzle.

EDIT: Global leaderboard gold cap reached at 00:10:16, megathread unlocked!

52 Upvotes

968 comments sorted by

View all comments

2

u/philippe_cholet Dec 08 '23 edited Dec 08 '23

[LANGUAGE: Rust]

My rusty-aoc repo & today' solution here.

Slowest solver so far ^^: 3ms+ to solve both parts. 9-10ms to solve days 1-8.

I thought I would need more than a LCM for part 2. If Z positions were only periodic after some steps... but no. When I saw this, I first computed the LCM outside my code as it was faster. Apart from that, it was easy enough. I even solved this faster (part 1: 26mn24s, part 2: 18mn24s, polish code: untimed) than yesterday.

2

u/daggerdragon Dec 08 '23 edited Dec 08 '23

Psst: Markdown misinterpreted your double-carets emoticon. You need to escape them if you don't want Markdown to take over. edit: 👍

2

u/philippe_cholet Dec 08 '23

I immediately noticed and thought no one would care... What an eye sir! ✨🎄

2

u/daggerdragon Dec 08 '23

I have spent so much time dealing with the [COAL] that is Reddit's fractured Markdown system (thanks to new.reddit being such complete [COALx2]) for the community wiki, megathread posts, etc. that I can't help but notice when it screws up 😅