How do you code this in java? Or playing a card?
Hand of player one f ly 5 card Hand of player two y 5 cords) Hand of player three initially Scarch First cord in the discordion which you play on il card Remaining cards in the draw pile top to bottom all remaining cards 1. Output the starting card on the discard pile 2. Starting with player one, decide which cord they will play for pick up from the draw pilies and output their choice for DRAW if they have no match and must try to pick up acord from the drople 3. Repeat this for each player until a player has no more cards in their hand. This player becomes the winner of the game. Output format On First/storting card on the discord ple) 1: (Card played by player 1") 2: (Card played by player 2") 3. (Card played by player 3) 1. (Card played by player 1") 2(Card played by player 2") 3: (Card played by player 3) IN [Last cord played by player N) (WEBER) Where N -1.2. 3. the player first able to play all of their cards and emply their hand * no cordis able to be played by a player output on their tum and pick up a cord from the draw pile one exists). PROBLEM 1: Match-making 50points) For the first portion of this problem, you will implement simple version of our gome Ochos Locos. For this simplified version there will be the players. The rules of the game ore follows: Bank Rules of the game Ochos locos Setup The game starts with a shuffled deck of 32 cards given to you Each player is de 5 cards and one card is uplumed in the discord The remaining cords from the deck are placed in a row pille that matches either the Ona player's tum, they must play a cordones colour or number of the card played just before if the player has more cards in the hand of the matching number than they do of the matching colour They will choose to play a card of matching number...4 They will play the cord of that number that they have which comes first in rainbow order red yellow-green-blue. Le R4Y4-G4-84) of the player equal or more cards in their hand of the matching colour than they do of the matching number . They will choose to play a cord of matching colour They will play the cord of that color that they have which comes first counting order 1-2-3-4-5-6-7-8. . a player does not have a cord that they are able to play they pick up a new cord from the top of the deeplefone is pass if not). PROBLEM 1: Match-making [50points) For the first portion of this problem, you will implement a simple version of our game Ochos Locos. For this simplified version, there will be three players. The rules of the game are as follows: Basic Rules of the game Ochos Locos Setup: The game starts with a shuffled deck of 32 cards (given to you). Each player is dealt 5 cards and one card is upturned in the discard pile. . The remaining cards from the deck are placed in a draw pile Play: On a player's turn, they must play a card (if one exists) that matches either the colour or number of the card played just before: o If the player has more cards in their hand of the matching number than they do of the matching colour: . They will choose to play a card of matching number. (e.g. 4) They will play the card of that number that they have which comes first in rainbow order: red-yellow-green-blue. (.e. R4-Y4-G4-B4) . If the player equal or more cards in their hand of the matching colour than they do of the matching number: They will choose to play a card of matching colour. They will play the card of that colour that they have which comes first counting order: 1-2-3-4-5-6-7-8. . If a player does not have a card that they are able to play, they pick up a new card from the top of the draw pile (if one exists, pass if not). Hand of player one f ly 5 card Hand of player two y 5 cords) Hand of player three initially Scarch First cord in the discordion which you play on il card Remaining cards in the draw pile top to bottom all remaining cards 1. Output the starting card on the discard pile 2. Starting with player one, decide which cord they will play for pick up from the draw pilies and output their choice for DRAW if they have no match and must try to pick up acord from the drople 3. Repeat this for each player until a player has no more cards in their hand. This player becomes the winner of the game. Output format On First/storting card on the discord ple) 1: (Card played by player 1") 2: (Card played by player 2") 3. (Card played by player 3) 1. (Card played by player 1") 2(Card played by player 2") 3: (Card played by player 3) IN [Last cord played by player N) (WEBER) Where N -1.2. 3. the player first able to play all of their cards and emply their hand * no cordis able to be played by a player output on their tum and pick up a cord from the draw pile one exists). PROBLEM 1: Match-making 50points) For the first portion of this problem, you will implement simple version of our gome Ochos Locos. For this simplified version there will be the players. The rules of the game ore follows: Bank Rules of the game Ochos locos Setup The game starts with a shuffled deck of 32 cards given to you Each player is de 5 cards and one card is uplumed in the discord The remaining cords from the deck are placed in a row pille that matches either the Ona player's tum, they must play a cordones colour or number of the card played just before if the player has more cards in the hand of the matching number than they do of the matching colour They will choose to play a card of matching number...4 They will play the cord of that number that they have which comes first in rainbow order red yellow-green-blue. Le R4Y4-G4-84) of the player equal or more cards in their hand of the matching colour than they do of the matching number . They will choose to play a cord of matching colour They will play the cord of that color that they have which comes first counting order 1-2-3-4-5-6-7-8. . a player does not have a cord that they are able to play they pick up a new cord from the top of the deeplefone is pass if not). PROBLEM 1: Match-making [50points) For the first portion of this problem, you will implement a simple version of our game Ochos Locos. For this simplified version, there will be three players. The rules of the game are as follows: Basic Rules of the game Ochos Locos Setup: The game starts with a shuffled deck of 32 cards (given to you). Each player is dealt 5 cards and one card is upturned in the discard pile. . The remaining cards from the deck are placed in a draw pile Play: On a player's turn, they must play a card (if one exists) that matches either the colour or number of the card played just before: o If the player has more cards in their hand of the matching number than they do of the matching colour: . They will choose to play a card of matching number. (e.g. 4) They will play the card of that number that they have which comes first in rainbow order: red-yellow-green-blue. (.e. R4-Y4-G4-B4) . If the player equal or more cards in their hand of the matching colour than they do of the matching number: They will choose to play a card of matching colour. They will play the card of that colour that they have which comes first counting order: 1-2-3-4-5-6-7-8. . If a player does not have a card that they are able to play, they pick up a new card from the top of the draw pile (if one exists, pass if not)