previous | index | next

Testing the StrategyInfo Class

Here is how the client code would look:

void testStrategy() {
  Strategy strategy = new StrategyInfo;  // Uses simple, mindless strategy
  GameState state = new GameStateInfo(0, 4, 5);
  Move move = strategy->getMove(state);  
  assert(move->getCoins() == 1 && move->getPile() == 2);

  cout << "testStrategy succeeded.\n";
}


previous | index | next