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.
Please answer it in Java code.
Trending nowThis is a popular solution!
Step by stepSolved in 3 steps with 1 images
- In this game, one flyand three frogs are placed randomly on a board with the size 7x7.In each iteration, they move randomlywithin the board, and the simulation stops when one of the frogs eats the fly.Fly and frogs are essentially creatures that can move, make noise, and eat. Frogs can move up to 2squares in any direction, and flies can move up to 1. Frogs make the "Croak! Croak!" sound, and fliesmake "ZzzZZz!". Since frogs should not eat their kind, a function of "isEatable" should also beimplemented in decision making. A variable or function to check if the fly is alive is also required as aterminate condition for simulation.In each iteration, an 'f' character represents frogs' position on board, and an '*' character is used torepresent the position of fly. Java Language I dont want the survival game that answer of my last two questions I want the above question and example output like in the photosarrow_forwardLoop through the animalList created in a previous question and print the total time taken and total time given for each animal. Example output: Zirly the Zebra - Time taken for all behaviors: 890 minutes of 1000 Henry the Hawk - Time taken for all behaviors: 350 minues of 1000 Choose one of the following from the above choices (A, B, C or D within the code):// Assume the following variables exist: Behavior[] someBehaviors = // Omitted for brevity Animal zirly = Animal("Zirly the Zebra", 812.3, someBehaviors); Animal henry = Animal("Henry the Hawk", 35.5, someBehaviors); Animal[] animalList = new Animal[]{ zirly, henry }; // --------------------------- // A for(int i = animalList.length; i < animalList.length; i++) { Animal tempAnimal = animalList[i]; int timeTakenSum = 0; int timeGivenSum = 0; for(j = 0; j < tempAnimal.getBehaviorList().length; j++) { Behavior tempBehavior = tempAnimal.getBehaviorList()[j]; timeTakenSum +=…arrow_forwardThe game is played in the magic maze, as shown below. The squares are flaming lava pools. If you try to cross them you will die. The grid lines are passageways and are safe to travel in. You can start at any location on the grid but must travel in the passageways. You may travel as far as you want in any direction, but once you turn, you must repeat that distance and you may only make left turns. You may not reverse direction inside the tight passageways. You must end up at the same spot you started at. If you successful, then you gain a magic coin, which automatically appears. You can start over again and again in a different or same starting spot and earn new magic coins, but the routes you take must differ somehow for each magic coin. That is, no magic coins for the exact same route as previously done. If the route varies in any way (perhaps it is the same starting location and ending location as a previous route, but longer), it will earn a new magic coin. Mad Madame Mim has…arrow_forward
- TYPEWRITTEN ONLY PLEASE UPVOTE. DOWNVOTE FOR HANDWRITTEN. DO NOT ANSWER IF YOU ALREADY ANSWERED THIS. THE BIG NUMBER IN THE SIDE IS FOR NUMBERING.arrow_forwardIn the Dice Roll game, the player begins with a score of 1000. The player is prompted for the numberof points to risk and a second prompt asks the player to choose either high or low. The player rollstwo dice and the outcome is compared to the player’s choice of high or low. If the dice total is between2 and 6 inclusive, then it is considered “low”. A total between 8 and 12 inclusive is “high”. A total of7 is neither high nor low, and the player loses the points at risk. If the player had called correctly, thepoints at risk are doubled and added to the total points. For a wrong call, the player loses the points atrisk. Create a DiceRollGame application that uses a DRPlayer object based on this specification. TheDRPlayer object should have two Die member variables that represent the dice. The Die class shoulduse a random number generator to determine the outcome in a roll() method. Application outputshould look similar to:arrow_forwardIn the Dice Roll game, the player begins with a score of 1000. The player is prompted for the numberof points to risk and a second prompt asks the player to choose either high or low. The player rollstwo dice and the outcome is compared to the player’s choice of high or low. If the dice total is between2 and 6 inclusive, then it is considered “low”. A total between 8 and 12 inclusive is “high”. A total of7 is neither high nor low, and the player loses the points at risk. If the player had called correctly, thepoints at risk are doubled and added to the total points. For a wrong call, the player loses the points atrisk. Create a DiceRollGame application that uses a DRPlayer object based on this specification. TheDRPlayer object should have two Die member variables that represent the dice. The Die class shoulduse a random number generator to determine the outcome in a roll() method. Application outputshould look similar to:arrow_forward
- Minecraft is an open-world video game based on placing and interacting with 3D textured blocks. If you are not familiar with the game, each player has a personal inventory which can hold a limited number of blocks and items. Specific blocks and items can be combined on a crafting table to form new items. For example, three wheats arranged in a horizontal line on a crafting table gives the player one loaf of bread. These combinations are known as crafting recipes and the game has hundreds of them. This question deals with the recipe for making a cake. One cake requires 1 egg. 2 sugars, 3 wheats and 3 buckets of milk. Your job is to build a program to help the player determine how many cakes they can make based on the number of ingredients that they have. Crafting Figure 2: A screenshot from Minecraft showing a crafting table showing the recipe for making a cake. Your program won't make this picture, this is just showing you the rules for making a cake! Most items in the player's…arrow_forwardYou will build a simplified, one-player version of the classic board game Battleship! In this version of the game, there will be a single ship hidden in a random location on a 5 × 5 grid. The player will have 4 guesses at most to try to sink the ship. At each guess, the player names an attacking coordinate, that is (“guess row”, “guess col”). The game ends in two conditions: (1) the player is out of guesses; (2) the player hits the ship. Examples are given in Figure 1. The 5 × 5 board is shown every time the player inputs a guess entry. The ship takes only one entry of the board and it is randomly given before the player’s guesses. The player inputs guessing entries in the Python console. Entries missed the ship are replaced by “X” in the board. You must use loop in your code. Please submit your code and console screenshots to bartleby. Code contain- ing syntax error will be graded zero. Hints: 1 Create a variable board and set it equal to an empty list…arrow_forwardwhen coding a chess game, implement the following method: isInCheck(Side s): Returns true if the king of side s is attacked by any of the opponent’s pieces, i.e., if in the current board state, any of the opponents pieces can move to where the king is. Otherwise, it returns false. Note that this method is only used to warn the player when they are in check. You can use the GUI to test if this is working. public boolean isInCheck(Side side) { // TODO write this method return false; } public enum Side { BLACK, WHITE; public static Side negate(Side s) { return s == Side.BLACK ? Side.WHITE : Side.BLACK; } }arrow_forward
- Computer Networking: A Top-Down Approach (7th Edi...Computer EngineeringISBN:9780133594140Author:James Kurose, Keith RossPublisher:PEARSONComputer Organization and Design MIPS Edition, Fi...Computer EngineeringISBN:9780124077263Author:David A. Patterson, John L. HennessyPublisher:Elsevier ScienceNetwork+ Guide to Networks (MindTap Course List)Computer EngineeringISBN:9781337569330Author:Jill West, Tamara Dean, Jean AndrewsPublisher:Cengage Learning
- Concepts of Database ManagementComputer EngineeringISBN:9781337093422Author:Joy L. Starks, Philip J. Pratt, Mary Z. LastPublisher:Cengage LearningPrelude to ProgrammingComputer EngineeringISBN:9780133750423Author:VENIT, StewartPublisher:Pearson EducationSc Business Data Communications and Networking, T...Computer EngineeringISBN:9781119368830Author:FITZGERALDPublisher:WILEY