Skip to content
Snippets Groups Projects
Commit 1c592134 authored by JimmyTheCat's avatar JimmyTheCat
Browse files

endTurn changed to int return

parent 4437d3ad
No related branches found
No related tags found
No related merge requests found
......@@ -71,18 +71,20 @@ public class Board extends Thread {
*
* @return current player won
*/
public boolean turnEnd() {
public int turnEnd() {
marks++;
boolean victory = victoryCheck();
if(victory && marks > 4) {
System.out.println("You win Player " + currentPlayer);
int endState = 0;
if(marks > 4 && victoryCheck()) {
//System.out.println("You win Player " + currentPlayer);
players[currentPlayer].playerScoreInc();
endState = 1;
} else if(marks == 9) {
System.out.println("A draw");
//System.out.println("A draw");
endState = 2;
} else {
currentPlayer = currentPlayer == 1 ? 0 : 1;
}
return victory;
return endState;
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment