I am a beginner and java and making a ludo board. I am making a Drop Down MenuJOptionPane where Player # 1 picks what color he wants to be (green, yellow, blue, red). When it comes to Player # 2 I want him to be able to choose all the colors except for what Player # 1 chose.
Here is my code so far (probably crappy but I am programming for the first time):
String player1;
String[] numberOfPlayers = {"two", "three", "four"};
String inputNumberOfPlayers = (String) JOptionPane.showInputDialog(null, "How many people are playing?", "Number of Players", JOptionPane.QUESTION_MESSAGE, null, numberOfPlayers, numberOfPlayers[0]);
if(inputNumberOfPlayers.equals("two")) {
String[] player1Color = {"green", "yellow", "blue", "red"};
String inputColorChoices1 = (String) JOptionPane.showInputDialog(null, "What color what you like to be", "Message to Player 1", JOptionPane.QUESTION_MESSAGE, null, player1Color, player1Color[0]);
player1 = inputColorChoices1;
String[] player2Color = {"green", "yellow", "blue", "red"};
//and then I don't know...
Could anybody please help me or tell me where I can find the right answer?