62e214735b1aea21f60fc46494868ff58000eec0
[progcomp10.git] / src / link / C / agents / c_angel.c
1 /*
2  *  c_angel.c
3  *  c-link-lib
4  *
5  *  Created by Daniel Axtens on 20/04/10.
6  *  Licensed under an MIT-style license: see the LICENSE file for details.
7  *
8  */
9
10 #include <c_link.h>
11
12 /* Implement the angel bot, which always tells the truth
13    and expects others to do the same */
14
15 ATTACKTYPE Attack( char * foe_name ) {
16         ATTACKTYPE attack;
17         
18         attack.realAttack =  RandomAttack();            /* Chooses randomly from Rock, Paper, Scissors */ 
19         attack.promisedAttack = attack.realAttack;      /* Tells the truth for its bluff */
20
21         return attack;
22 }
23
24 ITEMTYPE Defend( char * foeName, ITEMTYPE foePromisedAttack ) {
25         return foePromisedAttack;       /* Trusts them to be going for a tie */
26 }
27
28 /* You need to define a results function, even if it isn't used
29    (otherwise the linker will complain) */
30 void Results( char * foeName, int isInstigatedByYou, RESULTTYPE winner,
31              ITEMTYPE attItem, ITEMTYPE defItem, ITEMTYPE bluffItem,
32              int pointDelta ) {
33         
34         return; /* Ignore whatever just happened. */
35 }
36
37 /* same for Cleanup() */
38
39 void Cleanup() {
40         return;
41 }

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