aboutsummaryrefslogtreecommitdiff
path: root/ai.c
diff options
context:
space:
mode:
authorNathan Vance <nathav63@gmail.com>2015-02-28 23:21:31 -0500
committerNathan Vance <nathav63@gmail.com>2015-02-28 23:21:31 -0500
commitf0bbfee11a0418064a142101a952c3043dde7351 (patch)
treed5105137ea14d3574b2b16c96d8c320870e18dd9 /ai.c
parentCorrectly toggles (diff)
download7w-f0bbfee11a0418064a142101a952c3043dde7351.tar.gz
7w-f0bbfee11a0418064a142101a952c3043dde7351.tar.bz2
7w-f0bbfee11a0418064a142101a952c3043dde7351.zip
Started work on ai
Diffstat (limited to 'ai.c')
-rw-r--r--ai.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/ai.c b/ai.c
new file mode 100644
index 0000000..74e79f5
--- /dev/null
+++ b/ai.c
@@ -0,0 +1,25 @@
+#include "7w.h"
+
+int data_canafford(int p, int *cost);
+int* data_gethand(int p);
+int data_numcards(int p);
+int data_getera();
+int weight_buildcard(int era, int card, int player);
+int weight_buildwonder(int player);
+int* cards_getproduction(int era, int card);
+
+void ai_turn(int player)
+{
+ int i, temp;
+ int *hand = data_gethand(player);
+ int numcards = data_numpcards(player);
+ int max = 0;
+ int card = 0;
+ for(i = 0; i < numcards; i++) {
+ temp = weight_buildcard(data_getera(), hand[i], player);
+ if(temp > max ) {
+ max = temp;
+ card = hand[i];
+ }
+ }
+}
bgstack15