Fork me on GitHub

tonight’s puzzle… reading comprehension

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

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

Vincent Cantin02:12:28

... based on the sample data.


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


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


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


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


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


my input is hard coded up top


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


ok yeah i figured it was a bug in my solution


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


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.


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


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


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