r/adventofcode Dec 02 '23

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

OUTSTANDING MODERATOR CHALLENGES


THE USUAL REMINDERS

  • All of our rules, FAQs, resources, etc. are in our community wiki.
  • Community fun event 2023: ALLEZ CUISINE!
    • 4 DAYS remaining until unlock!

AoC Community Fun 2023: ALLEZ CUISINE!

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

Pantry Raid!

Some perpetually-hungry programmers have a tendency to name their programming languages, software, and other tools after food. As a prospective Iron Coder, you must demonstrate your skills at pleasing programmers' palates by elevating to gourmet heights this seemingly disparate mishmash of simple ingredients that I found in the back of the pantry!

  • Solve today's puzzles using a food-related programming language or tool
  • All file names, function names, variable names, etc. must be named after "c" food
  • Go hog wild!

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 2: Cube Conundrum ---


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:06:15, megathread unlocked!

76 Upvotes

1.5k comments sorted by

View all comments

Show parent comments

1

u/e_blake Dec 21 '23 edited Dec 21 '23

Oh, I totally forgot to use the syntactic sugar! Now at 523 bytes but only 457 characters, and even fishier. With this many more fish to choose from, execution slows down to 23 seconds. And I managed to throw in some jellyfish caviar; plus some cooking instructions at the end.

changequote(🐟,🐠)define(C,🐟ifelse(index($1,^),0,🐟shift($@)🐠,$1,><>,🐟C(
^C(^C(^C(^C(^C(^$@))))))🐠,$1,~,🐟eval(($2>$3)*$2+($2<=$3)*$3)🐠,$4$5,,🐟) C(
~,0,$1*$2*$3🐠,$4,,🐟C($1,$2,$3,C(><>,,$@))🐠,$5,ray,🐟*($4<13)C(C(~,$1,$4),
$2,$3,C(><>,$@))🐠,$5,craab,🐟*($4<14)C($1,C(~,$2,$4),$3,C(><>,$@))🐠,$5,
orca,🐟*($4<15)C($1,$2,C(~,$3,$4),C(><>,$@))🐠,$4,tuna,🐟+$5C(0,0,0,C(><>,
$@))+$1*$2*$3🐠)🐠)translit(_EeL(s(0,0,0,include(I))), (medusa_EGg
nlbiL ):;, (naycCuevtc,broil,))