Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Replace magic number with variable
  • Loading branch information
joesweeney committed Apr 19, 2017
1 parent aa8c3ce commit 21962b7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/RmCheckersClient.java
Expand Up @@ -148,6 +148,7 @@ public class RmCheckersClient {
} }


public void playGame(int player) { public void playGame(int player) {
int minPly = 8;
try { try {
String msg = readAndEcho(); // initial message String msg = readAndEcho(); // initial message
if(player == 1) { // black if(player == 1) { // black
Expand All @@ -160,7 +161,7 @@ public class RmCheckersClient {
} }
while(currentState.actions().size()>0){ while(currentState.actions().size()>0){
currentState.printState(); currentState.printState();
Move myMove = ai.minimax(currentState, 8); Move myMove = ai.minimax(currentState, minPly);
writeMessageAndEcho(myMove.toString()); writeMessageAndEcho(myMove.toString());
if(!applyMove(myMove.toString())) { if(!applyMove(myMove.toString())) {
System.out.println("couldn't apply my move"); System.out.println("couldn't apply my move");
Expand Down

0 comments on commit 21962b7

Please sign in to comment.