![]() The first card in each pair is the card being replaced. You must return a list of replacements as a comma-delimited string, where each replacement is in the format Card <- Card (following the card format described above). ![]() You are passed a list of cards as a comma-delimited string, where each card is passed as an integer representing their numeric value, then a character representing their suit. You are passed a list of cards, and you need to return a list of moves to solve the game. Your job is to write an Accordion solver. Of those 3 moves, only the last one has the possibility of winning (You win by replacing 2D <- 2S, then 2S <- 1S). Replace the 2H with the 2D (at a distance of 3), so we end up with 2D,2S,1S.Replace the 2S with the adjacent 1S, so we end up with 2H,1S,2D.Replace the 2H with the adjacent 2S, so we end up with 2S,1S,2D.ExampleĪs an example, consider the following layout: 2H,2S,1S,2D (H: Hearts, S: Spades, D: Diamonds) The replaced card must always precede the replacing card. You can assume that each input is solvable. The game is won when there is only 1 card remaining. Are at a distance of 1 (adjacent) or 3 (two cards in between).Each turn, you replace a card with a later card, where the two cards: Rulesĥ2 face cards are placed face-up in a random order. Accordion is a solitaire card game I recently came across where nearly every layout is solvable, but incredibly hard.
0 Comments
Leave a Reply. |