From e6fd9858739827671b4b260dd533f89f860a9fa7 Mon Sep 17 00:00:00 2001 From: simonb Date: Sat, 21 Aug 1999 10:40:03 +0000 Subject: Convert to something resembling KNF. --- monop/prop.c | 63 ++++++++++++++++++++++++++++++------------------------------ 1 file changed, 32 insertions(+), 31 deletions(-) (limited to 'monop/prop.c') diff --git a/monop/prop.c b/monop/prop.c index cf853189..aec1f76a 100644 --- a/monop/prop.c +++ b/monop/prop.c @@ -1,4 +1,4 @@ -/* $NetBSD: prop.c,v 1.4 1997/10/12 17:45:23 christos Exp $ */ +/* $NetBSD: prop.c,v 1.5 1999/08/21 10:40:04 simonb Exp $ */ /* * Copyright (c) 1980, 1993 @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)prop.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: prop.c,v 1.4 1997/10/12 17:45:23 christos Exp $"); +__RCSID("$NetBSD: prop.c,v 1.5 1999/08/21 10:40:04 simonb Exp $"); #endif #endif /* not lint */ @@ -53,27 +53,26 @@ static int value __P((SQUARE *)); */ void buy(player, sqrp) -int player; -SQUARE *sqrp; + int player; + SQUARE *sqrp; { - trading = FALSE; sqrp->owner = player; add_list(player, &(play[player].own_list), cur_p->loc); } + /* * This routine adds an item to the list. */ void add_list(plr, head, op_sqr) -int plr; -OWN **head; -int op_sqr; + int plr; + OWN **head; + int op_sqr; { - - int val; - OWN *tp, *last_tp; - OWN *op; + int val; + OWN *tp, *last_tp; + OWN *op; op = (OWN *)calloc(1, sizeof (OWN)); op->sqr = &board[op_sqr]; @@ -94,17 +93,17 @@ int op_sqr; if (!trading) set_ownlist(plr); } + /* * This routine deletes property from the list. */ void del_list(plr, head, op_sqr) -int plr; -OWN **head; -short op_sqr; + int plr; + OWN **head; + short op_sqr; { - - OWN *op, *last_op; + OWN *op, *last_op; switch (board[op_sqr].type) { case PRPTY: @@ -130,16 +129,16 @@ short op_sqr; free(op); } } + /* * This routine calculates the value for sorting of the * given square. */ static int value(sqp) -SQUARE *sqp; + SQUARE *sqp; { - - int sqr; + int sqr; sqr = sqnum(sqp); switch (sqp->type) { @@ -158,6 +157,7 @@ SQUARE *sqp; return 8 + (sqp->desc) - prop; } } + /* * This routine accepts bids for the current peice * of property. @@ -165,11 +165,10 @@ SQUARE *sqp; void bid() { - - static bool in[MAX_PL]; - int i, num_in, cur_max; - char buf[80]; - int cur_bid; + static bool in[MAX_PL]; + int i, num_in, cur_max; + char buf[80]; + int cur_bid; printf("\nSo it goes up for auction. Type your bid after your name\n"); for (i = 0; i < num_play; i++) @@ -189,7 +188,8 @@ bid() break; } else if (cur_bid <= cur_max) { - printf("You must bid higher than %d to stay in\n", cur_max); + printf("You must bid higher than %d " + "to stay in\n", cur_max); printf("(bid of 0 drops you out)\n"); } } while (cur_bid != 0 && cur_bid <= cur_max); @@ -204,19 +204,20 @@ bid() play[i].money -= cur_max; } else - printf("Nobody seems to want it, so we'll leave it for later\n"); + printf("Nobody seems to want it, so we'll leave it for " + "later\n"); } + /* * This routine calculates the value of the property * of given player. */ int prop_worth(plp) -PLAY *plp; + PLAY *plp; { - - OWN *op; - int worth; + OWN *op; + int worth; worth = 0; for (op = plp->own_list; op; op = op->next) { -- cgit v1.2.3-56-ge451