From 9cdef35633f8ac896b4e5ba4fb0b3bd81824f42c Mon Sep 17 00:00:00 2001 From: Reiner Herrmann Date: Tue, 25 Jan 2011 17:57:52 +0100 Subject: added some debug output --- src/table_stacks.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'src/table_stacks.c') 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 #include +#include #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; istacks[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; -- cgit v1.2.3