comparison day7.txt @ 19:1e16a25a9553

Strip down the text to just the puzzle, not the fluff
author IBBoard <dev@ibboard.co.uk>
date Mon, 11 Dec 2023 20:38:55 +0000
parents 9ec95ff0d33d
children
comparison
equal deleted inserted replaced
18:ddb69833346c 19:1e16a25a9553
1 --- Day 7: Camel Cards --- 1 --- Day 7: Camel Cards ---
2
3 Your all-expenses-paid trip turns out to be a one-way, five-minute ride in an airship. (At least it's a cool airship!) It drops you off at the edge of a vast desert and descends back to Island Island.
4
5 "Did you bring the parts?"
6
7 You turn around to see an Elf completely covered in white clothing, wearing goggles, and riding a large camel.
8
9 "Did you bring the parts?" she asks again, louder this time. You aren't sure what parts she's looking for; you're here to figure out why the sand stopped.
10
11 "The parts! For the sand, yes! Come with me; I will show you." She beckons you onto the camel.
12
13 After riding a bit across the sands of Desert Island, you can see what look like very large rocks covering half of the horizon. The Elf explains that the rocks are all along the part of Desert Island that is directly above Island Island, making it hard to even get there. Normally, they use big machines to move the rocks and filter the sand, but the machines have broken down because Desert Island recently stopped receiving the parts they need to fix the machines.
14
15 You've already assumed it'll be your job to figure out why the parts stopped when she asks if you can help. You agree automatically.
16
17 Because the journey will take a few days, she offers to teach you the game of Camel Cards. Camel Cards is sort of similar to poker except it's designed to be easier to play while riding a camel.
18 2
19 In Camel Cards, you get a list of hands, and your goal is to order them based on the strength of each hand. A hand consists of five cards labeled one of A, K, Q, J, T, 9, 8, 7, 6, 5, 4, 3, or 2. The relative strength of each card follows this order, where A is the highest and 2 is the lowest. 3 In Camel Cards, you get a list of hands, and your goal is to order them based on the strength of each hand. A hand consists of five cards labeled one of A, K, Q, J, T, 9, 8, 7, 6, 5, 4, 3, or 2. The relative strength of each card follows this order, where A is the highest and 2 is the lowest.
20 4
21 Every hand is exactly one type. From strongest to weakest, they are: 5 Every hand is exactly one type. From strongest to weakest, they are:
22 6
55 Find the rank of every hand in your set. What are the total winnings? 39 Find the rank of every hand in your set. What are the total winnings?
56 40
57 41
58 --- Part Two --- 42 --- Part Two ---
59 43
60 To make things a little more interesting, the Elf introduces one additional rule. Now, J cards are jokers - wildcards that can act like whatever card would make the hand the strongest type possible. 44 Now, J cards are jokers - wildcards that can act like whatever card would make the hand the strongest type possible.
61 45
62 To balance this, J cards are now the weakest individual cards, weaker even than 2. The other cards stay in the same order: A, K, Q, T, 9, 8, 7, 6, 5, 4, 3, 2, J. 46 To balance this, J cards are now the weakest individual cards, weaker even than 2. The other cards stay in the same order: A, K, Q, T, 9, 8, 7, 6, 5, 4, 3, 2, J.
63 47
64 J cards can pretend to be whatever card is best for the purpose of determining hand type; for example, QJJQ2 is now considered four of a kind. However, for the purpose of breaking ties between two hands of the same type, J is always treated as J, not the card it's pretending to be: JKKK2 is weaker than QQQQ2 because J is weaker than Q. 48 J cards can pretend to be whatever card is best for the purpose of determining hand type; for example, QJJQ2 is now considered four of a kind. However, for the purpose of breaking ties between two hands of the same type, J is always treated as J, not the card it's pretending to be: JKKK2 is weaker than QQQQ2 because J is weaker than Q.
65 49