X-Git-Url: https://git.cameronkatri.com/bsdgames-darwin.git/blobdiff_plain/e926d53eabd7ef836ef12cdf1ee1437379a8f8d8..c8f75ed90de51b0cc71da2c6c9d5fc42192076f8:/mille/init.c diff --git a/mille/init.c b/mille/init.c index 0dc7194d..99d7a55a 100644 --- a/mille/init.c +++ b/mille/init.c @@ -1,6 +1,8 @@ +/* $NetBSD: init.c,v 1.8 1999/09/30 18:01:32 jsm Exp $ */ + /* - * Copyright (c) 1982 Regents of the University of California. - * All rights reserved. + * Copyright (c) 1982, 1993 + * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -31,9 +33,13 @@ * SUCH DAMAGE. */ +#include #ifndef lint -/*static char sccsid[] = "from: @(#)init.c 5.4 (Berkeley) 6/1/90";*/ -static char rcsid[] = "$Id: init.c,v 1.3 1994/01/13 01:19:58 mycroft Exp $"; +#if 0 +static char sccsid[] = "@(#)init.c 8.1 (Berkeley) 5/31/93"; +#else +__RCSID("$NetBSD: init.c,v 1.8 1999/09/30 18:01:32 jsm Exp $"); +#endif #endif /* not lint */ # include "mille.h" @@ -42,13 +48,14 @@ static char rcsid[] = "$Id: init.c,v 1.3 1994/01/13 01:19:58 mycroft Exp $"; * @(#)init.c 1.1 (Berkeley) 4/1/82 */ -init() { - - reg PLAY *pp; - reg int i, j; - reg CARD card; +void +init() +{ + PLAY *pp; + int i, j; + CARD card; - bzero(Numseen, sizeof Numseen); + memset(Numseen, 0, sizeof Numseen); Numgos = 0; for (i = 0; i < 2; i++) { @@ -62,7 +69,7 @@ init() { pp->hand[j] = *--Topcard; if (i == COMP) { account(card = *Topcard); - if (issafety(card)) + if (is_safety(card)) pp->safety[card - S_CONV] = S_IN_HAND; } } @@ -85,16 +92,17 @@ init() { End = 700; } -shuffle() { - - reg int i, r; - reg CARD temp; +void +shuffle() +{ + int i, r; + CARD temp; for (i = 0; i < DECK_SZ; i++) { r = roll(1, DECK_SZ) - 1; if (r < 0 || r > DECK_SZ - 1) { - fprintf(stderr, "shuffle: card no. error: %d\n", r); - die(); + warnx("shuffle: card no. error: %d", r); + die(1); } temp = Deck[r]; Deck[r] = Deck[i]; @@ -103,10 +111,11 @@ shuffle() { Topcard = &Deck[DECK_SZ]; } -newboard() { - - register int i; - register PLAY *pp; +void +newboard() +{ + int i; + PLAY *pp; static int first = TRUE; if (first) { @@ -161,10 +170,11 @@ newboard() { newscore(); } -newscore() { - - reg int i, new; - register PLAY *pp; +void +newscore() +{ + int i, new; + PLAY *pp; static int was_full = -1; static int last_win = -1; @@ -185,8 +195,7 @@ newscore() { mvaddstr(4, 37, "300"); new = TRUE; } - else if (((Window == W_FULL || Finished) ^ was_full) || - pp->was_finished != Finished) { + else if ((Window == W_FULL || Finished) ^ was_full) { move(5, 1); clrtobot(); new = TRUE; @@ -197,7 +206,7 @@ newscore() { for (i = 0; i < SCORE_Y; i++) mvaddch(i, 0, '|'); move(SCORE_Y - 1, 1); - for (i = 0; i < SCORE_X - 1; i++) + for (i = 0; i < SCORE_X; i++) addch('_'); for (pp = Player; pp <= &Player[COMP]; pp++) { pp->sh_hand_tot = -1;