Im having a compiler issue. It keeps asking for a ';' but I have all of them accounted for as far as I know, and I have all the brackets arranged nicely and such and I still cannot see the problem. Heres my code, if I posted the code wrong I apologize.
also I should note before I forget...the specific problem lies in the Run method, and points to the line "for (control.gameOver());"
import java.net.*;
import java.io.*;
public class Player extends Thread {
private Socket connection;
private DataInputStream input;
private DataOutputStream output;
private TicTacToeServer control;
private int number;
private char mark;
protected boolean threadSuspended = true;
public Player(Socket s, TicTacToeServer t, int num) {
mark = (num == 0 ? 'X' : 'O');
connection = s;
try {
input = new DataInputStream (connection.getInputStream());
output = new DataOutputStream (connection.getOutputStream());
}/*end try*/ catch (IOException e) { e.printStackTrace();
System.exit(1);
}//end catch
control = t;
number = num;
}//end Player
public void otherPlayerMoved(int loc) {
try { output.writeUTF("Opponent moved");
output.writeInt(loc);
}/*end try*/ catch (IOException e)
{e.printStackTrace();
}//end catch
}//end otherPlayMoved
public void run() {
int done = false;
try {
control.display("Player" + (number ==0 ? 'X' : 'O') + "Connected");
output.writeChar(mark);
output.writeUTF("Player" + (number == 0? "X connected\n" : "O connecteded\n"));
if(mark == 'X') { output.writeUTF("Waiting for another opponent...");
try {
synchronized(this) {
while(threadSuspended)
wait();
}//end synch
}/*end try*/ catch(InterruptedException e) { e.printStackTrace();
}//end catch
output.writeUTF("Other player connected....time to play the game");
}//end IF
while(!done) {
int location = input.readInt();
if(control.validMove(location, number)) {
control.display("loc" + location);
output.writeUTF("Valid move");
}//end if
else
output.writeUTF("nope");
for (control.gameOver());
done = true;
}//end while
connection.close();
}/*end try*/ catch (IOException e) { e.printStackTrace();
System.exit(1);
}//end catch
}//end Run
}//end Player class