Fixing issues.
This commit is contained in:
parent
5cfb44a1dd
commit
f5ba309a6e
2 changed files with 70 additions and 93 deletions
23
Client.java
23
Client.java
|
@ -309,7 +309,6 @@ public class Client {
|
||||||
frame.setMinimumSize(frame.getSize());
|
frame.setMinimumSize(frame.getSize());
|
||||||
frame.setVisible(true);
|
frame.setVisible(true);
|
||||||
//userInput = stdIn.readLine();
|
//userInput = stdIn.readLine();
|
||||||
<<<<<<< HEAD
|
|
||||||
int gameMode = 0;
|
int gameMode = 0;
|
||||||
userInput = JOptionPane.showInputDialog(frame, temp);
|
userInput = JOptionPane.showInputDialog(frame, temp);
|
||||||
gameMode = Integer.parseInt(userInput);
|
gameMode = Integer.parseInt(userInput);
|
||||||
|
@ -318,21 +317,11 @@ public class Client {
|
||||||
output.println(userInput);
|
output.println(userInput);
|
||||||
}
|
}
|
||||||
gameMode = Integer.parseInt(userInput);
|
gameMode = Integer.parseInt(userInput);
|
||||||
=======
|
|
||||||
userInput = JOptionPane.showInputDialog(frame, temp);
|
|
||||||
//while(!userInput.contains("1") || !userInput.contains("2")) {
|
|
||||||
// userInput = JOptionPane.showInputDialog(frame, temp);
|
|
||||||
//}
|
|
||||||
>>>>>>> b517b06bc614e18b2c6252c12fcfdc1eb71fd38f
|
|
||||||
output.println(userInput);
|
output.println(userInput);
|
||||||
|
|
||||||
String diff = "?";
|
String diff = "?";
|
||||||
in.read(b, 0, 256);
|
in.read(b, 0, 256);
|
||||||
temp = String.valueOf(b).trim();
|
temp = String.valueOf(b).trim();
|
||||||
<<<<<<< HEAD
|
|
||||||
=======
|
|
||||||
//System.out.print(temp);
|
|
||||||
>>>>>>> b517b06bc614e18b2c6252c12fcfdc1eb71fd38f
|
|
||||||
while(!diff.equals("EASY") && !diff.equals("MEDIUM") && !diff.equals("HARD")) {
|
while(!diff.equals("EASY") && !diff.equals("MEDIUM") && !diff.equals("HARD")) {
|
||||||
diff = JOptionPane.showInputDialog(frame, temp);//diff = stdIn.readLine();
|
diff = JOptionPane.showInputDialog(frame, temp);//diff = stdIn.readLine();
|
||||||
diff = diff.toUpperCase();
|
diff = diff.toUpperCase();
|
||||||
|
@ -342,7 +331,6 @@ public class Client {
|
||||||
}
|
}
|
||||||
output.println(userInput);
|
output.println(userInput);
|
||||||
String out = "";
|
String out = "";
|
||||||
<<<<<<< HEAD
|
|
||||||
if(gameMode == 1)
|
if(gameMode == 1)
|
||||||
{
|
{
|
||||||
while(!end) {
|
while(!end) {
|
||||||
|
@ -373,17 +361,6 @@ public class Client {
|
||||||
System.out.println("Invalid move.");
|
System.out.println("Invalid move.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
=======
|
|
||||||
|
|
||||||
while(!end) {
|
|
||||||
char[] buffer = new char[256];
|
|
||||||
in.read(buffer, 0, 256);
|
|
||||||
for(int i = 0; i < buffer.length; ++i) {
|
|
||||||
if(Arrays.equals(Arrays.copyOfRange(buffer, i, i+9), go)) {
|
|
||||||
frame.dispatchEvent(new WindowEvent(frame, WindowEvent.WINDOW_CLOSING));
|
|
||||||
JOptionPane.showMessageDialog(null, "\nGAME OVER\n");
|
|
||||||
end = true;
|
|
||||||
>>>>>>> b517b06bc614e18b2c6252c12fcfdc1eb71fd38f
|
|
||||||
}
|
}
|
||||||
System.out.println(out);
|
System.out.println(out);
|
||||||
output.println(out);
|
output.println(out);
|
||||||
|
|
Reference in a new issue