34 lines
478 B
Java
34 lines
478 B
Java
package sudoku;
|
|
|
|
public class Coordinate {
|
|
|
|
private int x;
|
|
private int y;
|
|
|
|
public Coordinate(int row, int col) {
|
|
this.x = row;
|
|
this.y = col;
|
|
}
|
|
|
|
public int getX() {
|
|
return x;
|
|
}
|
|
|
|
public void setX(int x) {
|
|
this.x = x;
|
|
}
|
|
|
|
public int getY() {
|
|
return y;
|
|
}
|
|
|
|
public void setY(int y) {
|
|
this.y = y;
|
|
}
|
|
|
|
public int calculateIndex(int size) {
|
|
return this.y * size + this.x;
|
|
}
|
|
|
|
}
|