]> git.cameronkatri.com Git - bsdgames-darwin.git/blobdiff - monop/rent.c
WARNS=5
[bsdgames-darwin.git] / monop / rent.c
index 0269d170070ccfee4589e3928cbf9296b9b41518..55f131ff10560f509703536d7b064496f7b3ad73 100644 (file)
@@ -1,4 +1,4 @@
-/*     $NetBSD: rent.c,v 1.4 1997/10/12 17:45:24 christos Exp $        */
+/*     $NetBSD: rent.c,v 1.9 2012/06/19 05:35:32 dholland Exp $        */
 
 /*
  * Copyright (c) 1980, 1993
  * 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.
  *
 #if 0
 static char sccsid[] = "@(#)rent.c     8.1 (Berkeley) 5/31/93";
 #else
-__RCSID("$NetBSD: rent.c,v 1.4 1997/10/12 17:45:24 christos Exp $");
+__RCSID("$NetBSD: rent.c,v 1.9 2012/06/19 05:35:32 dholland Exp $");
 #endif
 #endif /* not lint */
 
-#include       "monop.ext"
+#include "monop.h"
 
 /*
  *     This routine has the player pay rent
  */
 void
-rent(sqp)
-SQUARE *sqp;
+rent(SQUARE *sqp)
 {
-
-       int             rnt = 0;
-       PROP    *pp;
-       PLAY            *plp;
+       int rnt = 0;
+       PROP *pp;
+       PLAY *plp;
 
        plp = &play[sqp->owner];
        printf("Owned by %s\n", plp->name);
@@ -69,8 +63,9 @@ SQUARE        *sqp;
                        if (pp->houses == 0)
                                printf("rent is %d\n", rnt=pp->rent[0] * 2);
                        else if (pp->houses < 5)
-                               printf("with %d houses, rent is %d\n",
-                                   pp->houses, rnt=pp->rent[pp->houses]);
+                               printf("with %d house%s, rent is %d\n",
+                                   pp->houses, pp->houses == 1 ? "" : "s",
+                                   rnt=pp->rent[pp->houses]);
                        else
                                printf("with a hotel, rent is %d\n",
                                    rnt=pp->rent[pp->houses]);