-/*
- * 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 <c_link.h>
-
-/* 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 the kill */
- switch (attack.realAttack) {
- case rock:
- attack.promisedAttack = paper;
- break;
- case paper:
- attack.promisedAttack = scissors;
- break;
- default: /* attack = scissors */
- attack.promisedAttack = rock;
- break;
- }
- return attack;
-}
-
-/* Here we assume they are lying, trying to kill us. And we try to kill them. */
-ITEMTYPE Defend( char * foeName, ITEMTYPE foePromisedAttack ) {
- ITEMTYPE defence;
- switch (foePromisedAttack) {
- case rock:
- defence = scissors;
- break;
- case paper:
- defence = rock;
- break;
- default:
- defence = paper;
- break;
- }
- return defence;
-}
-
-/* You need to define a results function, even if it isn't used
- (otherwise the linker will complain) */
-void Results( char * foeName, int isInstigatedByYou, RESULTTYPE winner,
- ITEMTYPE attItem, ITEMTYPE defItem, ITEMTYPE bluffItem,
- int pointDelta ) {
-
- return; /* Ignore whatever just happened. */
-}
-
-/* same for Cleanup() */
-
-void Cleanup() {
- return;
-}
+/*\r
+ * c_streetfighter.c\r
+ * c-link-lib\r
+ *\r
+ * Created by Daniel Axtens on 20/04/10.\r
+ * Licensed under an MIT-style license: see the LICENSE file for details.\r
+ *\r
+ */\r
+\r
+\r
+#include <c_link.h>\r
+\r
+/* Implement the streetfighter bot, which thinks everyone has it in for him. */\r
+\r
+void * Initialise( char * myName ) {\r
+ return NULL;\r
+}\r
+\r
+ATTACKTYPE Attack( void * this, char * foe_name ) {\r
+ ATTACKTYPE attack;\r
+ \r
+ attack.realAttack = RandomAttack();\r
+ \r
+ /* Here we choose the thing that will hurt them if they go for the kill */\r
+ switch (attack.realAttack) {\r
+ case rock:\r
+ attack.promisedAttack = paper;\r
+ break;\r
+ case paper:\r
+ attack.promisedAttack = scissors;\r
+ break;\r
+ default: /* attack = scissors */\r
+ attack.promisedAttack = rock;\r
+ break;\r
+ }\r
+ return attack;\r
+}\r
+\r
+/* Here we assume they are lying, trying to kill us. And we try to kill them. */\r
+ITEMTYPE Defend( void * this, char * foeName, ITEMTYPE foePromisedAttack ) {\r
+ ITEMTYPE defence;\r
+ switch (foePromisedAttack) {\r
+ case rock:\r
+ defence = scissors;\r
+ break;\r
+ case paper:\r
+ defence = rock;\r
+ break;\r
+ default:\r
+ defence = paper;\r
+ break;\r
+ }\r
+ return defence;\r
+}\r
+\r
+/* You need to define a results function, even if it isn't used\r
+ (otherwise the linker will complain) */\r
+void Results( void * this, char * foeName, int isInstigatedByYou, RESULTTYPE winner,\r
+ ITEMTYPE attItem, ITEMTYPE defItem, ITEMTYPE bluffItem,\r
+ int pointDelta ) {\r
+ \r
+ return; /* Ignore whatever just happened. */\r
+}\r
+\r
+/* same for Cleanup() */\r
+\r
+void Cleanup( void * this ) {\r
+ return;\r
+}\r