]> thyrsus.com Git - deal.git/commitdiff
More user-interface tuning.
authorEric S. Raymond <esr@thyrsus.com>
Thu, 13 Apr 1995 18:33:23 +0000 (18:33 +0000)
committerEric S. Raymond <esr@thyrsus.com>
Thu, 13 Apr 1995 18:33:23 +0000 (18:33 +0000)
deal.c

diff --git a/deal.c b/deal.c
index 4210abb511be763dd75964a2f4c0d325af69a70f..f926411a0d179751da5ff4780d103ada2cc09d01 100644 (file)
--- a/deal.c
+++ b/deal.c
@@ -34,6 +34,7 @@
 #include <signal.h>
 
 #define BASEHAND       7       /* # cards in initial deal */
+#define TURNS_DEFAULT  20      /* show this many turns if total is greater */
 
 static int sx, sk, sM, sN;
 
@@ -53,13 +54,12 @@ main(argc, argv)
     int turns, special, total, columns, i, j;
     double hyper_prob();
 
-    if  (argc == 1) {
+    if  (argc < 3) {
         (void) printf("usage: cardprobs M N [t] [c]\n");
         (void) printf("     M = # special cards\n");
         (void) printf("     N = # total cards\n");
         (void) printf("     t = # of turns (optional)\n");
-        (void) printf("     c = columns in the report (optional).\n");
-        (void) printf("No arguments are optional.\n");
+        (void) printf("     c = columns in the report (optional)\n");
     } else {
         special = atoi(argv[1]);
         total = atoi(argv[2]);
@@ -68,7 +68,12 @@ main(argc, argv)
             exit(-1);
         }
 
-       turns = 20;     /* fill a standard screen */
+
+       if (total - BASEHAND < TURNS_DEFAULT)
+           turns = total - BASEHAND;
+       else
+           turns = TURNS_DEFAULT;
+
        if (argc >= 4)
            turns = atoi(argv[3]);
        if (turns > total - BASEHAND) {