Final Commit
[progcomp2013.git] / agents / silverfish / main.cpp
1 /**
2  * silverfish : A Sample agent for UCC::Progcomp2013
3  * @file main.cpp
4  * @purpose The main function 
5  */
6 #include <cstdlib>
7 #include <cstdio>
8 #include <iostream>
9
10 #include "silverfish.h"
11
12
13 using namespace std;
14
15 /**
16  * @funct main
17  * @purpose The main function; starts the agent
18  * @param argc - Number of arguments, unused
19  * @param argv - Argument string array, unused
20  */
21 int main(int argc, char ** argv)
22 {
23         srand(time(NULL)); // seed random number generator
24         
25         
26
27         string colour; cin >> colour; // first read the colour of the agent
28
29         try
30         {
31                 Silver agent(colour); // create an agent using the colour
32                 agent.Run(cin, cout); // run the agent (it will read from cin and output to cout)
33         }
34         catch (const Exception & e)
35         {
36                 return 1;
37         }
38         
39         
40         return 0; // Don't use exit(3), because it causes memory leaks in the C++ stdlib
41 }

UCC git Repository :: git.ucc.asn.au