#define MAXCOMMANDLEN 15
#define MAXFOENAMELEN 50
#define MAXITEMLEN 10
+#define MAXRESULTLEN 10
#define MAXBOOLLEN 6
/********** Type definitions **********/
/* The type of item used in an attack or defence */
typedef enum {rock, paper, scissors} ITEMTYPE;
-/* A result of a battle */
-typedef enum {win, lose, tie} RESULTTYPE;
+/* A result of a battle, in terms of who won */
+typedef enum {attacker, defender, tie} RESULTTYPE;
/* An attack, consisting of the real attack and the attack promised */
the agent and supervisor)
*/
-#define debugmsg(x...) sprintf(stderr, x)
+#define debugmsg(x...) fprintf(stderr, x)
+
+/* A (hopefully) unique identifier for this particular instance of your agent,
+ to help with debugging */
+int me;
+
/* Returns a random item */
ITEMTYPE RandomAttack();
/* A useful translation table
- eg printf( "I use %s.\n", ITEMNAMES[rock] ); */
+ eg debugmsg( "I use %s.\n", ITEMNAMES[rock] ); */
extern char ITEMNAMES[3][MAXITEMLEN];
-/* Another useful table - what's the result of the
- first item vs the second item? */
+/* Another useful table - who's the victor given an
+ attacker with first item vs defender with the second item? */
extern RESULTTYPE RESULTOF[3][3];
/********** Bot Function definitions **********/
/* Results( foeName : string - the name of your foe;
isInstigatedByYou : 0=you defended/1=you attacked;
- yourItem : ITEMTYPE - the item you used;
- theirItem : ITEMTYPE - the item they used;
- promisedItem : ITEMTYPE - the item that was promised
+ winner : RESULTTYPE - who won
+ attItem : ITEMTYPE - the item used to attack;
+ defItem : ITEMTYPE - the item used to defend;
+ bluffItem : ITEMTYPE - the item that was promised
+ pointDelta : integer - how your points were affected.
);
Called after your agent battles another agent, to tell you how the battle goes.
*/
-void Results( char * foeName, int isInstigatedByYou, ITEMTYPE yourItem,
- ITEMTYPE theirItem, ITEMTYPE promisedItem);
+void Results( char * foeName, int isInstigatedByYou, RESULTTYPE winner,
+ ITEMTYPE attItem, ITEMTYPE defItem, ITEMTYPE bluffItem,
+ int pointDelta );
/* Cleanup();