nmak

makao card game
git clone git://git.kocotian.pl/nmak.git
Log | Files | Refs | README | LICENSE

commit 0ef33bcd43873e71eedeb81ad2eb5baebf6d76ec
parent d60fe67f33853fc0887eb43d514b71e313abe0d5
Author: kocotian <kocotian@kocotian.pl>
Date:   Thu, 18 Feb 2021 11:13:48 +0100

srand, fixed index number

Diffstat:
Mnmak.c | 5++---
1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/nmak.c b/nmak.c @@ -127,9 +127,8 @@ dumpcards(int8_t *stack) int k, l; if (!(c % 12)) puts(""); for (k = 0, l = 0; k < 52; ++k) { - ++c; if (stack[k + 52 + (52 * (color + 1))] >= 0) - printf("\033[1;33m│\033[1;37m#\033[1;97m%03d\033[1;33m│", c); + printf("\033[1;33m│\033[1;37m#\033[1;97m%03d\033[1;33m│", ++c); if (!(++l % 12)) break; } puts(""); @@ -334,7 +333,7 @@ main(int argc, char *argv[]) chost->sin_port = htons(strtol(argv[1], NULL, 10)); prepare(stacks); - parentpid = getpid(); + srand(parentpid = getpid()); /* fork */ { int sockfd, clientfd, opt; size_t resplen;