subject

Modify the following code so that: Make the pool start with a random number ([20, 30] inclusive) of coins.
Based on the number of the randomly generated coins at the beginning,
let the computer determine whether Player 1 or Player 2 will be the
winner based on the winning strategy (by printing out the winner).
After deciding the supposed winner and loser, let the computer play
out both of the roles. For the winner, the computer should be applying
the winning strategy; for the loser, the computer should generate a
random amount of coins while following all the rules of the game
Rules of the game:
a) The game starts with 22 coins in a common pool
b) The goal of the game is to take the last coin
c) Two players take turns removing 1, 2, or 3 coins from the pool
d) A player can NOT take more coins than remaining coins in the pool
e) After each turn, the judge announces how many coins remain in the
pool
f) When the last coin is taken, the judge announces the winner
turn=0 #turn=1 remaining coins-24 print(Take turns removing 1, 2, or 3 coins. ) print(You win if you take the last coin.)

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 24.06.2019 09:40
Healthy study habits are best described as
Answers: 1
question
Computers and Technology, 24.06.2019 23:50
Which career involves analyzing various factors that influence the customer decision-making process? analyze various factors that influence the customer decision-making processes. reset next
Answers: 2
question
Computers and Technology, 25.06.2019 04:10
While creating a web page, what does each of the following html tags define? 1. 2. 3. 4. a. defines a new paragraph b. defines a term c. defines a single line break d. defines a heading
Answers: 1
question
Computers and Technology, 25.06.2019 09:30
Which resource produces the cleanest energy? -coal -gasoline -oil -wind
Answers: 1
You know the right answer?
Modify the following code so that: Make the pool start with a random number ([20, 30] inclusive) of...
Questions