The two friend Alpha and Beta have invented a new game called Coins&Papers. The game is played with their coins and a strip of paper divided into cells. The cells are numbered from the left, starting...


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

Extracted text: The two friend Alpha and Beta have invented a new game called Coins&Papers. 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. Alpha and Beta 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. Beta takes her turn first. Develop a python code to find out who wins the game, if Beta 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

Jun 10, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here