Williams and Tuner have invented a new game called Strip-Pennies. The game is played with their coins and a strip of paper divided into cells. The cells are numbered from the left, starting from 1....


Williams and Tuner have invented a new game called Strip-Pennies. The game is played with<br>their coins and a strip of paper divided into cells. The cells are numbered from the left,<br>starting from 1. Williams and Tuner put some coins at some random cells on the strip, each<br>coin in a cell. They alternatively take their turn to play the game. At each step, a player must<br>take a coin and move it to a cell to the left of it. There is at most one coin in a cell at any time<br>of the game. Of course, a coin cannot jump over another coin. Whoever cannot move loses<br>the game. Tuner takes her turn first.<br>Develop a python code to find out who wins the game, if Tuner could win the game, show<br>her a winning move. If there are several winning moves, show her the winning move that<br>uses the leftmost possible coin. If there are still several moves, show her the move that moves<br>the coin as far as possible to the left.<br>Sample Input:<br>1<br>3<br>135<br>Sample Output:<br>Tuner wins<br>Move 5 to 4<br>

Extracted text: Williams and Tuner have invented a new game called Strip-Pennies. The game is played with their coins and a strip of paper divided into cells. The cells are numbered from the left, starting from 1. Williams and Tuner put some coins at some random cells on the strip, each coin in a cell. They alternatively take their turn to play the game. At each step, a player must take a coin and move it to a cell to the left of it. There is at most one coin in a cell at any time of the game. Of course, a coin cannot jump over another coin. Whoever cannot move loses the game. Tuner takes her turn first. Develop a python code to find out who wins the game, if Tuner could win the game, show her a winning move. If there are several winning moves, show her the winning move that uses the leftmost possible coin. If there are still several moves, show her the move that moves the coin as far as possible to the left. Sample Input: 1 3 135 Sample Output: Tuner wins Move 5 to 4

Jun 10, 2022
SOLUTION.PDF

Get Answer To This Question

Submit New Assignment

Copy and Paste Your Assignment Here