Regina T.

asked • 07/03/21

PLEASE SOLVE THE PROBLEM IN PYTHON WITHOUT USING ANY BUILT-IN FUNCTIONS

Suppose you have been hired to develop a musical chair game. In this game there will be 7 participants and all of them will be moving clockwise around a set of 7 chairs organized in a circular manner while a music will be played in the background. You will control the music using random numbers between 0-3.If the generated random number is 1, you will stop the music and if the number of participants who are still in the game is n, the participant at position (n/2) will be eliminated. Each time a participant is eliminated, a chair will be removed and you have to print the player names who are still in the game. The game will end when there will be only one participant left. At the end of the game, display the name of the winner. [Hint: You will need to invoke a method to generate a random number between 0 (inclusive) to 3 (inclusive)]


1 Expert Answer

By:

Patrick B. answered • 07/03/21

Tutor
4.7 (31)

Math and computer tutor/teacher

Regina T.

what can be used instead of seed? randint is okay but i am not alowed to used datetime.time(). I can use randint here but others are not allowed. please help
Report

07/04/21

Patrick B.

generate a random int.... call it x. then for i in range(x): dummyX = random.randint() this will set the random # generator to a random position in the sequence
Report

07/07/21

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.