summaryrefslogtreecommitdiffstats
path: root/monop/prop.c
diff options
context:
space:
mode:
authorsimonb <simonb@NetBSD.org>1999-08-21 10:40:03 +0000
committersimonb <simonb@NetBSD.org>1999-08-21 10:40:03 +0000
commite6fd9858739827671b4b260dd533f89f860a9fa7 (patch)
tree972e93ee56db748e5c589b841304a69ecc01bc25 /monop/prop.c
parentca104a29f1236b5c4ee454e8c132ed8518df7a27 (diff)
downloadbsdgames-darwin-e6fd9858739827671b4b260dd533f89f860a9fa7.tar.gz
bsdgames-darwin-e6fd9858739827671b4b260dd533f89f860a9fa7.tar.zst
bsdgames-darwin-e6fd9858739827671b4b260dd533f89f860a9fa7.zip
Convert to something resembling KNF.
Diffstat (limited to 'monop/prop.c')
-rw-r--r--monop/prop.c63
1 files changed, 32 insertions, 31 deletions
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) {