X-Git-Url: https://git.ucc.asn.au/?p=progcomp10.git;a=blobdiff_plain;f=link%2FC%2FLink%2Fc-link-lib%2Fsample-agents%2Fc-streetfighter.c;fp=link%2FC%2FLink%2Fc-link-lib%2Fsample-agents%2Fc-streetfighter.c;h=0000000000000000000000000000000000000000;hp=2841f43ccfa7c526742290ad5f5ea330aa73e50e;hb=1740df9314f3dc49c6d44378c5915674aa1ab75f;hpb=fac40599d3ae604872ce34f3546a6c634183148f diff --git a/link/C/Link/c-link-lib/sample-agents/c-streetfighter.c b/link/C/Link/c-link-lib/sample-agents/c-streetfighter.c deleted file mode 100644 index 2841f43..0000000 --- a/link/C/Link/c-link-lib/sample-agents/c-streetfighter.c +++ /dev/null @@ -1,59 +0,0 @@ -/* - * c-streetfighter.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 streetfighter bot, which thinks everyone has it in for him. */ - -ATTACKTYPE Attack( char * foe_name ) { - ATTACKTYPE attack; - - attack.realAttack = RandomAttack(); - - /* Here we choose the thing that will hurt them if they go for a tie */ - switch (attack.realAttack) { - case rock: - result.promisedAttack = paper; - break; - case paper: - result.promisedAttack = rock; - break; - default: /* attack = scissors */ - result.promisedAttack = paper; - break; - } - attack.promisedAttack = result.realAttack; /* Tells the truth for its bluff */ - - return attack; -} - -/* Here we trust that they are telling the truth. And we try to kill them. */ -ITEMTYPE Defend( char * foeName, ITEMTYPE foePromisedAttack ) { - ITEMTYPE defence; - switch (foePromisedAttack) { - case rock: - defence = paper; - break; - case paper: - defence = scissors; - break; - default: - defence = rock; - break; - } -} - -/* 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. */ -}