5 * Created by Daniel Axtens on 20/04/10.
\r
6 * Licensed under an MIT-style license: see the LICENSE file for details.
\r
13 /* Implement the streetfighter bot, which thinks everyone has it in for him. */
\r
15 void * Initialise( char * myName ) {
\r
19 ATTACKTYPE Attack( void * this, char * foe_name ) {
\r
22 attack.realAttack = RandomAttack();
\r
24 /* Here we choose the thing that will hurt them if they go for the kill */
\r
25 switch (attack.realAttack) {
\r
27 attack.promisedAttack = paper;
\r
30 attack.promisedAttack = scissors;
\r
32 default: /* attack = scissors */
\r
33 attack.promisedAttack = rock;
\r
39 /* Here we assume they are lying, trying to kill us. And we try to kill them. */
\r
40 ITEMTYPE Defend( void * this, char * foeName, ITEMTYPE foePromisedAttack ) {
\r
42 switch (foePromisedAttack) {
\r
56 /* You need to define a results function, even if it isn't used
\r
57 (otherwise the linker will complain) */
\r
58 void Results( void * this, char * foeName, int isInstigatedByYou, RESULTTYPE winner,
\r
59 ITEMTYPE attItem, ITEMTYPE defItem, ITEMTYPE bluffItem,
\r
62 return; /* Ignore whatever just happened. */
\r
65 /* same for Cleanup() */
\r
67 void Cleanup( void * this ) {
\r