X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=src%2Flink%2FC%2Fagents%2Fc_angel.c;h=d11b551da5f1661b4e109dd69c19cf8dc9ff8d8c;hb=c1e6427973421be71c7cc32b42d7181d6abb8595;hp=17d5b65ce76b26394ce971cd56b75451cf02094d;hpb=e4184557ebc33201e217e167d577128f710e4890;p=progcomp10.git diff --git a/src/link/C/agents/c_angel.c b/src/link/C/agents/c_angel.c old mode 100644 new mode 100755 index 17d5b65..d11b551 --- a/src/link/C/agents/c_angel.c +++ b/src/link/C/agents/c_angel.c @@ -1,40 +1,45 @@ -/* - * c_angel.c - * c-link-lib - * - * Created by Daniel Axtens on 20/04/10. - * Licensed under an MIT-style license: see the LICENSE file for details. - * - */ - -#include - -/* Implement the angel bot, which always tells the truth - and expects others to do the same */ - -ATTACKTYPE Attack( char * foe_name ) { - ATTACKTYPE attack; - - attack.realAttack = RandomAttack(); /* Chooses randomly from Rock, Paper, Scissors */ - attack.promisedAttack = attack.realAttack; /* Tells the truth for its bluff */ - - return attack; -} - -ITEMTYPE Defend( char * foeName, ITEMTYPE foePromisedAttack ) { - return foePromisedAttack; /* Trusts them to be going for a tie */ -} - -/* You need to define a results function, even if it isn't used - (otherwise the linker will complain) */ -void Results( char * foeName, int isInstigatedByYou, ITEMTYPE yourItem, - ITEMTYPE theirItem, ITEMTYPE promisedItem) { - - return; /* Ignore whatever just happened. */ -} - -/* same for Cleanup() */ - -void Cleanup() { - return; -} \ No newline at end of file +/* + * c_angel.c + * c-link-lib + * + * Created by Daniel Axtens on 20/04/10. + * Licensed under an MIT-style license: see the LICENSE file for details. + * + */ + +#include + +void * Initialise( char * me ) { + return NULL; +} + +/* Implement the angel bot, which always tells the truth + and expects others to do the same */ + +ATTACKTYPE Attack( void * this, char * foe_name ) { + ATTACKTYPE attack; + + attack.realAttack = RandomAttack(); /* Chooses randomly from Rock, Paper, Scissors */ + attack.promisedAttack = attack.realAttack; /* Tells the truth for its bluff */ + + return attack; +} + +ITEMTYPE Defend( void * this, char * foeName, ITEMTYPE foePromisedAttack ) { + return foePromisedAttack; /* Trusts them to be going for a tie */ +} + +/* You need to define a results function, even if it isn't used + (otherwise the linker will complain) */ +void Results( void * this, char * foeName, int isInstigatedByYou, RESULTTYPE winner, + ITEMTYPE attItem, ITEMTYPE defItem, ITEMTYPE bluffItem, + int pointDelta ) { + + return; /* Ignore whatever just happened. */ +} + +/* same for Cleanup() */ + +void Cleanup( void * this ) { + return; +}