[#5] Counting Cards - PuzzleNode
Rocky sat down hours ago with his three fellow troublemakers and now is too drunk to remember what card game they are playing. Rocky figures even if he doesn't remember, he's halfway there if he can at least keep track of his partner's hand. Luckily, his partner Lil devised ahead of time a system of signals so that they could communicate their moves to each other without the other players knowing, and she also let Rocky peek at her initial hand. The problem is that Lil is not very good at hiding her signals, and their opponents Danny Dogg and Shady Skunk have caught on. Rocky's vision never was that good, and in his inebriated state, he can't always tell if it's Lil giving him signals or his opponents tricking him with fake signals.
I know you're walking in late to the saloon, but can you help Rocky keep track of what's in Lil's hand?
Mouse Nell has a nervous habit of watching the game from Rocky's shoulder and has been taking obsessive notes about what moves she can see and what signals are being given.
Her notes are attached below in the "INPUT" file. The format is described below.
Problem
You'll need to provide Rocky with a list of which cards Lil has in her hand after each of her turns. The format of this file is also described below.
Note that:
- One standard deck of cards is being used in the game (52 suit cards, no Joker cards).
- Everyone is dealt 4 cards to begin with.
- Possible moves are drawing from the deck, passing a card to another player, and discarding to the discard pile.
- Once a card is discarded, it never goes back into a player's hand.
- When a player discards a card, everyone sees it.
- Luckily, you don't have to understand anything more than this about the game itself.
The moves that Lil signals to Rocky are drawing a card, passing a card to another player, and receiving a card from another player, which may have happened earlier in the round.
So for example, her turn might consist of:
- receiving the Jack of Diamonds and 10 of Clubs from Rocky and 2 other cards from Shady during the round;
- drawing 3 cards;
- discarding the 7 of Hearts;
- passing 2 cards to Danny;
- and passing the Jack of Spades to Rocky.
Note that the discarded 7 of Hearts and the Jack of Spades she passed are visible to Rocky, as well as the two cards she received from Rocky, while the other cards are not visible.
Read full article from [#5] Counting Cards - PuzzleNode
No comments:
Post a Comment