void testIntermediateStrategy() {
Strategy strategy = new IntermediateStrategyInfo;
Move move = strategy->getMove(new GameStateInfo(1, 2, 3));
assert(move->getCoins() == 1 && move->getPile() == 1); // Default to simple strategy
move = strategy->getMove(new GameStateInfo(0, 4, 4));
assert(move->getCoins() == 1 && move->getPile() == 2); // Default to simple strategy
move = strategy->getMove(new GameStateInfo(0, 9, 0)); // Remove pile 2
assert(move->getCoins() == 9 && move->getPile() == 2);
move = strategy->getMove(new GameStateInfo(3, 3, 10)); // Remove pile 3
assert(move->getCoins() == 10 && move->getPile() == 3);
move = strategy->getMove(new GameStateInfo(0, 5, 8)); // Even piles 2 and 3
assert(move->getCoins() == 3 && move->getPile() == 3);
cout << "testIntermediateStrategy succeeded.\n";
}
|