I need to build a gui application for Nim. I started writing the code and need help. Will you help me write the Nim game?
import javax.swing.JOptionPane;
public class Nim {
public static void main( String args[] )
{
String firstNumber;
String secondNumber;
int number1;
int number2;
int sum;
firstNumber =
JOptionPane.showInputDialog( "Who should go first: 1. Human 2. Computer");
number1 = Integer.parseInt( firstNumber );
number2 = Integer.parseInt( secondNumber );
sum = number1 + number2;
JOptionPane.showMessageDialog(
null, "The sum is " + sum, "Rsults",
JOptionPane.PLAIN_MESSAGE );
System.exit( 0 );
}
}