diff options
author | Ian C <ianc@noddybox.co.uk> | 2019-03-28 08:53:30 +0000 |
---|---|---|
committer | Ian C <ianc@noddybox.co.uk> | 2019-03-28 08:53:30 +0000 |
commit | 9b1b68aa50bdaf2ef85d494731254a8318bcb780 (patch) | |
tree | fbf41a917bdcd8706f26bd92bf4a8db4e1a924dc | |
parent | e3458fb60ce025598b500645842b82004d15ac29 (diff) |
Fixed bug where the draw pile was being inverted when reset.
-rw-r--r-- | klondike.c | 2 | ||||
-rw-r--r-- | pile.c | 8 | ||||
-rw-r--r-- | pile.h | 1 |
3 files changed, 10 insertions, 1 deletions
@@ -279,7 +279,7 @@ int Klondike(int draw, int thoughtful) } else { - SwapPile(&pile, &turned); + MovePile(&turned, &pile); } break; @@ -132,6 +132,14 @@ void SwapPile(Pile *a, Pile *b) *b = t; } +void MovePile(Pile *from, Pile *to) +{ + while(from->no) + { + MoveTopCard(from, to); + } +} + void FreePile(Pile *p) { if (p->card) @@ -41,6 +41,7 @@ Card PopPile(Pile *pile); Card TopOfPile(Pile *pile); void MoveTopCard(Pile *from, Pile *to); void SwapPile(Pile *a, Pile *b); +void MovePile(Pile *from, Pile *to); void FreePile(Pile *p); #endif |