Added support for easy deployment to offsite server

This commit is contained in:
2021-02-28 05:01:54 +01:00
parent 81c17b2cc1
commit bc0345f061
13 changed files with 65 additions and 44 deletions

View File

@@ -34,16 +34,16 @@ public class TicTacToe_Server {
board = this.convertToNumbers(gameState);
}
public int makeClientMove(String input) {
public boolean makeClientMove(String input) {
int column = Double.valueOf(input.split("\\|")[0]).intValue() / 300;
int row = Double.valueOf(input.split("\\|")[1]).intValue() / 300;
int index = column * 3 + row;
if (isLegalMove(column, row)) {
makeMoveOnBoard(index, 0);
return 200;
return true;
} else {
return 404;
return false;
}
}