5 * Created by Daniel Axtens on 20/04/10.
6 * Licensed under an MIT-style license: see the LICENSE file for details.
13 /* Implement the streetfighter bot, which thinks everyone has it in for him. */
15 ATTACKTYPE Attack( char * foe_name ) {
18 attack.realAttack = RandomAttack();
20 /* Here we choose the thing that will hurt them if they go for a tie */
21 switch (attack.realAttack) {
23 result.promisedAttack = paper;
26 result.promisedAttack = rock;
28 default: /* attack = scissors */
29 result.promisedAttack = paper;
32 attack.promisedAttack = result.realAttack; /* Tells the truth for its bluff */
37 /* Here we trust that they are telling the truth. And we try to kill them. */
38 ITEMTYPE Defend( char * foeName, ITEMTYPE foePromisedAttack ) {
40 switch (foePromisedAttack) {
53 /* You need to define a results function, even if it isn't used
54 (otherwise the linker will complain) */
55 void Results( char * foeName, int isInstigatedByYou, ITEMTYPE yourItem,
56 ITEMTYPE theirItem, ITEMTYPE promisedItem) {
58 return; /* Ignore whatever just happened. */