From: Eric S. Raymond Date: Thu, 13 Apr 1995 18:33:23 +0000 (+0000) Subject: More user-interface tuning. X-Git-Tag: 2.0~17 X-Git-Url: http://thyrsus.com/gitweb/?a=commitdiff_plain;h=c1d68cff2b19a86c9a23e57141e71fb88b5cb1c3;p=deal.git More user-interface tuning. --- diff --git a/deal.c b/deal.c index 4210abb..f926411 100644 --- a/deal.c +++ b/deal.c @@ -34,6 +34,7 @@ #include #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) {