From 77d344c1ab4e274ba099d66b8bf5eb9db7e5e45f Mon Sep 17 00:00:00 2001 From: Curtis McEnroe Date: Tue, 26 Mar 2019 18:15:31 -0400 Subject: Remove stackDeck Other games will probably want to do it differently. --- sol.c | 4 +++- stack.h | 7 ------- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/sol.c b/sol.c index b4a323f..4da4933 100644 --- a/sol.c +++ b/sol.c @@ -82,7 +82,9 @@ static void gameDeal(void) { for (uint i = 0; i < StacksLen; ++i) { stackClear(&stacks[i]); } - stackDeck(&stacks[Stock]); + for (Card i = 1; i <= 52; ++i) { + stackPush(&stacks[Stock], -i); + } stackShuffle(&stacks[Stock]); for (uint i = Tableau1; i <= Tableau7; ++i) { stackMoveTo(&stacks[i], &stacks[Stock], i - Tableau1); diff --git a/stack.h b/stack.h index d3a4119..b7b018f 100644 --- a/stack.h +++ b/stack.h @@ -85,13 +85,6 @@ static inline void stackMoveTo(struct Stack *dst, struct Stack *src, Uint8 n) { src->len -= n; } -static inline void stackDeck(struct Stack *stack) { - stackClear(stack); - for (Card i = 1; i <= 52; ++i) { - stackPush(stack, -i); - } -} - static inline int randUniform(int bound) { for (;;) { int r = rand(); -- cgit 1.4.1