summary refs log tree commit diff
path: root/sol.c
diff options
context:
space:
mode:
Diffstat (limited to 'sol.c')
-rw-r--r--sol.c27
1 files changed, 3 insertions, 24 deletions
diff --git a/sol.c b/sol.c
index 0a0740c..bb73b84 100644
--- a/sol.c
+++ b/sol.c
@@ -25,27 +25,6 @@
 
 typedef unsigned uint;
 
-static Sint8 cardSuit(Sint8 card) {
-	card = abs(card);
-	if (card > Cards_Spade) {
-		return Cards_Spade;
-	} else if (card > Cards_Heart) {
-		return Cards_Heart;
-	} else if (card > Cards_Diamond) {
-		return Cards_Diamond;
-	} else {
-		return Cards_Club;
-	}
-}
-
-static Sint8 cardColor(Sint8 card) {
-	return cardSuit(card) == Cards_Diamond || cardSuit(card) == Cards_Heart;
-}
-
-static Sint8 cardRank(Sint8 card) {
-	return abs(card) - cardSuit(card);
-}
-
 enum {
 	Stock,
 	Waste1,
@@ -88,10 +67,10 @@ static void gameDeal(void) {
 static void gameDraw(void) {
 	stackMoveTo(&stacks[Waste1], &stacks[Waste3], stacks[Waste3].len);
 	if (stacks[Stock].len) {
-		if (game.draw == 1) {
-			stackFlipTo(&stacks[Waste1], &stacks[Stock], 1);
+		if (game.draw > 1) {
+			stackFlipTo(&stacks[Waste3], &stacks[Stock], game.draw);
 		} else {
-			stackFlipTo(&stacks[Waste3], &stacks[Stock], 3);
+			stackFlipTo(&stacks[Waste1], &stacks[Stock], 1);
 		}
 	} else {
 		stackFlipTo(&stacks[Stock], &stacks[Waste1], stacks[Waste1].len);