diff options
author | Nathan Vance <nathav63@gmail.com> | 2015-02-28 23:21:31 -0500 |
---|---|---|
committer | Nathan Vance <nathav63@gmail.com> | 2015-02-28 23:21:31 -0500 |
commit | f0bbfee11a0418064a142101a952c3043dde7351 (patch) | |
tree | d5105137ea14d3574b2b16c96d8c320870e18dd9 /science.c | |
parent | Correctly toggles (diff) | |
download | 7w-f0bbfee11a0418064a142101a952c3043dde7351.tar.gz 7w-f0bbfee11a0418064a142101a952c3043dde7351.tar.bz2 7w-f0bbfee11a0418064a142101a952c3043dde7351.zip |
Started work on ai
Diffstat (limited to 'science.c')
-rw-r--r-- | science.c | 14 |
1 files changed, 11 insertions, 3 deletions
@@ -4,13 +4,13 @@ int* data_getbuilt(int p); int* cards_getproduction(int era, int card); int cards_gettype(int era, int card); int data_hasbuilt(int p, int era, int card); +int* get_intarray(int size); -int calc_science(int player, int guildval) +int* get_science(int player) { - int science[3]; + int *science = get_intarray(3); int i, j; for(i = 0; i < 3; i++) science[i] = 0; - if(guildval != -1) science[guildval]++; int *built = data_getbuilt(player); int *prod; for(i = 0; built[i] != -1; i += 2) { @@ -21,6 +21,14 @@ int calc_science(int player, int guildval) } } } + return science; +} + +int calc_science(int player, int guildval) +{ + int i; + int *science = get_science(player); + if(guildval != -1) science[guildval]++; int min = science[0]; for(i = 0; i < 3; i++) if(science[i] < min) min = science[i]; |