[PRELIMINARY ROUND 1]
[progcomp2012.git] / agents / ramen / interface.h
1 /*
2  * UCC 2012 Programming Competition Entry
3  * - "Ramen"
4  *
5  * By John Hodge [TPG]
6  */
7 #ifndef _COMMON_H_
8 #define _COMMON_H_
9
10 #if ENABLE_DEBUG
11 # define DEBUG(s, a...) fprintf(stderr, "DEBUG: "s"\n" ,## a)
12 #else
13 # define DEBUG(...)     do{}while(0)
14 #endif
15 #define ASSERT(val)     do{if(!(val)){fprintf(stderr, "ASSERTION FAILED - " #val " at %s:%i\n", __FILE__, __LINE__);exit(-1);} }while(0)
16
17
18 #define true    1
19 #define false   0
20 typedef char    BOOL;
21
22 typedef struct sMove    tMove;
23
24 enum eDirections
25 {
26         DIR_INVAL,
27         DIR_LEFT,
28         DIR_RIGHT,
29         DIR_UP,
30         DIR_DOWN
31 };
32
33 enum eColours
34 {
35         COLOUR_RED,
36         COLOUR_BLUE
37 };
38
39 enum eResult
40 {
41         RESULT_INVAL,
42         RESULT_ILLEGAL,
43         RESULT_OK,
44         RESULT_KILL,
45         RESULT_DIES,
46         RESULT_BOTHDIE,
47         RESULT_VICTORY
48 };
49
50 struct sMove
51 {
52         char    x, y;
53         enum eDirections        dir;    // eDirections
54         char    dist;
55
56         enum eResult    result;
57         char    attacker;
58         char    defender;
59 };
60
61 extern int      giBoardWidth;
62 extern int      giBoardHeight;
63 extern char     *gaBoardState;
64
65 extern void     AI_Initialise(enum eColours Colour, const char *Opponent);
66 extern void     AI_HandleMove(int bMyMove, const tMove *Move);
67 extern void     AI_DoMove(tMove *MyMove);
68
69 #endif
70

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