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();
49 cerr << argv[0] << " Error - Should never see this!\n";
51 case Forfax::NO_NEWLINE:
52 cerr << argv[0] << " Error - Expected a new line!\n";
54 case Forfax::EXPECTED_ATTACKER:
55 cerr << argv[0] << " Error - Attacking piece does not exist on board!\n";
57 case Forfax::UNEXPECTED_DEFENDER:
58 cerr << argv[0] << " Error - Unexpected defending piece on board!\n";
60 case Forfax::NO_ATTACKER:
61 cerr << argv[0] << " Error - Couldn't find attacker in list of pieces!\n";
63 case Forfax::NO_DEFENDER:
64 cerr << argv[0] << " Error - Couldn't find defender in list of pieces!\n";
67 case Forfax::COLOUR_MISMATCH:
68 cerr << argv[0] << " Error - Colour of attacker and defender are the same!\n";
70 case Forfax::INVALID_QUERY:
71 cerr << argv[0] << " Error - Query did not make sense\n";
74 cerr << argv[0] << " Game end - VICTORY!\n";
76 case Forfax::BOARD_ERROR:
77 cerr << argv[0] << " Error - An error occurred with the board!\n";
81 //cerr << "Final board state:\n";
82 //forfax.PrintBoard(cerr);
84 //cerr << "Forfax is now exiting!\n";