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.

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
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
Transcribed Image 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
Expert Solution
steps

Step by step

Solved in 2 steps with 2 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY