summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan C <ianc@noddybox.co.uk>2022-01-02 21:14:21 +0000
committerIan C <ianc@noddybox.co.uk>2022-01-02 21:14:21 +0000
commit7740eb37fe1343df20efa00f5646792c24f614a1 (patch)
tree093fd6a22b3620dfdae50a020b02a953bf64df58
parent7c3241630d4a33c419703c523976fc0cc29d7063 (diff)
Added timer to auto complete routine.
-rw-r--r--klondike.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/klondike.c b/klondike.c
index c415517..1aa1d4e 100644
--- a/klondike.c
+++ b/klondike.c
@@ -22,7 +22,9 @@
Klondike
*/
+#include <stdlib.h>
#include <curses.h>
+#include <time.h>
#include "deck.h"
#include "pile.h"
@@ -259,6 +261,10 @@ int Klondike(int draw, int thoughtful)
if (autofill)
{
+ struct timespec spec = {0};
+
+ spec.tv_nsec = 250000000;
+
for(f = 0; f < 7; f++)
{
if (PutCardOnSuitPile(&column_up[f],
@@ -267,6 +273,8 @@ int Klondike(int draw, int thoughtful)
RevealCard(&column_down[pos_x], &column_up[pos_x]);
}
}
+
+ nanosleep(&spec, NULL);
}
if (hearts.no == 13 && diamonds.no == 13 &&