aboutsummaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorNathan Vance <nathav63@gmail.com>2015-02-17 10:35:41 -0500
committerNathan Vance <nathav63@gmail.com>2015-02-17 10:35:41 -0500
commitae59eea6c0b8fe2a71896120f196fc200bec56fb (patch)
tree0ee57425862b1849b75c95665c0b9cf1c241c7c6 /main.c
parentAdded deck data (diff)
download7w-ae59eea6c0b8fe2a71896120f196fc200bec56fb.tar.gz
7w-ae59eea6c0b8fe2a71896120f196fc200bec56fb.tar.bz2
7w-ae59eea6c0b8fe2a71896120f196fc200bec56fb.zip
Now separates out cards for a deck and shuffles!
Diffstat (limited to 'main.c')
-rw-r--r--main.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/main.c b/main.c
index 54c464e..1215890 100644
--- a/main.c
+++ b/main.c
@@ -6,6 +6,7 @@ void cards_init();
void io_printcard(int x, int y, int era, int card);
void cardtour();
void io_clearscreen();
+int* getdeck(int era, int numplayers);
void halt()
{
@@ -31,11 +32,17 @@ void cardtour()
{
int era, card;
era = card = 0;
+ int deckpos = 0;
+ int numplayers = 4;
+ int *decks[3];
+ decks[0] = getdeck(0, numplayers);
+ decks[1] = getdeck(1, numplayers);
+ decks[2] = getdeck(2, numplayers);
while(1) {
io_clearscreen();
- io_printcard(0, 0, era, card);
+ io_printcard(0, 0, era, decks[era][card]);
switch(io_getkey()) {
- case DOWN: if(card < CARDSPERERA-1) card++;
+ case DOWN: if(card < numplayers*7) card++;
break;
case UP: if(card > 0) card--;
break;
bgstack15