From 7761b42b8706545e09b765df8b4f1080d7d34e8c Mon Sep 17 00:00:00 2001 From: Nathan Vance Date: Mon, 16 Feb 2015 14:55:31 -0500 Subject: Added deck data --- decks.c | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 decks.c 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 + +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); +} -- cgit