aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan Vance <nathav63@gmail.com>2015-02-16 14:55:31 -0500
committerNathan Vance <nathav63@gmail.com>2015-02-16 14:55:31 -0500
commit7761b42b8706545e09b765df8b4f1080d7d34e8c (patch)
tree62b2aab4289989679ac64655b349a8d38833b625
parentAdded descriptions for special cards (diff)
download7w-7761b42b8706545e09b765df8b4f1080d7d34e8c.tar.gz
7w-7761b42b8706545e09b765df8b4f1080d7d34e8c.tar.bz2
7w-7761b42b8706545e09b765df8b4f1080d7d34e8c.zip
Added deck data
-rw-r--r--decks.c38
1 files changed, 38 insertions, 0 deletions
diff --git a/decks.c b/decks.c
new file mode 100644
index 0000000..0a1f2c2
--- /dev/null
+++ b/decks.c
@@ -0,0 +1,38 @@
+#include "7w.h"
+#include <time.h>
+
+int* get_intarray(int size);
+
+static int era1[] = {0, 1, 2, 3, 6, 7, 10, 11, 12, 14, 15, 16, 18, 19, 20, 21, 22, 23, 24, 25, 26,
+ 0, 3, 5, 13, 17, 23, 26,
+ 1, 2, 8, 15, 17, 22, 24,
+ 4, 9, 10, 11, 12, 16, 20,
+ 13, 14, 17, 18, 19, 21, 25};
+static int era2[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 15, 17, 18, 19, 20, 21, 22,
+ 0, 1, 2, 3, 14, 16, 19,
+ 4, 5, 6, 10, 12, 17, 20,
+ 8, 11, 12, 13, 16, 18, 21,
+ 7, 9, 11, 14, 15, 16, 22};
+static int era3[] = {0, 1, 2, 3, 4, 5, 6, 8, 9, 11, 12, 13, 14, 15, 16, 17,
+ 1, 5, 7, 10, 11, 15,
+ 2, 4, 8, 10, 12, 17,
+ 0, 2, 6, 7, 10, 13,
+ 3, 8, 9, 11, 14, 16};
+
+void shuffle(int *deck, int n)
+{
+ int scratch[n];
+ int i = 0;
+ int size = n;
+ srand(time(NULL));
+ while(n) {
+ scratch[i++] = deck[rand()%n];
+ n--;
+ }
+ for(i = 0; i < size; i++) deck[i] = scratch[i];
+}
+
+int* getdeck(int era, int numplayers)
+{
+ int *ret = get_intarray(numplayers*7);
+}
bgstack15