aboutsummaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'main.c')
-rw-r--r--main.c28
1 files changed, 27 insertions, 1 deletions
diff --git a/main.c b/main.c
index 5279407..54c464e 100644
--- a/main.c
+++ b/main.c
@@ -4,6 +4,8 @@
void io_init();
void cards_init();
void io_printcard(int x, int y, int era, int card);
+void cardtour();
+void io_clearscreen();
void halt()
{
@@ -15,11 +17,35 @@ main()
{
io_init();
cards_init();
+ cardtour();
io_printcard(0, 0, 0, 0);
io_printcard(0, 6, 2, 14);
io_printcard(0, 20, 2, 3);
io_printcard(31, 0, 1, 12);
- io_printcard(31, 20, 1, 20);
+ io_printcard(31, 20, 2, 25);
io_getkey();
halt();
}
+
+void cardtour()
+{
+ int era, card;
+ era = card = 0;
+ while(1) {
+ io_clearscreen();
+ io_printcard(0, 0, era, card);
+ switch(io_getkey()) {
+ case DOWN: if(card < CARDSPERERA-1) 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