Skip to content

Commit 5a92adb

Browse files
authored
Typo
"oponent" to "opponent"
1 parent d98b696 commit 5a92adb

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

‎algorithms/src/main/java/com/baeldung/algorithms/mcts/montecarlo/MonteCarloTreeSearch.java‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ public class MonteCarloTreeSearch {
1010

1111
private static final int WIN_SCORE = 10;
1212
private int level;
13-
private int oponent;
13+
private int opponent;
1414

1515
public MonteCarloTreeSearch() {
1616
this.level = 3;
@@ -32,11 +32,11 @@ public Board findNextMove(Board board, int playerNo) {
3232
long start = System.currentTimeMillis();
3333
long end = start + 60 * getMillisForCurrentLevel();
3434

35-
oponent = 3 - playerNo;
35+
opponent = 3 - playerNo;
3636
Tree tree = new Tree();
3737
Node rootNode = tree.getRoot();
3838
rootNode.getState().setBoard(board);
39-
rootNode.getState().setPlayerNo(oponent);
39+
rootNode.getState().setPlayerNo(opponent);
4040

4141
while (System.currentTimeMillis() < end) {
4242
// Phase 1 - Selection
@@ -93,7 +93,7 @@ private int simulateRandomPlayout(Node node) {
9393
State tempState = tempNode.getState();
9494
int boardStatus = tempState.getBoard().checkStatus();
9595

96-
if (boardStatus == oponent) {
96+
if (boardStatus == opponent) {
9797
tempNode.getParent().getState().setWinScore(Integer.MIN_VALUE);
9898
return boardStatus;
9999
}

0 commit comments

Comments
 (0)