Fork me on GitHub
#adventofcode
<
2020-12-22
>
markw05:12:17

tonight’s puzzle… reading comprehension

1
Vincent Cantin06:12:01

I was convinced that I was at my disadvantage, reading a very long text while having ADHD, but it turned out that I was not slower than others.

Charles Fourdrignier10:12:17

On this one, I miss a detail which costs me at least 20 minutes. 😄

Vincent Cantin07:12:59

The funniest part of today’s puzzle is that the crab won the card game. Twice.

🦀 4
rjray20:12:02

Must have been your data. For my data, I won the second game 🙂.

Vincent Cantin02:12:28

... based on the sample data.

markw16:12:57

Well after running all night my program did the honorable thing and committed seppuku

markw16:12:47

I’m actually a bit stumped.. I track seen states, verified that on the test loop game, fixed the bug with taking n cards in the subgames, works on sample, hangs forever on actual input

markw16:12:53

Only other thing I can think of is that the confusion around or for seeing prior games. I interpreted that line as you need to see the entire game state (both decks) again

euccastro17:12:38

maybe post your current code? or try someone else's solution on your input data? to double check you haven't been given something broken

markw17:12:06

so bizarre.. so after changing to the interpretation of “seeing” a game as meaning either deck, it terminates… with the wrong answer. I’ll post what I’ve got, apologies for the mess as I’ve hacked it apart trying to fix it and it’s now pretty messy

markw17:12:40

my input is hard coded up top

alekszelark17:12:33

@markw ran my solution with your input, got 36463 with a strict condition

markw17:12:05

ok yeah i figured it was a bug in my solution

markw17:12:19

probably something obvious that i’m just not getting, but it doesn’t help that the test input works perfectly, line-by line

alekszelark17:12:55

I guess this condition in a wrong place (if (= winner :player1) , the game should instantly end if there was a previous round in this game that had exactly the same cards.

alekszelark17:12:13

the test input doesn’t trigger that condition, that’s why it works.

markw18:12:08

Ugh… well that was dumb. Wins the game not the round… oops.

AC19:12:00

I was thrown by (what seemed to me) as inconsistent use of “game” and “sub-game”