X-Git-Url: https://git.cameronkatri.com/bsdgames-darwin.git/blobdiff_plain/77e3814f0c0e3dea4d0032e25666f77e6f83bfff..9e7fd816e02e66962d482b02209f112e1d5789fc:/monop/print.c diff --git a/monop/print.c b/monop/print.c index 6c91a5ec..2b0cc42d 100644 --- a/monop/print.c +++ b/monop/print.c @@ -1,6 +1,8 @@ +/* $NetBSD: print.c,v 1.12 2008/02/24 03:56:49 christos Exp $ */ + /* - * Copyright (c) 1980 Regents of the University of California. - * All rights reserved. + * Copyright (c) 1980, 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 @@ -10,11 +12,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * @@ -31,21 +29,28 @@ * SUCH DAMAGE. */ +#include #ifndef lint -static char sccsid[] = "@(#)print.c 5.4 (Berkeley) 6/1/90"; +#if 0 +static char sccsid[] = "@(#)print.c 8.1 (Berkeley) 5/31/93"; +#else +__RCSID("$NetBSD: print.c,v 1.12 2008/02/24 03:56:49 christos Exp $"); +#endif #endif /* not lint */ -# include "monop.ext" +#include "monop.h" + +static const char *header = "Name Own Price Mg # Rent"; -static char buf[80], /* output buffer */ - *header = "Name Own Price Mg # Rent"; +static void printmorg(const SQUARE *); /* * This routine prints out the current board */ -printboard() { - - reg int i; +void +printboard() +{ + int i; printf("%s\t%s\n", header, header); for (i = 0; i < N_SQRS/2; i++) { @@ -54,13 +59,14 @@ printboard() { printsq(i+N_SQRS/2, TRUE); } } + /* * This routine lists where each player is. */ -where() { - - reg int i; - char *bsp; +void +where() +{ + int i; printf("%s Player\n", header); for (i = 0; i < num_play; i++) { @@ -71,17 +77,16 @@ where() { putchar('\n'); } } + /* * This routine prints out an individual square */ -printsq(sqn, eoln) -int sqn; -reg bool eoln; { - - reg int rnt; - reg PROP *pp; - reg SQUARE *sqp; - int i; +void +printsq(int sqn, bool eoln) +{ + int rnt; + PROP *pp; + SQUARE *sqp; sqp = &board[sqn]; printf("%-10.10s", sqp->name); @@ -93,7 +98,6 @@ reg bool eoln; { case GOTO_J: case LUX_TAX: case IN_JAIL: -spec: if (!eoln) printf(" "); break; @@ -117,8 +121,7 @@ spec: printf("0 %4d", pp->rent[0] * 2); else printf("H %4d", pp->rent[5]); - } - else + } else printf(" %4d", pp->rent[0]); break; case UTIL: @@ -145,36 +148,40 @@ spec: printmorg(sqp); rnt = 25; rnt <<= play[sqp->owner].num_rr - 1; - printf("%d %4d", play[sqp->owner].num_rr, 25 << (play[sqp->owner].num_rr - 1)); + printf("%d %4d", play[sqp->owner].num_rr, + 25 << (play[sqp->owner].num_rr - 1)); break; } if (eoln) putchar('\n'); } + /* * This routine prints out the mortgage flag. */ +static void printmorg(sqp) -reg SQUARE *sqp; { - + const SQUARE *sqp; +{ if (sqp->desc->morg) printf(" * "); else printf(" "); } + /* * This routine lists the holdings of the player given */ +void printhold(pl) -reg int pl; { - - reg OWN *op; - reg PLAY *pp; - char *bsp; + int pl; +{ + OWN *op; + PLAY *pp; pp = &play[pl]; - printf("%s's (%d) holdings (Total worth: $%d):\n", name_list[pl], pl+1, - pp->money + prop_worth(pp)); + printf("%s's (%d) holdings (Total worth: $%d):\n", name_list[pl], + pl + 1, pp->money + prop_worth(pp)); printf("\t$%d", pp->money); if (pp->num_gojf) { printf(", %d get-out-of-jail-free card", pp->num_gojf);