summaryrefslogtreecommitdiff
path: root/src/table_stacks.c
diff options
context:
space:
mode:
authorReiner Herrmann <reiner@reiner-h.de>2011-01-25 17:57:52 +0100
committerReiner Herrmann <reiner@reiner-h.de>2011-01-25 17:57:52 +0100
commit9cdef35633f8ac896b4e5ba4fb0b3bd81824f42c (patch)
treebba8e552ae2765dd0eef1a3a0861914cf613c9be /src/table_stacks.c
parent25ac261e17fa4ceebf0c42bb2d614073252e7e8f (diff)
added some debug output
Diffstat (limited to 'src/table_stacks.c')
-rw-r--r--src/table_stacks.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/table_stacks.c b/src/table_stacks.c
index 7f76edd..147ed7e 100644
--- a/src/table_stacks.c
+++ b/src/table_stacks.c
@@ -1,5 +1,6 @@
#include <stdlib.h>
#include <assert.h>
+#include <stdio.h>
#include "table_stacks.h"
#include "card_stack.h"
#include "card.h"
@@ -10,13 +11,20 @@ const uint8_t get_stack_idx_for_card(const table_stacks_t* stack_list, const car
assert(stack_list != NULL);
uint8_t idx = NUM_TABLE_STACKS;
- uint8_t old_diff = MAX_CARD;
+ int16_t old_diff = MAX_CARD;
+ fprintf(stderr, "selected card: %d\n", c);
for(int i=0; i<NUM_TABLE_STACKS; i++)
{
card stackcard = card_stack_top(&stack_list->stacks[i]);
- uint8_t new_diff = c - stackcard;
- assert(new_diff != 0);
+ int16_t new_diff = c - stackcard;
+ fprintf(stderr, "card on top of stack %d: %d\n", i, stackcard);
+ if(new_diff == 0)
+ {
+ fprintf(stderr, "assertion failed: new_diff != 0\n");
+ exit(EXIT_FAILURE);
+ }
+ //assert(new_diff != 0);
if(new_diff < 0) // open card smaller than card on current stack
continue;