From f9b0bb07c97392e0086a7a7fce52e255d4d2df5d Mon Sep 17 00:00:00 2001 From: Ian C Date: Fri, 21 Dec 2018 13:17:12 +0000 Subject: Added thoughtful mode. --- klondike.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'klondike.c') diff --git a/klondike.c b/klondike.c index 0a5b760..aac2c33 100644 --- a/klondike.c +++ b/klondike.c @@ -141,7 +141,8 @@ static void KlondikeHelp(void) "Press '1', '2', '3' or '4' to move the top card from the hearts, ", "diamonds, spades or clubs suit pile respectively back onto the board.", "", - "Press 'Q' to quit. You'll be asked if you want to see the cards.", + "Press 'Q' to quit. You'll be asked if you want to see the cards", + "if not playing a thoughtful game.", "", "", "Press SPACE to continue.", @@ -163,7 +164,7 @@ static void KlondikeHelp(void) while(getch() != ' '); } -void Klondike(int draw) +void Klondike(int draw, int thoughtful) { Deck deck; Pile pile = {0}; @@ -224,7 +225,7 @@ void Klondike(int draw) { for(n = 0; n < column_down[f].no; n++) { - DrawCard(2 + n, 1 + f * 5, TRUE, column_down[f].card[n]); + DrawCard(2 + n, 1 + f * 5, !thoughtful, column_down[f].card[n]); } for(n = 0; n < column_up[f].no; n++) @@ -328,10 +329,14 @@ void Klondike(int draw) int k; quit = TRUE; - Centre(LINES-1, "Show cards?"); - refresh(); - k = getch(); - show = (k == 'y' || k == 'Y'); + + if (!thoughtful) + { + Centre(LINES-1, "Show cards?"); + refresh(); + k = getch(); + show = (k == 'y' || k == 'Y'); + } break; } -- cgit v1.2.3