applied TPG's patch, fixed wash
[progcomp10.git] / src / link / C / agents / c_lucifer.c
old mode 100644 (file)
new mode 100755 (executable)
index f497366..8325840
@@ -1,67 +1,71 @@
-/*
- *  c_lucifer.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 lucifer bot, which always lies expecting people to be good
-   and always goes for the kill */
-
-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:
-                       attack.promisedAttack = scissors;
-                       break;
-               case paper:
-                       attack.promisedAttack = rock;
-                       break;
-               default: /* attack = scissors */
-                       attack.promisedAttack = paper;
-                       break;
-       }
-       
-       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;
-       }
-    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;
-}
\ No newline at end of file
+/*\r
+ *  c_lucifer.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 lucifer bot, which always lies expecting people to be good\r
+   and always goes for the kill */\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 a tie */\r
+       switch (attack.realAttack) {\r
+               case rock:\r
+                       attack.promisedAttack = scissors;\r
+                       break;\r
+               case paper:\r
+                       attack.promisedAttack = rock;\r
+                       break;\r
+               default: /* attack = scissors */\r
+                       attack.promisedAttack = paper;\r
+                       break;\r
+       }\r
+       \r
+       return attack;\r
+}\r
+\r
+/* Here we trust that they are telling the truth. 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 = paper;\r
+                       break;\r
+               case paper:\r
+                       defence = scissors;\r
+                       break;\r
+               default:\r
+                       defence = rock;\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

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