aboutsummaryrefslogtreecommitdiff
path: root/main.c
blob: 1b07017f36ce25cc481ede69aec6581c4912c4e8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#include "7w.h"
#include <stdlib.h>

void io_init();
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 data_init(int num_players);
void player_turn(int player);

void halt()
{
 endwin();
 exit(0);
}

main()
{
 io_init();
 cards_init();
 data_init(4);
// cardtour();
 player_turn(1);
 halt();
}

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, decks[era][card]);
  switch(io_getkey()) {
   case DOWN: if(card < numplayers*7) card++;
    break;
   case UP: if(card > 0) card--;
    break;
   case LEFT: if(era > 0) era--;
    break;
   case RIGHT: if(era < 2) era++;
    break;
   case 'q': halt();
    break;
   default: break;
  }
 }
}
bgstack15