2 * "forfax", a sample Stratego AI for the UCC Programming Competition 2012
3 * The main function for the "forfax" AI program
4 * @author Sam Moore (matches) [SZM]
5 * @website http://matches.ucc.asn.au/stratego
7 * @git git.ucc.asn.au/progcomp2012.git
26 * @param argc the number of arguments
27 * @param argv the arguments
28 * @returns exit code 0 for success, something else for error
29 * Do I really need to tell you this?
31 int main(int argc, char ** argv)
37 Forfax::Status move = forfax.Setup();
40 while (move == Forfax::OK)
42 move = forfax.MakeMove();
48 cerr << argv[0] << " Error - Should never see this!\n";
50 case Forfax::NO_NEWLINE:
51 cerr << argv[0] << " Error - Expected a new line!\n";
53 case Forfax::EXPECTED_ATTACKER:
54 cerr << argv[0] << " Error - Attacking piece does not exist on board!\n";
56 case Forfax::UNEXPECTED_DEFENDER:
57 cerr << argv[0] << " Error - Unexpected defending piece on board!\n";
59 case Forfax::NO_ATTACKER:
60 cerr << argv[0] << " Error - Couldn't find attacker in list of pieces!\n";
62 case Forfax::NO_DEFENDER:
63 cerr << argv[0] << " Error - Couldn't find defender in list of pieces!\n";
66 case Forfax::COLOUR_MISMATCH:
67 cerr << argv[0] << " Error - Colour of attacker and defender are the same!\n";
69 case Forfax::INVALID_QUERY:
70 cerr << argv[0] << " Error - Query did not make sense\n";
73 cerr << argv[0] << " Game end - VICTORY!\n";
75 case Forfax::BOARD_ERROR:
76 cerr << argv[0] << " Error - An error occurred with the board!\n";
80 cerr << "Final board state:\n";
81 forfax.PrintBoard(cerr);
83 cerr << "Forfax is now exiting!\n";