Skip to content

Commit

Permalink
Merge featurecat#827 again for further fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Hiraoka committed Nov 13, 2021
2 parents c17c108 + 8dafe7d commit 0c2eaab
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/main/java/featurecat/lizzie/gui/BoardRenderer.java
Original file line number Diff line number Diff line change
Expand Up @@ -1912,9 +1912,9 @@ public void drawEstimateRect(ArrayList<Double> estimateArray, boolean isZen) {
// KataGo's estimates are for player to move, not for black.
if (!Lizzie.board.getHistory().isBlacksTurn()) estimate = -estimate;
}
int[] c = Lizzie.board.getCoord(i);
int x = c[1];
int y = c[0];
int[] c = Lizzie.board.getCoordKataGo(i);
int x = c[0];
int y = c[1];
int stoneX = scaledMarginWidth + squareWidth * x;
int stoneY = scaledMarginHeight + squareHeight * y;
// g.setColor(Color.BLACK);
Expand Down
10 changes: 8 additions & 2 deletions src/main/java/featurecat/lizzie/rules/Board.java
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,14 @@ public static int getIndex(int x, int y) {
}

public static int[] getCoord(int index) {
int y = index % Board.boardWidth;
int x = (index - y) / Board.boardWidth;
int y = index % Board.boardHeight;
int x = (index - y) / Board.boardHeight;
return new int[] {x, y};
}

public static int[] getCoordKataGo(int index) {
int x = index % Board.boardWidth;
int y = (index - x) / Board.boardWidth;
return new int[] {x, y};
}

Expand Down

0 comments on commit 0c2eaab

Please sign in to comment.