Question: python The rule is that which list contains more H, that is winner what kind of problem description missingwhat do you need exactly? Strategy 1.

 python The rule is that which list contains more "H", that
is winner what kind of problem description missingwhat do you need exactly?
Strategy 1. Functions a. Define a function to read the input. One
python
The rule is that which list contains more "H", that is winner
what kind of problem description missingwhat do you need exactly?
possibility is to have the function return a list of two lists.

Strategy 1. Functions a. Define a function to read the input. One possibility is to have the function return a list of two lists. The first list would contain the five coin position characters for Player 1. The second list would contain the five coin position characters for Player 2. The function will either read the position from the input, or randomly generate a position. b. Define a function to play out the game. It should take the position as an argument, and return either 15, 2 or 0 as described in the assignment. 1. The function will have to manipulate the players' lists. Each player has both an army list and a prisoners list The prisoners list starts empty. 11. A while loop can be used to run rounds of the game until it is over 111 Inside the while loop, there will be an if with two or three cases. It might be worth defining a separate function for a round that is not a tie, to avoid duplicating code. 2. Call the functions, print the result. random Sample input requesting a game from a given position: position THHTT TTHTH The program should print the starting position, then (silently) play out the game according to the Coin War rules, It should then print 1 if Player 1 wins, 2 if Player 2 wins, or if there is a tie. Sample Program Run Assume file game1.txt contains this text: position THHTT TTHTH Then run the program: >>> python3 coinwar.py >> python3 coinwar.py

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!