Annotation of 43BSDTahoe/games/monop/spec.c, revision 1.1.1.1

1.1       root        1: /*
                      2:  * Copyright (c) 1980 Regents of the University of California.
                      3:  * All rights reserved.
                      4:  *
                      5:  * Redistribution and use in source and binary forms are permitted
                      6:  * provided that the above copyright notice and this paragraph are
                      7:  * duplicated in all such forms and that any documentation,
                      8:  * advertising materials, and other materials related to such
                      9:  * distribution and use acknowledge that the software was developed
                     10:  * by the University of California, Berkeley.  The name of the
                     11:  * University may not be used to endorse or promote products derived
                     12:  * from this software without specific prior written permission.
                     13:  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
                     14:  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
                     15:  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
                     16:  */
                     17: 
                     18: #ifndef lint
                     19: static char sccsid[] = "@(#)spec.c     5.2 (Berkeley) 6/18/88";
                     20: #endif /* not lint */
                     21: 
                     22: # include      "monop.ext"
                     23: 
                     24: static char    *perc[] = {
                     25:        "10%", "ten percent", "%", "$200", "200", 0
                     26:        };
                     27: 
                     28: inc_tax() {                    /* collect income tax                   */
                     29: 
                     30:        reg int worth, com_num;
                     31: 
                     32:        com_num = getinp("Do you wish to lose 10%% of your total worth or $200? ", perc);
                     33:        worth = cur_p->money + prop_worth(cur_p);
                     34:        printf("You were worth $%d", worth);
                     35:        worth /= 10;
                     36:        if (com_num > 2) {
                     37:                if (worth < 200)
                     38:                        printf(".  Good try, but not quite.\n");
                     39:                else if (worth > 200)
                     40:                        lucky(".\nGood guess.  ");
                     41:                cur_p->money -= 200;
                     42:        }
                     43:        else {
                     44:                printf(", so you pay $%d", worth);
                     45:                if (worth > 200)
                     46:                        printf("  OUCH!!!!.\n");
                     47:                else if (worth < 200)
                     48:                        lucky("\nGood guess.  ");
                     49:                cur_p->money -= worth;
                     50:        }
                     51:        if (worth == 200)
                     52:                lucky("\nIt makes no difference!  ");
                     53: }
                     54: goto_jail() {                  /* move player to jail                  */
                     55: 
                     56:        cur_p->loc = JAIL;
                     57: }
                     58: lux_tax() {                    /* landing on luxury tax                */
                     59: 
                     60:        printf("You lose $75\n");
                     61:        cur_p->money -= 75;
                     62: }
                     63: cc() {                         /* draw community chest card            */
                     64: 
                     65:        get_card(&CC_D);
                     66: }
                     67: chance() {                     /* draw chance card                     */
                     68: 
                     69:        get_card(&CH_D);
                     70: }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.