Commit 8d5dfa55 authored by amir's avatar amir

possible move javadoc

parent a67ada9e
......@@ -22,6 +22,7 @@ public class Main {
System.out.println("Player1, it's your turn!");
}
else {
//if there is no possible move prints pass
System.out.println("pass");
turns++;
}
......@@ -30,6 +31,7 @@ public class Main {
if (play2.numberOfPlayerPossibleMoves(play1.getArr1(), play2.getArr2()) != 0)
System.out.println("Player2, it's your turn!");
else {
//if there is no possible move prints pass
System.out.println("pass");
continue;
}
......@@ -37,6 +39,7 @@ public class Main {
Scanner scanner = new Scanner(System.in);
String nl = scanner.nextLine();
char[] f = nl.toCharArray();
// scanning the x and y coordinates from user
int y = f[0] - '1' + 1;
int x = f[2] - 'A' + 1;
if ((x >= 1) && (x < 9) && (y >= 1) && (y < 9)) {
......
......@@ -13,5 +13,4 @@ public class Player1 extends Players {
return arr1;
}
}
......@@ -110,13 +110,14 @@ public class Players {
}
/**
*
* @param arrOpponent
* @param arr
* @param x
* @param y
* @param moveX
* @param moveY
* this method checks if the move is possible, then equalize the color of the
* player's disc in a line from the blank to the first player's disk that seen
* @param arrOpponent list of opponent discs' coordinates
* @param arr list of the player disc's coordinates
* @param x the x of the blank space
* @param y the y of the blank space
* @param moveX the direction to the x es
* @param moveY the direction to the y es
*/
public void equalize(int[][] arrOpponent, int[][]arr, int x, int y, int moveX, int moveY) {
if (checkTheMoveIfPossible(arrOpponent, arr, x, y, moveX, moveY)) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment