From c076d1849d9ec07b87cde212d8db12dc890dc811 Mon Sep 17 00:00:00 2001 From: Mario Kilies Date: Tue, 4 Jan 2011 20:13:39 +0100 Subject: Splitted up content from common.* to separate files (card.[ch], cardstack.[ch] and hand.h) --- src/common.c | 25 ------------------------- 1 file changed, 25 deletions(-) delete mode 100644 src/common.c (limited to 'src/common.c') diff --git a/src/common.c b/src/common.c deleted file mode 100644 index 89841c4..0000000 --- a/src/common.c +++ /dev/null @@ -1,25 +0,0 @@ -#include "common.h" -#include - -uint32_t cardpoints(const card c) -{ - assert(c > 0 && c <= 105); - if (55 == c) return 7; // Card 55 is worth of 7 points - if (c % 11 == 0) return 5; // Cards that are multiples of 11 are worth 5 points - if (c % 10 == 0) return 3; // ... 10 are worth 3 points - if (c % 5 == 0) return 2; // ... 5 are worth 2 points - return 1; // All other cards are worth 1 point -} - -uint32_t stackpoints(const cardstack s) -{ - uint32_t points = 0; - - for(uint32_t i = 0; i < MAX_CARDSTACK_SIZE; i++) - { - if(s[i] > 0) - points += cardpoints(s[i]); - } - - return points; -} -- cgit v1.2.3