More work on C sample agents. Learning agents are a pain.
[progcomp10.git] / link / C / c-link-lib / c_link.c
index e75997f..680450e 100644 (file)
 #include <time.h>
 
 /* You don't need to read this file.
-   This merely sets up the I/O for you, so all you have to do is define the bot
-   functions defined in <c_link.h>
+   All you have to do is implement the bot functions defined in <c_link.h>
+   This file sets up the I/O for you, as well as some utility functions and tables. 
  */
 
 char ITEMNAMES[3][MAXITEMLEN] = {"Rock", "Paper", "Scissors"};
 
+/* rock-rock     rock-paper     rock-scissors 
+   paper-rock    paper-paper    paper-scissors
+   scissors-rock scissors-paper scissors-scissors */  
+   
+RESULTTYPE RESULTOF[3][3] = { { tie, lose, win },
+                              { win, tie, lose },
+                              { lose, win, tie } };
+
 
 ITEMTYPE RandomAttack() {
        return (ITEMTYPE)rand()%3;
@@ -73,5 +81,7 @@ int main( int argc, char * argv[] ) {
                scanf( "%s", command );
        }
        
+       Cleanup();
+       
        return 0;
 }
\ No newline at end of file

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