Refactoring in progress.

Player and Action classes are now singletons (factory pattern) rather than String values.
Implementing more general treesearch code for minimax, alpha-beta, monte carlo using simplified backup logic.
This commit is contained in:
cs6601
2012-08-30 08:41:03 -04:00
parent b44b666663
commit 2e40440838
26 changed files with 647 additions and 433 deletions

View File

@@ -2,19 +2,16 @@ package net.woodyfolsom.msproj;
import static org.junit.Assert.assertTrue;
import net.woodyfolsom.msproj.GameBoard;
import net.woodyfolsom.msproj.GameState;
import org.junit.Test;
public class LegalMoveTest {
@Test
public void testLegalMove1Liberty() {
GameState gameState = new GameState(5);
gameState.playStone('A', 2, GameBoard.BLACK_STONE);
gameState.playStone('B', 3, GameBoard.BLACK_STONE);
gameState.playStone('B', 1, GameBoard.BLACK_STONE);
assertTrue(gameState.playStone('B', 2, GameBoard.WHITE_STONE));
gameState.playStone(Player.BLACK, Action.getInstance("A2"));
gameState.playStone(Player.BLACK, Action.getInstance("B3"));
gameState.playStone(Player.BLACK, Action.getInstance("B1"));
assertTrue(gameState.playStone(Player.WHITE, Action.getInstance("B2")));
System.out.println(gameState);
}
}