On a boring Friday, you are sitting alone in your room. Due to the lockdown, you cannot go out to play with your friends, so you had nothing to do at home. Suddenly, your little sister comes and tells...


Write code inJava orPython


On a boring Friday, you are sitting alone in your room. Due to the lockdown, you cannot<br>go out to play with your friends, so you had nothing to do at home. Suddenly, your little<br>sister comes and tells you that some of your family members want to play an interesting<br>game called “Friday Fun

Extracted text: On a boring Friday, you are sitting alone in your room. Due to the lockdown, you cannot go out to play with your friends, so you had nothing to do at home. Suddenly, your little sister comes and tells you that some of your family members want to play an interesting game called “Friday Fun". Therefore, you decided to join in the game. There are few rules in the game: a. All the members that will play the game must sit in a circular manner. b. There will be a dice, which will determine the faith of the player. c. If dice after flipping get '1 or 6', the player has to pass the coin to the next player (sitting to his/her right). d. If dice after flipping get '3 or 5, then the player is in danger but does not get eliminated, so the player has to pass it to the next member (sitting to his/her right). e. If dice after flipping get 2 or 4, the player gets eliminated and passes the coin to the next player (sitting to his/her right). f. The game continues until there is only one member left and he/she will get a surprise gift. Write a method that finds out the winner of the Friday Fun' game, you will be given as input the number of players playing and the dice sequence. [You must use recursion for solving this problem.] Sample Sample Explanation Input Output 1st turn: Starting from 1, the dice is 1', so he passes it to the second player. | 2nd turn: dice is '5', so the second player passes it to the third member. 3rd turn: dice is '2', so the third player gets eliminated and passes it to the 3, 1 "152" first member. 4rd turn: dice is '1' so the first player passes it to the second player. 5h turn: dice is '5' so the second player passes it to the first player. 6th turn: dice is 2', so the second player gets eliminated and passes it to the first player. |No further round is required as there is only one member so the winner is the first player.
Jun 04, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here