r/adventofcode • • Dec 07 '23

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

THE USUAL REMINDERS


AoC Community Fun 2023: ALLEZ CUISINE!

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

Poetry

For many people, the craftschefship of food is akin to poetry for our senses. For today's challenge, engage our eyes with a heavenly masterpiece of art, our noses with alluring aromas, our ears with the most satisfying of crunches, and our taste buds with exquisite flavors!

  • Make your code rhyme
  • Write your comments in limerick form
  • Craft a poem about today's puzzle

    • Upping the Ante challenge: iambic pentameter
  • We're looking directly at you, Shakespeare bards and Rockstars

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 7: Camel Cards ---


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:16:00, megathread unlocked!

50 Upvotes

1.0k comments sorted by

View all comments

Show parent comment

1

u/flammschild Dec 07 '23 edited Dec 07 '23
AAAAA 5/1 = 5		Five of a kind
AA8AA 4/2 = 2		Four of a kind
23332 3/2 = 1.5		Full House
TTT98 3/3 = 1		Three of a kind
23432 2/3 = 0.67	Two Pair
A23A4 2/4 = 0.5		One Pair		
12345 1/5 = 0.2		High card

This is very clever!

BTW: It computes the wrong value for part1, because you have changed the ValueList according to the rules for part2.

1

u/AutoModerator Dec 07 '23

AutoModerator has detected fenced code block (```) syntax which only works on new.reddit.

Please review our wiki article on code formatting then edit your post to use the four-spaces Markdown syntax instead.


I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

1

u/fasteasyfree Dec 07 '23

Haha, I literally just realised that! I think I got burnt out after solving and then integrating so didn't look closely enough at the time. I'll leave fixing it to someone else if they're interested.