summaryrefslogtreecommitdiff
path: root/src/card.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/card.c')
-rw-r--r--src/card.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/card.c b/src/card.c
index 25db247..5132be6 100644
--- a/src/card.c
+++ b/src/card.c
@@ -1,6 +1,14 @@
#include "card.h"
#include <assert.h>
+/**
+ * Calculate the score of a single card
+ * Cards divisible by 5: 2 points
+ * Cards divisible by 10: 3 points
+ * Cards divisible by 11: 5 points
+ * Card 55 (divisible by 5 and 11): 7 points
+ * @return Score of the card
+ */
uint32_t card_get_points(const card c)
{
assert(c > 0 && c <= 105);