Transformation Rules Applied to File:Misc.java

Showing full text of file after each rule

Rules AppliedJavaKeywordRule app0.txt PPspaceRule PPifdefRule PPifndefRule PPRule PPdefineRule.DefineReplacementRule MissingFunctionTypeRule snippets0b.txt TypedefRule.DefineReplacementRule FunctionPointerReferenceRule MissingReturnRule ArrayDeclaration0Rule AddBracesRule LabelRemoverRule VoidArgumentRule voidstarsnippet.txt ConflictingVariableDeclarationRule StaticVariablesRule StaticFunctionsRule ShorthandOperatorsRule snippets0f.txt readline2.lsnippet promptAndRead.lsnippet ArrayDeclarationRule StringRule ZeroComparisonRule DeclarationAssignmentRule PointerRule ForceToBooleanRule snippets1.txt snippets2.txt snippets2a.txt snippets3.txt ElseIfRule SignalRule PrintfRule stdin.txt IOExceptionRule UninitializedVariableRule InsertClassRule ImportRule (Final Version)
JavaKeywordRule
app0.txt
PPspaceRule
PPifdefRule
PPifndefRule
PPRule
PPdefineRule.DefineReplacementRule
MissingFunctionTypeRule
snippets0b.txt
TypedefRule.DefineReplacementRule
FunctionPointerReferenceRule
MissingReturnRule
ArrayDeclaration0Rule
AddBracesRule
LabelRemoverRule
VoidArgumentRule
voidstarsnippet.txt
ConflictingVariableDeclarationRule
StaticVariablesRule
StaticFunctionsRule
ShorthandOperatorsRule
snippets0f.txt
readline2.lsnippet
promptAndRead.lsnippet
ArrayDeclarationRule
StringRule
ZeroComparisonRule
DeclarationAssignmentRule
PointerRule
ForceToBooleanRule
snippets1.txt
snippets2.txt
snippets2a.txt
snippets3.txt
ElseIfRule
SignalRule
PrintfRule
stdin.txt
IOExceptionRule
UninitializedVariableRule
InsertClassRule
ImportRule
final
#ifndef lint
static char sccsid[] = "@(#)misc.c	5.6 (Berkeley) 3/25/93";
#endif
# include	"monop.ext"
# include	
# include	
getyn(register char * prompt, void * = 0) {
    regint com;
    for (;;) if ((com = getinp(prompt, yn)) < 2) return com;
    else ( * func[com - 2]) ();
}
void notify1(void * = 0) {
    if (cur_p->money < 0) printf("That leaves you $%d in debt\n", - cur_p->money);
    else if (cur_p->money == 0) printf("that leaves you broke\n");
    else if (fixing &&!told_em && cur_p->money > 0) {
        printf("-- You are now Solvent ---\n");
        told_em = TRUE;
    }
}
void next_play(void) {
    player =++player % num_play;
    cur_p = & play[player];
    num_doub = 0;
}
get_int(register char * prompt) {
    regint num;
    regchar * sp;
    char buf[257];
    for (;;) {
        inter:for (;;) {
            printf(prompt);
            num = 0;
            for (sp = buf;( * sp = getchar()) != '\n';sp++) if ( * sp == - 1) continue;
            break;
        }
        if (sp == buf) continue;
        for (sp = buf;isspace( * sp);sp++) continue;
        for (;isdigit( * sp);sp++) num = num * 10 + * sp - '0';
        if ( * sp == '\n') return num;
        else printf("I can't understand that\n");
    }
}
void set_ownlist(int pl) {
    regint num;
    reg MON * orig;
    reg OWN * op;
    OWN * orig_op;
    op = play[pl].own_list;
    #ifdef DEBUG
    printf("op [%d] = play[pl [%d] ].own_list;\n", op, pl);
    #endif
    while (op) {
        #ifdef DEBUG
        printf("op->sqr->type = %d\n", op->sqr->type);
        #endif
        switch (op->sqr->type) {
            case UTIL:
                #ifdef DEBUG
                printf("  case UTIL:\n");
                #endif
                for (num = 0;op && op->sqr->type == UTIL;op = op->next) num++;
                play[pl].num_util = num;
                #ifdef DEBUG
                printf("play[pl].num_util = num [%d];\n", num);
                #endif
                break;
            case RR:
                #ifdef DEBUG
                printf("  case RR:\n");
                #endif
                for (num = 0;op && op->sqr->type == RR;op = op->next) {
                    #ifdef DEBUG
                    printf("iter: %d\n", num);
                    printf("op = %d, op->sqr = %d, op->sqr->type = %d\n", op, op->sqr, op->sqr->type);
                    #endif
                    num++;
                }
                play[pl].num_rr = num;
                #ifdef DEBUG
                printf("play[pl].num_rr = num [%d];\n", num);
                #endif
                break;
            case PRPTY:
                #ifdef DEBUG
                printf("  case PRPTY:\n");
                #endif
                orig = op->sqr->desc->mon_desc;
                orig_op = op;
                num = 0;
                while (op && op->sqr->desc->mon_desc == orig) {
                    #ifdef DEBUG
                    printf("iter: %d\n", num);
                    #endif
                    num++;
                    #ifdef DEBUG
                    printf("op = op->next ");
                    #endif
                    op = op->next;
                    #ifdef DEBUG
                    printf("[%d];\n", op);
                    #endif
                }
                #ifdef DEBUG
                printf("num = %d\n");
                #endif
                if (orig == 0) {
                    printf("panic:  bad monopoly descriptor: orig = %d\n", orig);
                    printf("player # %d\n", pl + 1);
                    printhold(pl);
                    printf("orig_op = %d\n", orig_op);
                    printf("orig_op->sqr->type = %d (PRPTY)\n", op->sqr->type);
                    printf("orig_op->next = %d\n", op->next);
                    printf("orig_op->sqr->desc = %d\n", op->sqr->desc);
                    printf("op = %d\n", op);
                    printf("op->sqr->type = %d (PRPTY)\n", op->sqr->type);
                    printf("op->next = %d\n", op->next);
                    printf("op->sqr->desc = %d\n", op->sqr->desc);
                    printf("num = %d\n", num);
                }
                #ifdef DEBUG
                printf("orig->num_in = %d\n", orig->num_in);
                #endif
                if (num == orig->num_in) is_monop(orig, pl);
                else isnot_monop(orig);
                break;
        }
    }
}
void is_monop(register MON * mp, int pl) {
    regchar * sp;
    regint i;
    mp->owner = pl;
    mp->num_own = mp->num_in;
    for (i = 0;i < mp->num_in;i++) mp->sq[i]->desc->monop = TRUE;
    mp->name = mp->mon_n;
}
void isnot_monop(register MON * mp) {
    regchar * sp;
    regint i;
    mp->owner = - 1;
    for (i = 0;i < mp->num_in;i++) mp->sq[i]->desc->monop = FALSE;
    mp->name = mp->not_m;
}
void list(void) {
    printhold(player);
}
void list_all(void) {
    regint pl;
    while ((pl = getinp("Whose holdings do you want to see? ", name_list)) < num_play) printhold(pl);
}
void sigquit(int sig) {
    quit();
    signal(SIGINT, sigquit);
}
void quit() {
    putchar('\n');
    if (getyn("Do you all really want to quit? ") == 0) exit(0);
}
#ifndef lint
static char sccsid[] = "@(#)misc.c	5.6 (Berkeley) 3/25/93";
#endif
# include	"monop.ext"
# include	
# include	
getYesOrNo(register char * prompt, void * = 0) {
    regint answerIndex;
    for (;;) if ((answerIndex = getinp(prompt, yesNoChoices)) < 2) return answerIndex;
    else ( * functions[answerIndex - 2]) ();
}
void notify1(void * = 0) {
    if (currentPlayer->money < 0) printf("That leaves you $%d in debt\n", - currentPlayer->money);
    else if (currentPlayer->money == 0) printf("that leaves you broke\n");
    else if (fixing &&!moneyStatusGiven && currentPlayer->money > 0) {
        printf("-- You are now Solvent ---\n");
        moneyStatusGiven = TRUE;
    }
}
void nextPlayer(void) {
    currentPlayerNumber =++currentPlayerNumber % numberOfPlayers;
    currentPlayer = & players[currentPlayerNumber];
    numberOfDoubles = 0;
}
getInteger(register char * prompt) {
    regint num;
    regchar * sp;
    char buf[257];
    for (;;) {
        inter:for (;;) {
            printf(prompt);
            num = 0;
            for (sp = buf;( * sp = getchar()) != '\n';sp++) if ( * sp == - 1) continue;
            break;
        }
        if (sp == buf) continue;
        for (sp = buf;isspace( * sp);sp++) continue;
        for (;isdigit( * sp);sp++) num = num * 10 + * sp - '0';
        if ( * sp == '\n') return num;
        else printf("I can't understand that\n");
    }
}
void initializeOwnerList(int playerIndex) {
    regint num;
    reg MON * originalMonopoly;
    reg OWN * propertyList;
    OWN * original_ownedPropertyList;
    propertyList = players[playerIndex].ownedPropertyList;
    #ifdef DEBUG
    printf("op [%d] = play[pl [%d] ].own_list;\n", propertyList, playerIndex);
    #endif
    while (propertyList) {
        #ifdef DEBUG
        printf("op->sqr->type = %d\n", propertyList->square1->type);
        #endif
        switch (propertyList->square1->type) {
            case TYPE_UTIL:
                #ifdef DEBUG
                printf("  case UTIL:\n");
                #endif
                for (num = 0;propertyList && propertyList->square1->type == TYPE_UTIL;propertyList = propertyList->next) num++;
                players[playerIndex].utilitiesCount = num;
                #ifdef DEBUG
                printf("play[pl].num_util = num [%d];\n", num);
                #endif
                break;
            case TYPE_RAILROAD:
                #ifdef DEBUG
                printf("  case RR:\n");
                #endif
                for (num = 0;propertyList && propertyList->square1->type == TYPE_RAILROAD;propertyList = propertyList->next) {
                    #ifdef DEBUG
                    printf("iter: %d\n", num);
                    printf("op = %d, op->sqr = %d, op->sqr->type = %d\n", propertyList, propertyList->square1, propertyList->square1->type);
                    #endif
                    num++;
                }
                players[playerIndex].railroadCardCount = num;
                #ifdef DEBUG
                printf("play[pl].num_rr = num [%d];\n", num);
                #endif
                break;
            case TYPE_PROPERTY:
                #ifdef DEBUG
                printf("  case PRPTY:\n");
                #endif
                originalMonopoly = propertyList->square1->description->monopolyDescription;
                original_ownedPropertyList = propertyList;
                num = 0;
                while (propertyList && propertyList->square1->description->monopolyDescription == originalMonopoly) {
                    #ifdef DEBUG
                    printf("iter: %d\n", num);
                    #endif
                    num++;
                    #ifdef DEBUG
                    printf("op = op->next ");
                    #endif
                    propertyList = propertyList->next;
                    #ifdef DEBUG
                    printf("[%d];\n", propertyList);
                    #endif
                }
                #ifdef DEBUG
                printf("num = %d\n");
                #endif
                if (originalMonopoly == 0) {
                    printf("panic:  bad monopoly descriptor: orig = %d\n", originalMonopoly);
                    printf("player # %d\n", playerIndex + 1);
                    printHoldings(playerIndex);
                    printf("orig_op = %d\n", original_ownedPropertyList);
                    printf("orig_op->sqr->type = %d (PRPTY)\n", propertyList->square1->type);
                    printf("orig_op->next = %d\n", propertyList->next);
                    printf("orig_op->sqr->desc = %d\n", propertyList->square1->description);
                    printf("op = %d\n", propertyList);
                    printf("op->sqr->type = %d (PRPTY)\n", propertyList->square1->type);
                    printf("op->next = %d\n", propertyList->next);
                    printf("op->sqr->desc = %d\n", propertyList->square1->description);
                    printf("num = %d\n", num);
                }
                #ifdef DEBUG
                printf("orig->num_in = %d\n", originalMonopoly->housesInMonopoly);
                #endif
                if (num == originalMonopoly->housesInMonopoly) isMonopoly(originalMonopoly, playerIndex);
                else isNotMonopoly(originalMonopoly);
                break;
        }
    }
}
void isMonopoly(register MON * monopoly, int playerIndex) {
    regchar * sp;
    regint i;
    monopoly->owner = playerIndex;
    monopoly->numberOfOwners = monopoly->housesInMonopoly;
    for (i = 0;i < monopoly->housesInMonopoly;i++) monopoly->squares[i]->description->isMonopoly = TRUE;
    monopoly->name = monopoly->uppercaseColor;
}
void isNotMonopoly(register MON * monopoly) {
    regchar * sp;
    regint i;
    monopoly->owner = - 1;
    for (i = 0;i < monopoly->housesInMonopoly;i++) monopoly->squares[i]->description->isMonopoly = FALSE;
    monopoly->name = monopoly->lowercaseColor;
}
void printHoldings(void) {
    printHoldings(currentPlayerNumber);
}
void promptAndPrintHoldings(void) {
    regint playerIndex;
    while ((playerIndex = getinp("Whose holdings do you want to see? ", playerNames)) < numberOfPlayers) printHoldings(playerIndex);
}
void sigquit(int sig) {
    quit_confirm();
    signal(SIGINT, sigquit);
}
void quit_confirm() {
    putchar('\n');
    if (getYesOrNo("Do you all really want to quit? ") == 0) exit(0);
}
#ifndef lint
static char sccsid[] = "@(#)misc.c	5.6 (Berkeley) 3/25/93";
#endif
#include	"monop.ext"
#include	
#include	
getYesOrNo(register char * prompt, void * = 0) {
    regint answerIndex;
    for (;;) if ((answerIndex = getinp(prompt, yesNoChoices)) < 2) return answerIndex;
    else ( * functions[answerIndex - 2]) ();
}
void notify1(void * = 0) {
    if (currentPlayer->money < 0) printf("That leaves you $%d in debt\n", - currentPlayer->money);
    else if (currentPlayer->money == 0) printf("that leaves you broke\n");
    else if (fixing &&!moneyStatusGiven && currentPlayer->money > 0) {
        printf("-- You are now Solvent ---\n");
        moneyStatusGiven = TRUE;
    }
}
void nextPlayer(void) {
    currentPlayerNumber =++currentPlayerNumber % numberOfPlayers;
    currentPlayer = & players[currentPlayerNumber];
    numberOfDoubles = 0;
}
getInteger(register char * prompt) {
    regint num;
    regchar * sp;
    char buf[257];
    for (;;) {
        inter:for (;;) {
            printf(prompt);
            num = 0;
            for (sp = buf;( * sp = getchar()) != '\n';sp++) if ( * sp == - 1) continue;
            break;
        }
        if (sp == buf) continue;
        for (sp = buf;isspace( * sp);sp++) continue;
        for (;isdigit( * sp);sp++) num = num * 10 + * sp - '0';
        if ( * sp == '\n') return num;
        else printf("I can't understand that\n");
    }
}
void initializeOwnerList(int playerIndex) {
    regint num;
    reg MON * originalMonopoly;
    reg OWN * propertyList;
    OWN * original_ownedPropertyList;
    propertyList = players[playerIndex].ownedPropertyList;
    #ifdef DEBUG
    printf("op [%d] = play[pl [%d] ].own_list;\n", propertyList, playerIndex);
    #endif
    while (propertyList) {
        #ifdef DEBUG
        printf("op->sqr->type = %d\n", propertyList->square1->type);
        #endif
        switch (propertyList->square1->type) {
            case TYPE_UTIL:
                #ifdef DEBUG
                printf("  case UTIL:\n");
                #endif
                for (num = 0;propertyList && propertyList->square1->type == TYPE_UTIL;propertyList = propertyList->next) num++;
                players[playerIndex].utilitiesCount = num;
                #ifdef DEBUG
                printf("play[pl].num_util = num [%d];\n", num);
                #endif
                break;
            case TYPE_RAILROAD:
                #ifdef DEBUG
                printf("  case RR:\n");
                #endif
                for (num = 0;propertyList && propertyList->square1->type == TYPE_RAILROAD;propertyList = propertyList->next) {
                    #ifdef DEBUG
                    printf("iter: %d\n", num);
                    printf("op = %d, op->sqr = %d, op->sqr->type = %d\n", propertyList, propertyList->square1, propertyList->square1->type);
                    #endif
                    num++;
                }
                players[playerIndex].railroadCardCount = num;
                #ifdef DEBUG
                printf("play[pl].num_rr = num [%d];\n", num);
                #endif
                break;
            case TYPE_PROPERTY:
                #ifdef DEBUG
                printf("  case PRPTY:\n");
                #endif
                originalMonopoly = propertyList->square1->description->monopolyDescription;
                original_ownedPropertyList = propertyList;
                num = 0;
                while (propertyList && propertyList->square1->description->monopolyDescription == originalMonopoly) {
                    #ifdef DEBUG
                    printf("iter: %d\n", num);
                    #endif
                    num++;
                    #ifdef DEBUG
                    printf("op = op->next ");
                    #endif
                    propertyList = propertyList->next;
                    #ifdef DEBUG
                    printf("[%d];\n", propertyList);
                    #endif
                }
                #ifdef DEBUG
                printf("num = %d\n");
                #endif
                if (originalMonopoly == 0) {
                    printf("panic:  bad monopoly descriptor: orig = %d\n", originalMonopoly);
                    printf("player # %d\n", playerIndex + 1);
                    printHoldings(playerIndex);
                    printf("orig_op = %d\n", original_ownedPropertyList);
                    printf("orig_op->sqr->type = %d (PRPTY)\n", propertyList->square1->type);
                    printf("orig_op->next = %d\n", propertyList->next);
                    printf("orig_op->sqr->desc = %d\n", propertyList->square1->description);
                    printf("op = %d\n", propertyList);
                    printf("op->sqr->type = %d (PRPTY)\n", propertyList->square1->type);
                    printf("op->next = %d\n", propertyList->next);
                    printf("op->sqr->desc = %d\n", propertyList->square1->description);
                    printf("num = %d\n", num);
                }
                #ifdef DEBUG
                printf("orig->num_in = %d\n", originalMonopoly->housesInMonopoly);
                #endif
                if (num == originalMonopoly->housesInMonopoly) isMonopoly(originalMonopoly, playerIndex);
                else isNotMonopoly(originalMonopoly);
                break;
        }
    }
}
void isMonopoly(register MON * monopoly, int playerIndex) {
    regchar * sp;
    regint i;
    monopoly->owner = playerIndex;
    monopoly->numberOfOwners = monopoly->housesInMonopoly;
    for (i = 0;i < monopoly->housesInMonopoly;i++) monopoly->squares[i]->description->isMonopoly = TRUE;
    monopoly->name = monopoly->uppercaseColor;
}
void isNotMonopoly(register MON * monopoly) {
    regchar * sp;
    regint i;
    monopoly->owner = - 1;
    for (i = 0;i < monopoly->housesInMonopoly;i++) monopoly->squares[i]->description->isMonopoly = FALSE;
    monopoly->name = monopoly->lowercaseColor;
}
void printHoldings(void) {
    printHoldings(currentPlayerNumber);
}
void promptAndPrintHoldings(void) {
    regint playerIndex;
    while ((playerIndex = getinp("Whose holdings do you want to see? ", playerNames)) < numberOfPlayers) printHoldings(playerIndex);
}
void sigquit(int sig) {
    quit_confirm();
    signal(SIGINT, sigquit);
}
void quit_confirm() {
    putchar('\n');
    if (getYesOrNo("Do you all really want to quit? ") == 0) exit(0);
}
#ifndef lint
static char sccsid[] = "@(#)misc.c	5.6 (Berkeley) 3/25/93";
#endif
#include	"monop.ext"
#include	
#include	
getYesOrNo(register char * prompt, void * = 0) {
    regint answerIndex;
    for (;;) if ((answerIndex = getinp(prompt, yesNoChoices)) < 2) return answerIndex;
    else ( * functions[answerIndex - 2]) ();
}
void notify1(void * = 0) {
    if (currentPlayer->money < 0) printf("That leaves you $%d in debt\n", - currentPlayer->money);
    else if (currentPlayer->money == 0) printf("that leaves you broke\n");
    else if (fixing &&!moneyStatusGiven && currentPlayer->money > 0) {
        printf("-- You are now Solvent ---\n");
        moneyStatusGiven = TRUE;
    }
}
void nextPlayer(void) {
    currentPlayerNumber =++currentPlayerNumber % numberOfPlayers;
    currentPlayer = & players[currentPlayerNumber];
    numberOfDoubles = 0;
}
getInteger(register char * prompt) {
    regint num;
    regchar * sp;
    char buf[257];
    for (;;) {
        inter:for (;;) {
            printf(prompt);
            num = 0;
            for (sp = buf;( * sp = getchar()) != '\n';sp++) if ( * sp == - 1) continue;
            break;
        }
        if (sp == buf) continue;
        for (sp = buf;isspace( * sp);sp++) continue;
        for (;isdigit( * sp);sp++) num = num * 10 + * sp - '0';
        if ( * sp == '\n') return num;
        else printf("I can't understand that\n");
    }
}
void initializeOwnerList(int playerIndex) {
    regint num;
    reg MON * originalMonopoly;
    reg OWN * propertyList;
    OWN * original_ownedPropertyList;
    propertyList = players[playerIndex].ownedPropertyList;
    #if defined(DEBUG)
    printf("op [%d] = play[pl [%d] ].own_list;\n", propertyList, playerIndex);
    #endif
    while (propertyList) {
        #if defined(DEBUG)
        printf("op->sqr->type = %d\n", propertyList->square1->type);
        #endif
        switch (propertyList->square1->type) {
            case TYPE_UTIL:
                #if defined(DEBUG)
                printf("  case UTIL:\n");
                #endif
                for (num = 0;propertyList && propertyList->square1->type == TYPE_UTIL;propertyList = propertyList->next) num++;
                players[playerIndex].utilitiesCount = num;
                #if defined(DEBUG)
                printf("play[pl].num_util = num [%d];\n", num);
                #endif
                break;
            case TYPE_RAILROAD:
                #if defined(DEBUG)
                printf("  case RR:\n");
                #endif
                for (num = 0;propertyList && propertyList->square1->type == TYPE_RAILROAD;propertyList = propertyList->next) {
                    #if defined(DEBUG)
                    printf("iter: %d\n", num);
                    printf("op = %d, op->sqr = %d, op->sqr->type = %d\n", propertyList, propertyList->square1, propertyList->square1->type);
                    #endif
                    num++;
                }
                players[playerIndex].railroadCardCount = num;
                #if defined(DEBUG)
                printf("play[pl].num_rr = num [%d];\n", num);
                #endif
                break;
            case TYPE_PROPERTY:
                #if defined(DEBUG)
                printf("  case PRPTY:\n");
                #endif
                originalMonopoly = propertyList->square1->description->monopolyDescription;
                original_ownedPropertyList = propertyList;
                num = 0;
                while (propertyList && propertyList->square1->description->monopolyDescription == originalMonopoly) {
                    #if defined(DEBUG)
                    printf("iter: %d\n", num);
                    #endif
                    num++;
                    #if defined(DEBUG)
                    printf("op = op->next ");
                    #endif
                    propertyList = propertyList->next;
                    #if defined(DEBUG)
                    printf("[%d];\n", propertyList);
                    #endif
                }
                #if defined(DEBUG)
                printf("num = %d\n");
                #endif
                if (originalMonopoly == 0) {
                    printf("panic:  bad monopoly descriptor: orig = %d\n", originalMonopoly);
                    printf("player # %d\n", playerIndex + 1);
                    printHoldings(playerIndex);
                    printf("orig_op = %d\n", original_ownedPropertyList);
                    printf("orig_op->sqr->type = %d (PRPTY)\n", propertyList->square1->type);
                    printf("orig_op->next = %d\n", propertyList->next);
                    printf("orig_op->sqr->desc = %d\n", propertyList->square1->description);
                    printf("op = %d\n", propertyList);
                    printf("op->sqr->type = %d (PRPTY)\n", propertyList->square1->type);
                    printf("op->next = %d\n", propertyList->next);
                    printf("op->sqr->desc = %d\n", propertyList->square1->description);
                    printf("num = %d\n", num);
                }
                #if defined(DEBUG)
                printf("orig->num_in = %d\n", originalMonopoly->housesInMonopoly);
                #endif
                if (num == originalMonopoly->housesInMonopoly) isMonopoly(originalMonopoly, playerIndex);
                else isNotMonopoly(originalMonopoly);
                break;
        }
    }
}
void isMonopoly(register MON * monopoly, int playerIndex) {
    regchar * sp;
    regint i;
    monopoly->owner = playerIndex;
    monopoly->numberOfOwners = monopoly->housesInMonopoly;
    for (i = 0;i < monopoly->housesInMonopoly;i++) monopoly->squares[i]->description->isMonopoly = TRUE;
    monopoly->name = monopoly->uppercaseColor;
}
void isNotMonopoly(register MON * monopoly) {
    regchar * sp;
    regint i;
    monopoly->owner = - 1;
    for (i = 0;i < monopoly->housesInMonopoly;i++) monopoly->squares[i]->description->isMonopoly = FALSE;
    monopoly->name = monopoly->lowercaseColor;
}
void printHoldings(void) {
    printHoldings(currentPlayerNumber);
}
void promptAndPrintHoldings(void) {
    regint playerIndex;
    while ((playerIndex = getinp("Whose holdings do you want to see? ", playerNames)) < numberOfPlayers) printHoldings(playerIndex);
}
void sigquit(int sig) {
    quit_confirm();
    signal(SIGINT, sigquit);
}
void quit_confirm() {
    putchar('\n');
    if (getYesOrNo("Do you all really want to quit? ") == 0) exit(0);
}
#if !defined(lint)
static char sccsid[] = "@(#)misc.c	5.6 (Berkeley) 3/25/93";
#endif
#include	"monop.ext"
#include	
#include	
getYesOrNo(register char * prompt, void * = 0) {
    regint answerIndex;
    for (;;) if ((answerIndex = getinp(prompt, yesNoChoices)) < 2) return answerIndex;
    else ( * functions[answerIndex - 2]) ();
}
void notify1(void * = 0) {
    if (currentPlayer->money < 0) printf("That leaves you $%d in debt\n", - currentPlayer->money);
    else if (currentPlayer->money == 0) printf("that leaves you broke\n");
    else if (fixing &&!moneyStatusGiven && currentPlayer->money > 0) {
        printf("-- You are now Solvent ---\n");
        moneyStatusGiven = TRUE;
    }
}
void nextPlayer(void) {
    currentPlayerNumber =++currentPlayerNumber % numberOfPlayers;
    currentPlayer = & players[currentPlayerNumber];
    numberOfDoubles = 0;
}
getInteger(register char * prompt) {
    regint num;
    regchar * sp;
    char buf[257];
    for (;;) {
        inter:for (;;) {
            printf(prompt);
            num = 0;
            for (sp = buf;( * sp = getchar()) != '\n';sp++) if ( * sp == - 1) continue;
            break;
        }
        if (sp == buf) continue;
        for (sp = buf;isspace( * sp);sp++) continue;
        for (;isdigit( * sp);sp++) num = num * 10 + * sp - '0';
        if ( * sp == '\n') return num;
        else printf("I can't understand that\n");
    }
}
void initializeOwnerList(int playerIndex) {
    regint num;
    reg MON * originalMonopoly;
    reg OWN * propertyList;
    OWN * original_ownedPropertyList;
    propertyList = players[playerIndex].ownedPropertyList;
    #if defined(DEBUG)
    printf("op [%d] = play[pl [%d] ].own_list;\n", propertyList, playerIndex);
    #endif
    while (propertyList) {
        #if defined(DEBUG)
        printf("op->sqr->type = %d\n", propertyList->square1->type);
        #endif
        switch (propertyList->square1->type) {
            case TYPE_UTIL:
                #if defined(DEBUG)
                printf("  case UTIL:\n");
                #endif
                for (num = 0;propertyList && propertyList->square1->type == TYPE_UTIL;propertyList = propertyList->next) num++;
                players[playerIndex].utilitiesCount = num;
                #if defined(DEBUG)
                printf("play[pl].num_util = num [%d];\n", num);
                #endif
                break;
            case TYPE_RAILROAD:
                #if defined(DEBUG)
                printf("  case RR:\n");
                #endif
                for (num = 0;propertyList && propertyList->square1->type == TYPE_RAILROAD;propertyList = propertyList->next) {
                    #if defined(DEBUG)
                    printf("iter: %d\n", num);
                    printf("op = %d, op->sqr = %d, op->sqr->type = %d\n", propertyList, propertyList->square1, propertyList->square1->type);
                    #endif
                    num++;
                }
                players[playerIndex].railroadCardCount = num;
                #if defined(DEBUG)
                printf("play[pl].num_rr = num [%d];\n", num);
                #endif
                break;
            case TYPE_PROPERTY:
                #if defined(DEBUG)
                printf("  case PRPTY:\n");
                #endif
                originalMonopoly = propertyList->square1->description->monopolyDescription;
                original_ownedPropertyList = propertyList;
                num = 0;
                while (propertyList && propertyList->square1->description->monopolyDescription == originalMonopoly) {
                    #if defined(DEBUG)
                    printf("iter: %d\n", num);
                    #endif
                    num++;
                    #if defined(DEBUG)
                    printf("op = op->next ");
                    #endif
                    propertyList = propertyList->next;
                    #if defined(DEBUG)
                    printf("[%d];\n", propertyList);
                    #endif
                }
                #if defined(DEBUG)
                printf("num = %d\n");
                #endif
                if (originalMonopoly == 0) {
                    printf("panic:  bad monopoly descriptor: orig = %d\n", originalMonopoly);
                    printf("player # %d\n", playerIndex + 1);
                    printHoldings(playerIndex);
                    printf("orig_op = %d\n", original_ownedPropertyList);
                    printf("orig_op->sqr->type = %d (PRPTY)\n", propertyList->square1->type);
                    printf("orig_op->next = %d\n", propertyList->next);
                    printf("orig_op->sqr->desc = %d\n", propertyList->square1->description);
                    printf("op = %d\n", propertyList);
                    printf("op->sqr->type = %d (PRPTY)\n", propertyList->square1->type);
                    printf("op->next = %d\n", propertyList->next);
                    printf("op->sqr->desc = %d\n", propertyList->square1->description);
                    printf("num = %d\n", num);
                }
                #if defined(DEBUG)
                printf("orig->num_in = %d\n", originalMonopoly->housesInMonopoly);
                #endif
                if (num == originalMonopoly->housesInMonopoly) isMonopoly(originalMonopoly, playerIndex);
                else isNotMonopoly(originalMonopoly);
                break;
        }
    }
}
void isMonopoly(register MON * monopoly, int playerIndex) {
    regchar * sp;
    regint i;
    monopoly->owner = playerIndex;
    monopoly->numberOfOwners = monopoly->housesInMonopoly;
    for (i = 0;i < monopoly->housesInMonopoly;i++) monopoly->squares[i]->description->isMonopoly = TRUE;
    monopoly->name = monopoly->uppercaseColor;
}
void isNotMonopoly(register MON * monopoly) {
    regchar * sp;
    regint i;
    monopoly->owner = - 1;
    for (i = 0;i < monopoly->housesInMonopoly;i++) monopoly->squares[i]->description->isMonopoly = FALSE;
    monopoly->name = monopoly->lowercaseColor;
}
void printHoldings(void) {
    printHoldings(currentPlayerNumber);
}
void promptAndPrintHoldings(void) {
    regint playerIndex;
    while ((playerIndex = getinp("Whose holdings do you want to see? ", playerNames)) < numberOfPlayers) printHoldings(playerIndex);
}
void sigquit(int sig) {
    quit_confirm();
    signal(SIGINT, sigquit);
}
void quit_confirm() {
    putchar('\n');
    if (getYesOrNo("Do you all really want to quit? ") == 0) exit(0);
}
static char sccsid[] = "@(#)misc.c	5.6 (Berkeley) 3/25/93";
getYesOrNo(register char * prompt, void * = 0) {
    regint answerIndex;
    for (;;) if ((answerIndex = getinp(prompt, yesNoChoices)) < 2) return answerIndex;
    else ( * functions[answerIndex - 2]) ();
}
void notify1(void * = 0) {
    if (currentPlayer->money < 0) printf("That leaves you $%d in debt\n", - currentPlayer->money);
    else if (currentPlayer->money == 0) printf("that leaves you broke\n");
    else if (fixing &&!moneyStatusGiven && currentPlayer->money > 0) {
        printf("-- You are now Solvent ---\n");
        moneyStatusGiven = TRUE;
    }
}
void nextPlayer(void) {
    currentPlayerNumber =++currentPlayerNumber % numberOfPlayers;
    currentPlayer = & players[currentPlayerNumber];
    numberOfDoubles = 0;
}
getInteger(register char * prompt) {
    regint num;
    regchar * sp;
    char buf[257];
    for (;;) {
        inter:for (;;) {
            printf(prompt);
            num = 0;
            for (sp = buf;( * sp = getchar()) != '\n';sp++) if ( * sp == - 1) continue;
            break;
        }
        if (sp == buf) continue;
        for (sp = buf;isspace( * sp);sp++) continue;
        for (;isdigit( * sp);sp++) num = num * 10 + * sp - '0';
        if ( * sp == '\n') return num;
        else printf("I can't understand that\n");
    }
}
void initializeOwnerList(int playerIndex) {
    regint num;
    reg MON * originalMonopoly;
    reg OWN * propertyList;
    OWN * original_ownedPropertyList;
    propertyList = players[playerIndex].ownedPropertyList;
    while (propertyList) {
        switch (propertyList->square1->type) {
            case TYPE_UTIL:
                for (num = 0;propertyList && propertyList->square1->type == TYPE_UTIL;propertyList = propertyList->next) num++;
                players[playerIndex].utilitiesCount = num;
                break;
            case TYPE_RAILROAD:
                for (num = 0;propertyList && propertyList->square1->type == TYPE_RAILROAD;propertyList = propertyList->next) {
                    num++;
                }
                players[playerIndex].railroadCardCount = num;
                break;
            case TYPE_PROPERTY:
                originalMonopoly = propertyList->square1->description->monopolyDescription;
                original_ownedPropertyList = propertyList;
                num = 0;
                while (propertyList && propertyList->square1->description->monopolyDescription == originalMonopoly) {
                    num++;
                    propertyList = propertyList->next;
                }
                if (originalMonopoly == 0) {
                    printf("panic:  bad monopoly descriptor: orig = %d\n", originalMonopoly);
                    printf("player # %d\n", playerIndex + 1);
                    printHoldings(playerIndex);
                    printf("orig_op = %d\n", original_ownedPropertyList);
                    printf("orig_op->sqr->type = %d (PRPTY)\n", propertyList->square1->type);
                    printf("orig_op->next = %d\n", propertyList->next);
                    printf("orig_op->sqr->desc = %d\n", propertyList->square1->description);
                    printf("op = %d\n", propertyList);
                    printf("op->sqr->type = %d (PRPTY)\n", propertyList->square1->type);
                    printf("op->next = %d\n", propertyList->next);
                    printf("op->sqr->desc = %d\n", propertyList->square1->description);
                    printf("num = %d\n", num);
                }
                if (num == originalMonopoly->housesInMonopoly) isMonopoly(originalMonopoly, playerIndex);
                else isNotMonopoly(originalMonopoly);
                break;
        }
    }
}
void isMonopoly(register MON * monopoly, int playerIndex) {
    regchar * sp;
    regint i;
    monopoly->owner = playerIndex;
    monopoly->numberOfOwners = monopoly->housesInMonopoly;
    for (i = 0;i < monopoly->housesInMonopoly;i++) monopoly->squares[i]->description->isMonopoly = TRUE;
    monopoly->name = monopoly->uppercaseColor;
}
void isNotMonopoly(register MON * monopoly) {
    regchar * sp;
    regint i;
    monopoly->owner = - 1;
    for (i = 0;i < monopoly->housesInMonopoly;i++) monopoly->squares[i]->description->isMonopoly = FALSE;
    monopoly->name = monopoly->lowercaseColor;
}
void printHoldings(void) {
    printHoldings(currentPlayerNumber);
}
void promptAndPrintHoldings(void) {
    regint playerIndex;
    while ((playerIndex = getinp("Whose holdings do you want to see? ", playerNames)) < numberOfPlayers) printHoldings(playerIndex);
}
void sigquit(int sig) {
    quit_confirm();
    signal(SIGINT, sigquit);
}
void quit_confirm() {
    putchar('\n');
    if (getYesOrNo("Do you all really want to quit? ") == 0) exit(0);
}
static char sccsid[] = "@(#)misc.c	5.6 (Berkeley) 3/25/93";
getYesOrNo(register char * prompt, void * = 0) {
    register int answerIndex;
    for (;;) if ((answerIndex = getinp(prompt, yesNoChoices)) < 2) return answerIndex;
    else ( * functions[answerIndex - 2]) ();
}
void notify1(void * = 0) {
    if (currentPlayer->money < 0) printf("That leaves you $%d in debt\n", - currentPlayer->money);
    else if (currentPlayer->money == 0) printf("that leaves you broke\n");
    else if (fixing &&!moneyStatusGiven && currentPlayer->money > 0) {
        printf("-- You are now Solvent ---\n");
        moneyStatusGiven = true;
    }
}
void nextPlayer(void) {
    currentPlayerNumber =++currentPlayerNumber % numberOfPlayers;
    currentPlayer = & players[currentPlayerNumber];
    numberOfDoubles = 0;
}
getInteger(register char * prompt) {
    register int num;
    register char * sp;
    char buf[257];
    for (;;) {
        inter:for (;;) {
            printf(prompt);
            num = 0;
            for (sp = buf;( * sp = getchar()) != '\n';sp++) if ( * sp == - 1) continue;
            break;
        }
        if (sp == buf) continue;
        for (sp = buf;isspace( * sp);sp++) continue;
        for (;isdigit( * sp);sp++) num = num * 10 + * sp - '0';
        if ( * sp == '\n') return num;
        else printf("I can't understand that\n");
    }
}
void initializeOwnerList(int playerIndex) {
    register int num;
    register MON * originalMonopoly;
    register OWN * propertyList;
    OWN * original_ownedPropertyList;
    propertyList = players[playerIndex].ownedPropertyList;
    while (propertyList) {
        switch (propertyList->square1->type) {
            case TYPE_UTIL:
                for (num = 0;propertyList && propertyList->square1->type == TYPE_UTIL;propertyList = propertyList->next) num++;
                players[playerIndex].utilitiesCount = num;
                break;
            case TYPE_RAILROAD:
                for (num = 0;propertyList && propertyList->square1->type == TYPE_RAILROAD;propertyList = propertyList->next) {
                    num++;
                }
                players[playerIndex].railroadCardCount = num;
                break;
            case TYPE_PROPERTY:
                originalMonopoly = propertyList->square1->description->monopolyDescription;
                original_ownedPropertyList = propertyList;
                num = 0;
                while (propertyList && propertyList->square1->description->monopolyDescription == originalMonopoly) {
                    num++;
                    propertyList = propertyList->next;
                }
                if (originalMonopoly == 0) {
                    printf("panic:  bad monopoly descriptor: orig = %d\n", originalMonopoly);
                    printf("player # %d\n", playerIndex + 1);
                    printHoldings(playerIndex);
                    printf("orig_op = %d\n", original_ownedPropertyList);
                    printf("orig_op->sqr->type = %d (PRPTY)\n", propertyList->square1->type);
                    printf("orig_op->next = %d\n", propertyList->next);
                    printf("orig_op->sqr->desc = %d\n", propertyList->square1->description);
                    printf("op = %d\n", propertyList);
                    printf("op->sqr->type = %d (PRPTY)\n", propertyList->square1->type);
                    printf("op->next = %d\n", propertyList->next);
                    printf("op->sqr->desc = %d\n", propertyList->square1->description);
                    printf("num = %d\n", num);
                }
                if (num == originalMonopoly->housesInMonopoly) isMonopoly(originalMonopoly, playerIndex);
                else isNotMonopoly(originalMonopoly);
                break;
        }
    }
}
void isMonopoly(register MON * monopoly, int playerIndex) {
    register char * sp;
    register int i;
    monopoly->owner = playerIndex;
    monopoly->numberOfOwners = monopoly->housesInMonopoly;
    for (i = 0;i < monopoly->housesInMonopoly;i++) monopoly->squares[i]->description->isMonopoly = true;
    monopoly->name = monopoly->uppercaseColor;
}
void isNotMonopoly(register MON * monopoly) {
    register char * sp;
    register int i;
    monopoly->owner = - 1;
    for (i = 0;i < monopoly->housesInMonopoly;i++) monopoly->squares[i]->description->isMonopoly = false;
    monopoly->name = monopoly->lowercaseColor;
}
void printHoldings(void) {
    printHoldings(currentPlayerNumber);
}
void promptAndPrintHoldings(void) {
    register int playerIndex;
    while ((playerIndex = getinp("Whose holdings do you want to see? ", playerNames)) < numberOfPlayers) printHoldings(playerIndex);
}
void sigquit(int sig) {
    quit_confirm();
    signal(SIGINT, sigquit);
}
void quit_confirm() {
    putchar('\n');
    if (getYesOrNo("Do you all really want to quit? ") == 0) exit(0);
}
static char sccsid[] = "@(#)misc.c	5.6 (Berkeley) 3/25/93";
int getYesOrNo(register char * prompt, void * = 0) {
    register int answerIndex;
    for (;;) if ((answerIndex = getinp(prompt, yesNoChoices)) < 2) return answerIndex;
    else ( * functions[answerIndex - 2]) ();
}
void notify1(void * = 0) {
    if (currentPlayer->money < 0) printf("That leaves you $%d in debt\n", - currentPlayer->money);
    else if (currentPlayer->money == 0) printf("that leaves you broke\n");
    else if (fixing &&!moneyStatusGiven && currentPlayer->money > 0) {
        printf("-- You are now Solvent ---\n");
        moneyStatusGiven = true;
    }
}
void nextPlayer(void) {
    currentPlayerNumber =++currentPlayerNumber % numberOfPlayers;
    currentPlayer = & players[currentPlayerNumber];
    numberOfDoubles = 0;
}
int getInteger(register char * prompt) {
    register int num;
    register char * sp;
    char buf[257];
    for (;;) {
        inter:for (;;) {
            printf(prompt);
            num = 0;
            for (sp = buf;( * sp = getchar()) != '\n';sp++) if ( * sp == - 1) continue;
            break;
        }
        if (sp == buf) continue;
        for (sp = buf;isspace( * sp);sp++) continue;
        for (;isdigit( * sp);sp++) num = num * 10 + * sp - '0';
        if ( * sp == '\n') return num;
        else printf("I can't understand that\n");
    }
}
void initializeOwnerList(int playerIndex) {
    register int num;
    register MON * originalMonopoly;
    register OWN * propertyList;
    OWN * original_ownedPropertyList;
    propertyList = players[playerIndex].ownedPropertyList;
    while (propertyList) {
        switch (propertyList->square1->type) {
            case TYPE_UTIL:
                for (num = 0;propertyList && propertyList->square1->type == TYPE_UTIL;propertyList = propertyList->next) num++;
                players[playerIndex].utilitiesCount = num;
                break;
            case TYPE_RAILROAD:
                for (num = 0;propertyList && propertyList->square1->type == TYPE_RAILROAD;propertyList = propertyList->next) {
                    num++;
                }
                players[playerIndex].railroadCardCount = num;
                break;
            case TYPE_PROPERTY:
                originalMonopoly = propertyList->square1->description->monopolyDescription;
                original_ownedPropertyList = propertyList;
                num = 0;
                while (propertyList && propertyList->square1->description->monopolyDescription == originalMonopoly) {
                    num++;
                    propertyList = propertyList->next;
                }
                if (originalMonopoly == 0) {
                    printf("panic:  bad monopoly descriptor: orig = %d\n", originalMonopoly);
                    printf("player # %d\n", playerIndex + 1);
                    printHoldings(playerIndex);
                    printf("orig_op = %d\n", original_ownedPropertyList);
                    printf("orig_op->sqr->type = %d (PRPTY)\n", propertyList->square1->type);
                    printf("orig_op->next = %d\n", propertyList->next);
                    printf("orig_op->sqr->desc = %d\n", propertyList->square1->description);
                    printf("op = %d\n", propertyList);
                    printf("op->sqr->type = %d (PRPTY)\n", propertyList->square1->type);
                    printf("op->next = %d\n", propertyList->next);
                    printf("op->sqr->desc = %d\n", propertyList->square1->description);
                    printf("num = %d\n", num);
                }
                if (num == originalMonopoly->housesInMonopoly) isMonopoly(originalMonopoly, playerIndex);
                else isNotMonopoly(originalMonopoly);
                break;
        }
    }
}
void isMonopoly(register MON * monopoly, int playerIndex) {
    register char * sp;
    register int i;
    monopoly->owner = playerIndex;
    monopoly->numberOfOwners = monopoly->housesInMonopoly;
    for (i = 0;i < monopoly->housesInMonopoly;i++) monopoly->squares[i]->description->isMonopoly = true;
    monopoly->name = monopoly->uppercaseColor;
}
void isNotMonopoly(register MON * monopoly) {
    register char * sp;
    register int i;
    monopoly->owner = - 1;
    for (i = 0;i < monopoly->housesInMonopoly;i++) monopoly->squares[i]->description->isMonopoly = false;
    monopoly->name = monopoly->lowercaseColor;
}
void printHoldings(void) {
    printHoldings(currentPlayerNumber);
}
void promptAndPrintHoldings(void) {
    register int playerIndex;
    while ((playerIndex = getinp("Whose holdings do you want to see? ", playerNames)) < numberOfPlayers) printHoldings(playerIndex);
}
void sigquit(int sig) {
    quit_confirm();
    signal(SIGINT, sigquit);
}
void quit_confirm() {
    putchar('\n');
    if (getYesOrNo("Do you all really want to quit? ") == 0) exit(0);
}
static char sccsid[] = "@(#)misc.c	5.6 (Berkeley) 3/25/93";
int getYesOrNo(char * prompt, void * = 0) {
    int answerIndex;
    while (true) if ((answerIndex = getinp(prompt, yesNoChoices)) < 2) return answerIndex;
    else ( * functions[answerIndex - 2]) ();
}
void notify1(void * = 0) {
    if (currentPlayer->money < 0) printf("That leaves you $%d in debt\n", - currentPlayer->money);
    else if (currentPlayer->money == 0) printf("that leaves you broke\n");
    else if (fixing &&!moneyStatusGiven && currentPlayer->money > 0) {
        printf("-- You are now Solvent ---\n");
        moneyStatusGiven = true;
    }
}
void nextPlayer(void) {
    currentPlayerNumber =++currentPlayerNumber % numberOfPlayers;
    currentPlayer = & players[currentPlayerNumber];
    numberOfDoubles = 0;
}
int getInteger(char * prompt) {
    int num;
    char * sp;
    char buf[257];
    while (true) {
        inter:while (true) {
            printf(prompt);
            num = 0;
            for (sp = buf;( * sp = getchar()) != '\n';sp++) if ( * sp == - 1) continue;
            break;
        }
        if (sp == buf) continue;
        for (sp = buf;isspace( * sp);sp++) continue;
        for (;isdigit( * sp);sp++) num = num * 10 + * sp - '0';
        if ( * sp == '\n') return num;
        else printf("I can't understand that\n");
    }
}
void initializeOwnerList(int playerIndex) {
    int num;
    MON * originalMonopoly;
    OWN * propertyList;
    OWN * original_ownedPropertyList;
    propertyList = players[playerIndex].ownedPropertyList;
    while (propertyList) {
        switch (propertyList->square1->type) {
            case TYPE_UTIL:
                for (num = 0;propertyList && propertyList->square1->type == TYPE_UTIL;propertyList = propertyList->next) num++;
                players[playerIndex].utilitiesCount = num;
                break;
            case TYPE_RAILROAD:
                for (num = 0;propertyList && propertyList->square1->type == TYPE_RAILROAD;propertyList = propertyList->next) {
                    num++;
                }
                players[playerIndex].railroadCardCount = num;
                break;
            case TYPE_PROPERTY:
                originalMonopoly = propertyList->square1->description->monopolyDescription;
                original_ownedPropertyList = propertyList;
                num = 0;
                while (propertyList && propertyList->square1->description->monopolyDescription == originalMonopoly) {
                    num++;
                    propertyList = propertyList->next;
                }
                if (originalMonopoly == 0) {
                    printf("panic:  bad monopoly descriptor: orig = %d\n", originalMonopoly);
                    printf("player # %d\n", playerIndex + 1);
                    printHoldings(playerIndex);
                    printf("orig_op = %d\n", original_ownedPropertyList);
                    printf("orig_op->sqr->type = %d (PRPTY)\n", propertyList->square1->type);
                    printf("orig_op->next = %d\n", propertyList->next);
                    printf("orig_op->sqr->desc = %d\n", propertyList->square1->description);
                    printf("op = %d\n", propertyList);
                    printf("op->sqr->type = %d (PRPTY)\n", propertyList->square1->type);
                    printf("op->next = %d\n", propertyList->next);
                    printf("op->sqr->desc = %d\n", propertyList->square1->description);
                    printf("num = %d\n", num);
                }
                if (num == originalMonopoly->housesInMonopoly) isMonopoly(originalMonopoly, playerIndex);
                else isNotMonopoly(originalMonopoly);
                break;
        }
    }
}
void isMonopoly(MON * monopoly, int playerIndex) {
    char * sp;
    int i;
    monopoly->owner = playerIndex;
    monopoly->numberOfOwners = monopoly->housesInMonopoly;
    for (i = 0;i < monopoly->housesInMonopoly;i++) monopoly->squares[i]->description->isMonopoly = true;
    monopoly->name = monopoly->uppercaseColor;
}
void isNotMonopoly(MON * monopoly) {
    char * sp;
    int i;
    monopoly->owner = - 1;
    for (i = 0;i < monopoly->housesInMonopoly;i++) monopoly->squares[i]->description->isMonopoly = false;
    monopoly->name = monopoly->lowercaseColor;
}
void printHoldings(void) {
    printHoldings(currentPlayerNumber);
}
void promptAndPrintHoldings(void) {
    int playerIndex;
    while ((playerIndex = getinp("Whose holdings do you want to see? ", playerNames)) < numberOfPlayers) printHoldings(playerIndex);
}
void sigquit(int sig) {
    quit_confirm();
    signal(SIGINT, sigquit);
}
void quit_confirm() {
    putchar('\n');
    if (getYesOrNo("Do you all really want to quit? ") == 0) exit(0);
}
static char sccsid[] = "@(#)misc.c	5.6 (Berkeley) 3/25/93";
int getYesOrNo(char * prompt, void * = 0) {
    int answerIndex;
    while (true) if ((answerIndex = getinp(prompt, yesNoChoices)) < 2) return answerIndex;
    else ( * functions[answerIndex - 2]) ();
}
void notify1(void * = 0) {
    if (currentPlayer->money < 0) printf("That leaves you $%d in debt\n", - currentPlayer->money);
    else if (currentPlayer->money == 0) printf("that leaves you broke\n");
    else if (fixing &&!moneyStatusGiven && currentPlayer->money > 0) {
        printf("-- You are now Solvent ---\n");
        moneyStatusGiven = true;
    }
}
void nextPlayer(void) {
    currentPlayerNumber =++currentPlayerNumber % numberOfPlayers;
    currentPlayer = & players[currentPlayerNumber];
    numberOfDoubles = 0;
}
int getInteger(char * prompt) {
    int num;
    char * sp;
    char buf[257];
    while (true) {
        inter:while (true) {
            printf(prompt);
            num = 0;
            for (sp = buf;( * sp = getchar()) != '\n';sp++) if ( * sp == - 1) continue;
            break;
        }
        if (sp == buf) continue;
        for (sp = buf;isspace( * sp);sp++) continue;
        for (;isdigit( * sp);sp++) num = num * 10 + * sp - '0';
        if ( * sp == '\n') return num;
        else printf("I can't understand that\n");
    }
}
void initializeOwnerList(int playerIndex) {
    int num;
    Monopoly * originalMonopoly;
    OwnedPropertyList * propertyList;
    OwnedPropertyList * original_ownedPropertyList;
    propertyList = players[playerIndex].ownedPropertyList;
    while (propertyList) {
        switch (propertyList->square1->type) {
            case TYPE_UTIL:
                for (num = 0;propertyList && propertyList->square1->type == TYPE_UTIL;propertyList = propertyList->next) num++;
                players[playerIndex].utilitiesCount = num;
                break;
            case TYPE_RAILROAD:
                for (num = 0;propertyList && propertyList->square1->type == TYPE_RAILROAD;propertyList = propertyList->next) {
                    num++;
                }
                players[playerIndex].railroadCardCount = num;
                break;
            case TYPE_PROPERTY:
                originalMonopoly = propertyList->square1->description->monopolyDescription;
                original_ownedPropertyList = propertyList;
                num = 0;
                while (propertyList && propertyList->square1->description->monopolyDescription == originalMonopoly) {
                    num++;
                    propertyList = propertyList->next;
                }
                if (originalMonopoly == 0) {
                    printf("panic:  bad monopoly descriptor: orig = %d\n", originalMonopoly);
                    printf("player # %d\n", playerIndex + 1);
                    printHoldings(playerIndex);
                    printf("orig_op = %d\n", original_ownedPropertyList);
                    printf("orig_op->sqr->type = %d (PRPTY)\n", propertyList->square1->type);
                    printf("orig_op->next = %d\n", propertyList->next);
                    printf("orig_op->sqr->desc = %d\n", propertyList->square1->description);
                    printf("op = %d\n", propertyList);
                    printf("op->sqr->type = %d (PRPTY)\n", propertyList->square1->type);
                    printf("op->next = %d\n", propertyList->next);
                    printf("op->sqr->desc = %d\n", propertyList->square1->description);
                    printf("num = %d\n", num);
                }
                if (num == originalMonopoly->housesInMonopoly) isMonopoly(originalMonopoly, playerIndex);
                else isNotMonopoly(originalMonopoly);
                break;
        }
    }
}
void isMonopoly(Monopoly * monopoly, int playerIndex) {
    char * sp;
    int i;
    monopoly->owner = playerIndex;
    monopoly->numberOfOwners = monopoly->housesInMonopoly;
    for (i = 0;i < monopoly->housesInMonopoly;i++) monopoly->squares[i]->description->isMonopoly = true;
    monopoly->name = monopoly->uppercaseColor;
}
void isNotMonopoly(Monopoly * monopoly) {
    char * sp;
    int i;
    monopoly->owner = - 1;
    for (i = 0;i < monopoly->housesInMonopoly;i++) monopoly->squares[i]->description->isMonopoly = false;
    monopoly->name = monopoly->lowercaseColor;
}
void printHoldings(void) {
    printHoldings(currentPlayerNumber);
}
void promptAndPrintHoldings(void) {
    int playerIndex;
    while ((playerIndex = getinp("Whose holdings do you want to see? ", playerNames)) < numberOfPlayers) printHoldings(playerIndex);
}
void sigquit(int sig) {
    quit_confirm();
    signal(SIGINT, sigquit);
}
void quit_confirm() {
    putchar('\n');
    if (getYesOrNo("Do you all really want to quit? ") == 0) exit(0);
}
static char sccsid[] = "@(#)misc.c	5.6 (Berkeley) 3/25/93";
int getYesOrNo(char * prompt, void * = 0) {
    int answerIndex;
    while (true) if ((answerIndex = getinp(prompt, yesNoChoices)) < 2) return answerIndex;
    else Invoker.invoke(functions[answerIndex - 2]) }
void notify1(void * = 0) {
    if (currentPlayer->money < 0) printf("That leaves you $%d in debt\n", - currentPlayer->money);
    else if (currentPlayer->money == 0) printf("that leaves you broke\n");
    else if (fixing &&!moneyStatusGiven && currentPlayer->money > 0) {
        printf("-- You are now Solvent ---\n");
        moneyStatusGiven = true;
    }
}
void nextPlayer(void) {
    currentPlayerNumber =++currentPlayerNumber % numberOfPlayers;
    currentPlayer = & players[currentPlayerNumber];
    numberOfDoubles = 0;
}
int getInteger(char * prompt) {
    int num;
    char * sp;
    char buf[257];
    while (true) {
        inter:while (true) {
            printf(prompt);
            num = 0;
            for (sp = buf;( * sp = getchar()) != '\n';sp++) if ( * sp == - 1) continue;
            break;
        }
        if (sp == buf) continue;
        for (sp = buf;isspace( * sp);sp++) continue;
        for (;isdigit( * sp);sp++) num = num * 10 + * sp - '0';
        if ( * sp == '\n') return num;
        else printf("I can't understand that\n");
    }
}
void initializeOwnerList(int playerIndex) {
    int num;
    Monopoly * originalMonopoly;
    OwnedPropertyList * propertyList;
    OwnedPropertyList * original_ownedPropertyList;
    propertyList = players[playerIndex].ownedPropertyList;
    while (propertyList) {
        switch (propertyList->square1->type) {
            case TYPE_UTIL:
                for (num = 0;propertyList && propertyList->square1->type == TYPE_UTIL;propertyList = propertyList->next) num++;
                players[playerIndex].utilitiesCount = num;
                break;
            case TYPE_RAILROAD:
                for (num = 0;propertyList && propertyList->square1->type == TYPE_RAILROAD;propertyList = propertyList->next) {
                    num++;
                }
                players[playerIndex].railroadCardCount = num;
                break;
            case TYPE_PROPERTY:
                originalMonopoly = propertyList->square1->description->monopolyDescription;
                original_ownedPropertyList = propertyList;
                num = 0;
                while (propertyList && propertyList->square1->description->monopolyDescription == originalMonopoly) {
                    num++;
                    propertyList = propertyList->next;
                }
                if (originalMonopoly == 0) {
                    printf("panic:  bad monopoly descriptor: orig = %d\n", originalMonopoly);
                    printf("player # %d\n", playerIndex + 1);
                    printHoldings(playerIndex);
                    printf("orig_op = %d\n", original_ownedPropertyList);
                    printf("orig_op->sqr->type = %d (PRPTY)\n", propertyList->square1->type);
                    printf("orig_op->next = %d\n", propertyList->next);
                    printf("orig_op->sqr->desc = %d\n", propertyList->square1->description);
                    printf("op = %d\n", propertyList);
                    printf("op->sqr->type = %d (PRPTY)\n", propertyList->square1->type);
                    printf("op->next = %d\n", propertyList->next);
                    printf("op->sqr->desc = %d\n", propertyList->square1->description);
                    printf("num = %d\n", num);
                }
                if (num == originalMonopoly->housesInMonopoly) isMonopoly(originalMonopoly, playerIndex);
                else isNotMonopoly(originalMonopoly);
                break;
        }
    }
}
void isMonopoly(Monopoly * monopoly, int playerIndex) {
    char * sp;
    int i;
    monopoly->owner = playerIndex;
    monopoly->numberOfOwners = monopoly->housesInMonopoly;
    for (i = 0;i < monopoly->housesInMonopoly;i++) monopoly->squares[i]->description->isMonopoly = true;
    monopoly->name = monopoly->uppercaseColor;
}
void isNotMonopoly(Monopoly * monopoly) {
    char * sp;
    int i;
    monopoly->owner = - 1;
    for (i = 0;i < monopoly->housesInMonopoly;i++) monopoly->squares[i]->description->isMonopoly = false;
    monopoly->name = monopoly->lowercaseColor;
}
public static void printHoldings(void) {
    printHoldings(currentPlayerNumber);
}
public static void promptAndPrintHoldings(void) {
    int playerIndex;
    while ((playerIndex = getinp("Whose holdings do you want to see? ", playerNames)) < numberOfPlayers) printHoldings(playerIndex);
}
void sigquit(int sig) {
    quit_confirm();
    signal(SIGINT, sigquit);
}
public static void quit_confirm() {
    putchar('\n');
    if (getYesOrNo("Do you all really want to quit? ") == 0) exit(0);
}
static char sccsid[] = "@(#)misc.c	5.6 (Berkeley) 3/25/93";
int getYesOrNo(char * prompt, void * = 0) {
    int answerIndex;
    while (true) if ((answerIndex = getinp(prompt, yesNoChoices)) < 2) return answerIndex;
    return else Invoker.invoke(functions[answerIndex - 2]) }
void notify1(void * = 0) {
    if (currentPlayer->money < 0) printf("That leaves you $%d in debt\n", - currentPlayer->money);
    else if (currentPlayer->money == 0) printf("that leaves you broke\n");
    else if (fixing &&!moneyStatusGiven && currentPlayer->money > 0) {
        printf("-- You are now Solvent ---\n");
        moneyStatusGiven = true;
    }
}
void nextPlayer(void) {
    currentPlayerNumber =++currentPlayerNumber % numberOfPlayers;
    currentPlayer = & players[currentPlayerNumber];
    numberOfDoubles = 0;
}
int getInteger(char * prompt) {
    int num;
    char * sp;
    char buf[257];
    while (true) {
        inter:while (true) {
            printf(prompt);
            num = 0;
            for (sp = buf;( * sp = getchar()) != '\n';sp++) if ( * sp == - 1) continue;
            break;
        }
        if (sp == buf) continue;
        for (sp = buf;isspace( * sp);sp++) continue;
        for (;isdigit( * sp);sp++) num = num * 10 + * sp - '0';
        if ( * sp == '\n') return num;
        else printf("I can't understand that\n");
    }
}
void initializeOwnerList(int playerIndex) {
    int num;
    Monopoly * originalMonopoly;
    OwnedPropertyList * propertyList;
    OwnedPropertyList * original_ownedPropertyList;
    propertyList = players[playerIndex].ownedPropertyList;
    while (propertyList) {
        switch (propertyList->square1->type) {
            case TYPE_UTIL:
                for (num = 0;propertyList && propertyList->square1->type == TYPE_UTIL;propertyList = propertyList->next) num++;
                players[playerIndex].utilitiesCount = num;
                break;
            case TYPE_RAILROAD:
                for (num = 0;propertyList && propertyList->square1->type == TYPE_RAILROAD;propertyList = propertyList->next) {
                    num++;
                }
                players[playerIndex].railroadCardCount = num;
                break;
            case TYPE_PROPERTY:
                originalMonopoly = propertyList->square1->description->monopolyDescription;
                original_ownedPropertyList = propertyList;
                num = 0;
                while (propertyList && propertyList->square1->description->monopolyDescription == originalMonopoly) {
                    num++;
                    propertyList = propertyList->next;
                }
                if (originalMonopoly == 0) {
                    printf("panic:  bad monopoly descriptor: orig = %d\n", originalMonopoly);
                    printf("player # %d\n", playerIndex + 1);
                    printHoldings(playerIndex);
                    printf("orig_op = %d\n", original_ownedPropertyList);
                    printf("orig_op->sqr->type = %d (PRPTY)\n", propertyList->square1->type);
                    printf("orig_op->next = %d\n", propertyList->next);
                    printf("orig_op->sqr->desc = %d\n", propertyList->square1->description);
                    printf("op = %d\n", propertyList);
                    printf("op->sqr->type = %d (PRPTY)\n", propertyList->square1->type);
                    printf("op->next = %d\n", propertyList->next);
                    printf("op->sqr->desc = %d\n", propertyList->square1->description);
                    printf("num = %d\n", num);
                }
                if (num == originalMonopoly->housesInMonopoly) isMonopoly(originalMonopoly, playerIndex);
                else isNotMonopoly(originalMonopoly);
                break;
        }
    }
}
void isMonopoly(Monopoly * monopoly, int playerIndex) {
    char * sp;
    int i;
    monopoly->owner = playerIndex;
    monopoly->numberOfOwners = monopoly->housesInMonopoly;
    for (i = 0;i < monopoly->housesInMonopoly;i++) monopoly->squares[i]->description->isMonopoly = true;
    monopoly->name = monopoly->uppercaseColor;
}
void isNotMonopoly(Monopoly * monopoly) {
    char * sp;
    int i;
    monopoly->owner = - 1;
    for (i = 0;i < monopoly->housesInMonopoly;i++) monopoly->squares[i]->description->isMonopoly = false;
    monopoly->name = monopoly->lowercaseColor;
}
public static void printHoldings(void) {
    printHoldings(currentPlayerNumber);
}
public static void promptAndPrintHoldings(void) {
    int playerIndex;
    while ((playerIndex = getinp("Whose holdings do you want to see? ", playerNames)) < numberOfPlayers) printHoldings(playerIndex);
}
void sigquit(int sig) {
    quit_confirm();
    signal(SIGINT, sigquit);
}
public static void quit_confirm() {
    putchar('\n');
    if (getYesOrNo("Do you all really want to quit? ") == 0) exit(0);
}
static char[] sccsid = "@(#)misc.c	5.6 (Berkeley) 3/25/93";
int getYesOrNo(char * prompt, void * = 0) {
    int answerIndex;
    while (true) if ((answerIndex = getinp(prompt, yesNoChoices)) < 2) return answerIndex;
    return else Invoker.invoke(functions[answerIndex - 2]) }
void notify1(void * = 0) {
    if (currentPlayer->money < 0) printf("That leaves you $%d in debt\n", - currentPlayer->money);
    else if (currentPlayer->money == 0) printf("that leaves you broke\n");
    else if (fixing &&!moneyStatusGiven && currentPlayer->money > 0) {
        printf("-- You are now Solvent ---\n");
        moneyStatusGiven = true;
    }
}
void nextPlayer(void) {
    currentPlayerNumber =++currentPlayerNumber % numberOfPlayers;
    currentPlayer = & players[currentPlayerNumber];
    numberOfDoubles = 0;
}
int getInteger(char * prompt) {
    int num;
    char * sp;
    char[257] buf;
    while (true) {
        inter:while (true) {
            printf(prompt);
            num = 0;
            for (sp = buf;( * sp = getchar()) != '\n';sp++) if ( * sp == - 1) continue;
            break;
        }
        if (sp == buf) continue;
        for (sp = buf;isspace( * sp);sp++) continue;
        for (;isdigit( * sp);sp++) num = num * 10 + * sp - '0';
        if ( * sp == '\n') return num;
        else printf("I can't understand that\n");
    }
}
void initializeOwnerList(int playerIndex) {
    int num;
    Monopoly * originalMonopoly;
    OwnedPropertyList * propertyList;
    OwnedPropertyList * original_ownedPropertyList;
    propertyList = players[playerIndex].ownedPropertyList;
    while (propertyList) {
        switch (propertyList->square1->type) {
            case TYPE_UTIL:
                for (num = 0;propertyList && propertyList->square1->type == TYPE_UTIL;propertyList = propertyList->next) num++;
                players[playerIndex].utilitiesCount = num;
                break;
            case TYPE_RAILROAD:
                for (num = 0;propertyList && propertyList->square1->type == TYPE_RAILROAD;propertyList = propertyList->next) {
                    num++;
                }
                players[playerIndex].railroadCardCount = num;
                break;
            case TYPE_PROPERTY:
                originalMonopoly = propertyList->square1->description->monopolyDescription;
                original_ownedPropertyList = propertyList;
                num = 0;
                while (propertyList && propertyList->square1->description->monopolyDescription == originalMonopoly) {
                    num++;
                    propertyList = propertyList->next;
                }
                if (originalMonopoly == 0) {
                    printf("panic:  bad monopoly descriptor: orig = %d\n", originalMonopoly);
                    printf("player # %d\n", playerIndex + 1);
                    printHoldings(playerIndex);
                    printf("orig_op = %d\n", original_ownedPropertyList);
                    printf("orig_op->sqr->type = %d (PRPTY)\n", propertyList->square1->type);
                    printf("orig_op->next = %d\n", propertyList->next);
                    printf("orig_op->sqr->desc = %d\n", propertyList->square1->description);
                    printf("op = %d\n", propertyList);
                    printf("op->sqr->type = %d (PRPTY)\n", propertyList->square1->type);
                    printf("op->next = %d\n", propertyList->next);
                    printf("op->sqr->desc = %d\n", propertyList->square1->description);
                    printf("num = %d\n", num);
                }
                if (num == originalMonopoly->housesInMonopoly) isMonopoly(originalMonopoly, playerIndex);
                else isNotMonopoly(originalMonopoly);
                break;
        }
    }
}
void isMonopoly(Monopoly * monopoly, int playerIndex) {
    char * sp;
    int i;
    monopoly->owner = playerIndex;
    monopoly->numberOfOwners = monopoly->housesInMonopoly;
    for (i = 0;i < monopoly->housesInMonopoly;i++) monopoly->squares[i]->description->isMonopoly = true;
    monopoly->name = monopoly->uppercaseColor;
}
void isNotMonopoly(Monopoly * monopoly) {
    char * sp;
    int i;
    monopoly->owner = - 1;
    for (i = 0;i < monopoly->housesInMonopoly;i++) monopoly->squares[i]->description->isMonopoly = false;
    monopoly->name = monopoly->lowercaseColor;
}
public static void printHoldings(void) {
    printHoldings(currentPlayerNumber);
}
public static void promptAndPrintHoldings(void) {
    int playerIndex;
    while ((playerIndex = getinp("Whose holdings do you want to see? ", playerNames)) < numberOfPlayers) printHoldings(playerIndex);
}
void sigquit(int sig) {
    quit_confirm();
    signal(SIGINT, sigquit);
}
public static void quit_confirm() {
    putchar('\n');
    if (getYesOrNo("Do you all really want to quit? ") == 0) exit(0);
}
static char[] sccsid = "@(#)misc.c	5.6 (Berkeley) 3/25/93";
int getYesOrNo(char * prompt, void * = 0) {
    int answerIndex;
    while (true) {
        if ((answerIndex = getinp(prompt, yesNoChoices)) < 2) {
            return answerIndex;
        }
    }
    return else {
        Invoker.invoke(functions[answerIndex - 2]) }
}
void notify1(void * = 0) {
    if (currentPlayer->money < 0) {
        printf("That leaves you $%d in debt\n", - currentPlayer->money);
    }
    else {
        if (currentPlayer->money == 0) {
            printf("that leaves you broke\n");
        }
        else {
            if (fixing &&!moneyStatusGiven && currentPlayer->money > 0) {
                printf("-- You are now Solvent ---\n");
                moneyStatusGiven = true;
            }
        }
    }
}
void nextPlayer(void) {
    currentPlayerNumber =++currentPlayerNumber % numberOfPlayers;
    currentPlayer = & players[currentPlayerNumber];
    numberOfDoubles = 0;
}
int getInteger(char * prompt) {
    int num;
    char * sp;
    char[257] buf;
    while (true) {
        inter:while (true) {
            printf(prompt);
            num = 0;
            for (sp = buf;( * sp = getchar()) != '\n';sp++) {
                if ( * sp == - 1) {
                    continue;
                }
            }
            break;
        }
        if (sp == buf) {
            continue;
        }
        for (sp = buf;isspace( * sp);sp++) {
            continue;
        }
        for (;isdigit( * sp);sp++) {
            num = num * 10 + * sp - '0';
        }
        if ( * sp == '\n') {
            return num;
        }
        else {
            printf("I can't understand that\n");
        }
    }
}
void initializeOwnerList(int playerIndex) {
    int num;
    Monopoly * originalMonopoly;
    OwnedPropertyList * propertyList;
    OwnedPropertyList * original_ownedPropertyList;
    propertyList = players[playerIndex].ownedPropertyList;
    while (propertyList) {
        switch (propertyList->square1->type) {
            case TYPE_UTIL:
                for (num = 0;propertyList && propertyList->square1->type == TYPE_UTIL;propertyList = propertyList->next) {
                    num++;
                }
                players[playerIndex].utilitiesCount = num;
                break;
            case TYPE_RAILROAD:
                for (num = 0;propertyList && propertyList->square1->type == TYPE_RAILROAD;propertyList = propertyList->next) {
                    num++;
                }
                players[playerIndex].railroadCardCount = num;
                break;
            case TYPE_PROPERTY:
                originalMonopoly = propertyList->square1->description->monopolyDescription;
                original_ownedPropertyList = propertyList;
                num = 0;
                while (propertyList && propertyList->square1->description->monopolyDescription == originalMonopoly) {
                    num++;
                    propertyList = propertyList->next;
                }
                if (originalMonopoly == 0) {
                    printf("panic:  bad monopoly descriptor: orig = %d\n", originalMonopoly);
                    printf("player # %d\n", playerIndex + 1);
                    printHoldings(playerIndex);
                    printf("orig_op = %d\n", original_ownedPropertyList);
                    printf("orig_op->sqr->type = %d (PRPTY)\n", propertyList->square1->type);
                    printf("orig_op->next = %d\n", propertyList->next);
                    printf("orig_op->sqr->desc = %d\n", propertyList->square1->description);
                    printf("op = %d\n", propertyList);
                    printf("op->sqr->type = %d (PRPTY)\n", propertyList->square1->type);
                    printf("op->next = %d\n", propertyList->next);
                    printf("op->sqr->desc = %d\n", propertyList->square1->description);
                    printf("num = %d\n", num);
                }
                if (num == originalMonopoly->housesInMonopoly) {
                    isMonopoly(originalMonopoly, playerIndex);
                }
                else {
                    isNotMonopoly(originalMonopoly);
                }
                break;
        }
    }
}
void isMonopoly(Monopoly * monopoly, int playerIndex) {
    char * sp;
    int i;
    monopoly->owner = playerIndex;
    monopoly->numberOfOwners = monopoly->housesInMonopoly;
    for (i = 0;i < monopoly->housesInMonopoly;i++) {
        monopoly->squares[i]->description->isMonopoly = true;
    }
    monopoly->name = monopoly->uppercaseColor;
}
void isNotMonopoly(Monopoly * monopoly) {
    char * sp;
    int i;
    monopoly->owner = - 1;
    for (i = 0;i < monopoly->housesInMonopoly;i++) {
        monopoly->squares[i]->description->isMonopoly = false;
    }
    monopoly->name = monopoly->lowercaseColor;
}
public static void printHoldings(void) {
    printHoldings(currentPlayerNumber);
}
public static void promptAndPrintHoldings(void) {
    int playerIndex;
    while ((playerIndex = getinp("Whose holdings do you want to see? ", playerNames)) < numberOfPlayers) {
        printHoldings(playerIndex);
    }
}
void sigquit(int sig) {
    quit_confirm();
    signal(SIGINT, sigquit);
}
public static void quit_confirm() {
    putchar('\n');
    if (getYesOrNo("Do you all really want to quit? ") == 0) {
        exit(0);
    }
}
static char[] sccsid = "@(#)misc.c	5.6 (Berkeley) 3/25/93";
int getYesOrNo(char * prompt, void * = 0) {
    int answerIndex;
    while (true) {
        if ((answerIndex = getinp(prompt, yesNoChoices)) < 2) {
            return answerIndex;
        }
    }
    return else {
        Invoker.invoke(functions[answerIndex - 2]) }
}
void notify1(void * = 0) {
    if (currentPlayer->money < 0) {
        printf("That leaves you $%d in debt\n", - currentPlayer->money);
    }
    else {
        if (currentPlayer->money == 0) {
            printf("that leaves you broke\n");
        }
        else {
            if (fixing &&!moneyStatusGiven && currentPlayer->money > 0) {
                printf("-- You are now Solvent ---\n");
                moneyStatusGiven = true;
            }
        }
    }
}
void nextPlayer(void) {
    currentPlayerNumber =++currentPlayerNumber % numberOfPlayers;
    currentPlayer = & players[currentPlayerNumber];
    numberOfDoubles = 0;
}
int getInteger(char * prompt) {
    int num;
    char * sp;
    char[257] buf;
    while (true) {
        while (true) {
            printf(prompt);
            num = 0;
            for (sp = buf;( * sp = getchar()) != '\n';sp++) {
                if ( * sp == - 1) {
                    continue;
                }
            }
            break;
        }
        if (sp == buf) {
            continue;
        }
        for (sp = buf;isspace( * sp);sp++) {
            continue;
        }
        for (;isdigit( * sp);sp++) {
            num = num * 10 + * sp - '0';
        }
        if ( * sp == '\n') {
            return num;
        }
        else {
            printf("I can't understand that\n");
        }
    }
}
void initializeOwnerList(int playerIndex) {
    int num;
    Monopoly * originalMonopoly;
    OwnedPropertyList * propertyList;
    OwnedPropertyList * original_ownedPropertyList;
    propertyList = players[playerIndex].ownedPropertyList;
    while (propertyList) {
        switch (propertyList->square1->type) {
            case TYPE_UTIL:
                for (num = 0;propertyList && propertyList->square1->type == TYPE_UTIL;propertyList = propertyList->next) {
                    num++;
                }
                players[playerIndex].utilitiesCount = num;
                break;
            case TYPE_RAILROAD:
                for (num = 0;propertyList && propertyList->square1->type == TYPE_RAILROAD;propertyList = propertyList->next) {
                    num++;
                }
                players[playerIndex].railroadCardCount = num;
                break;
            case TYPE_PROPERTY:
                originalMonopoly = propertyList->square1->description->monopolyDescription;
                original_ownedPropertyList = propertyList;
                num = 0;
                while (propertyList && propertyList->square1->description->monopolyDescription == originalMonopoly) {
                    num++;
                    propertyList = propertyList->next;
                }
                if (originalMonopoly == 0) {
                    printf("panic:  bad monopoly descriptor: orig = %d\n", originalMonopoly);
                    printf("player # %d\n", playerIndex + 1);
                    printHoldings(playerIndex);
                    printf("orig_op = %d\n", original_ownedPropertyList);
                    printf("orig_op->sqr->type = %d (PRPTY)\n", propertyList->square1->type);
                    printf("orig_op->next = %d\n", propertyList->next);
                    printf("orig_op->sqr->desc = %d\n", propertyList->square1->description);
                    printf("op = %d\n", propertyList);
                    printf("op->sqr->type = %d (PRPTY)\n", propertyList->square1->type);
                    printf("op->next = %d\n", propertyList->next);
                    printf("op->sqr->desc = %d\n", propertyList->square1->description);
                    printf("num = %d\n", num);
                }
                if (num == originalMonopoly->housesInMonopoly) {
                    isMonopoly(originalMonopoly, playerIndex);
                }
                else {
                    isNotMonopoly(originalMonopoly);
                }
                break;
        }
    }
}
void isMonopoly(Monopoly * monopoly, int playerIndex) {
    char * sp;
    int i;
    monopoly->owner = playerIndex;
    monopoly->numberOfOwners = monopoly->housesInMonopoly;
    for (i = 0;i < monopoly->housesInMonopoly;i++) {
        monopoly->squares[i]->description->isMonopoly = true;
    }
    monopoly->name = monopoly->uppercaseColor;
}
void isNotMonopoly(Monopoly * monopoly) {
    char * sp;
    int i;
    monopoly->owner = - 1;
    for (i = 0;i < monopoly->housesInMonopoly;i++) {
        monopoly->squares[i]->description->isMonopoly = false;
    }
    monopoly->name = monopoly->lowercaseColor;
}
public static void printHoldings(void) {
    printHoldings(currentPlayerNumber);
}
public static void promptAndPrintHoldings(void) {
    int playerIndex;
    while ((playerIndex = getinp("Whose holdings do you want to see? ", playerNames)) < numberOfPlayers) {
        printHoldings(playerIndex);
    }
}
void sigquit(int sig) {
    quit_confirm();
    signal(SIGINT, sigquit);
}
public static void quit_confirm() {
    putchar('\n');
    if (getYesOrNo("Do you all really want to quit? ") == 0) {
        exit(0);
    }
}
static char[] sccsid = "@(#)misc.c	5.6 (Berkeley) 3/25/93";
int getYesOrNo(char * prompt) {
    int answerIndex;
    while (true) {
        if ((answerIndex = getinp(prompt, yesNoChoices)) < 2) {
            return answerIndex;
        }
    }
    return else {
        Invoker.invoke(functions[answerIndex - 2]) }
}
void notify1() {
    if (currentPlayer->money < 0) {
        printf("That leaves you $%d in debt\n", - currentPlayer->money);
    }
    else {
        if (currentPlayer->money == 0) {
            printf("that leaves you broke\n");
        }
        else {
            if (fixing &&!moneyStatusGiven && currentPlayer->money > 0) {
                printf("-- You are now Solvent ---\n");
                moneyStatusGiven = true;
            }
        }
    }
}
void nextPlayer(void) {
    currentPlayerNumber =++currentPlayerNumber % numberOfPlayers;
    currentPlayer = & players[currentPlayerNumber];
    numberOfDoubles = 0;
}
int getInteger(char * prompt) {
    int num;
    char * sp;
    char[257] buf;
    while (true) {
        while (true) {
            printf(prompt);
            num = 0;
            for (sp = buf;( * sp = getchar()) != '\n';sp++) {
                if ( * sp == - 1) {
                    continue;
                }
            }
            break;
        }
        if (sp == buf) {
            continue;
        }
        for (sp = buf;isspace( * sp);sp++) {
            continue;
        }
        for (;isdigit( * sp);sp++) {
            num = num * 10 + * sp - '0';
        }
        if ( * sp == '\n') {
            return num;
        }
        else {
            printf("I can't understand that\n");
        }
    }
}
void initializeOwnerList(int playerIndex) {
    int num;
    Monopoly * originalMonopoly;
    OwnedPropertyList * propertyList;
    OwnedPropertyList * original_ownedPropertyList;
    propertyList = players[playerIndex].ownedPropertyList;
    while (propertyList) {
        switch (propertyList->square1->type) {
            case TYPE_UTIL:
                for (num = 0;propertyList && propertyList->square1->type == TYPE_UTIL;propertyList = propertyList->next) {
                    num++;
                }
                players[playerIndex].utilitiesCount = num;
                break;
            case TYPE_RAILROAD:
                for (num = 0;propertyList && propertyList->square1->type == TYPE_RAILROAD;propertyList = propertyList->next) {
                    num++;
                }
                players[playerIndex].railroadCardCount = num;
                break;
            case TYPE_PROPERTY:
                originalMonopoly = propertyList->square1->description->monopolyDescription;
                original_ownedPropertyList = propertyList;
                num = 0;
                while (propertyList && propertyList->square1->description->monopolyDescription == originalMonopoly) {
                    num++;
                    propertyList = propertyList->next;
                }
                if (originalMonopoly == 0) {
                    printf("panic:  bad monopoly descriptor: orig = %d\n", originalMonopoly);
                    printf("player # %d\n", playerIndex + 1);
                    printHoldings(playerIndex);
                    printf("orig_op = %d\n", original_ownedPropertyList);
                    printf("orig_op->sqr->type = %d (PRPTY)\n", propertyList->square1->type);
                    printf("orig_op->next = %d\n", propertyList->next);
                    printf("orig_op->sqr->desc = %d\n", propertyList->square1->description);
                    printf("op = %d\n", propertyList);
                    printf("op->sqr->type = %d (PRPTY)\n", propertyList->square1->type);
                    printf("op->next = %d\n", propertyList->next);
                    printf("op->sqr->desc = %d\n", propertyList->square1->description);
                    printf("num = %d\n", num);
                }
                if (num == originalMonopoly->housesInMonopoly) {
                    isMonopoly(originalMonopoly, playerIndex);
                }
                else {
                    isNotMonopoly(originalMonopoly);
                }
                break;
        }
    }
}
void isMonopoly(Monopoly * monopoly, int playerIndex) {
    char * sp;
    int i;
    monopoly->owner = playerIndex;
    monopoly->numberOfOwners = monopoly->housesInMonopoly;
    for (i = 0;i < monopoly->housesInMonopoly;i++) {
        monopoly->squares[i]->description->isMonopoly = true;
    }
    monopoly->name = monopoly->uppercaseColor;
}
void isNotMonopoly(Monopoly * monopoly) {
    char * sp;
    int i;
    monopoly->owner = - 1;
    for (i = 0;i < monopoly->housesInMonopoly;i++) {
        monopoly->squares[i]->description->isMonopoly = false;
    }
    monopoly->name = monopoly->lowercaseColor;
}
public static void printHoldings(void) {
    printHoldings(currentPlayerNumber);
}
public static void promptAndPrintHoldings(void) {
    int playerIndex;
    while ((playerIndex = getinp("Whose holdings do you want to see? ", playerNames)) < numberOfPlayers) {
        printHoldings(playerIndex);
    }
}
void sigquit(int sig) {
    quit_confirm();
    signal(SIGINT, sigquit);
}
public static void quit_confirm() {
    putchar('\n');
    if (getYesOrNo("Do you all really want to quit? ") == 0) {
        exit(0);
    }
}
static char[] sccsid = "@(#)misc.c	5.6 (Berkeley) 3/25/93";
int getYesOrNo(char * prompt) {
    int answerIndex;
    while (true) {
        if ((answerIndex = getinp(prompt, yesNoChoices)) < 2) {
            return answerIndex;
        }
    }
    return else {
        Invoker.invoke(functions[answerIndex - 2]) }
}
void notify1() {
    if (currentPlayer->money < 0) {
        printf("That leaves you $%d in debt\n", - currentPlayer->money);
    }
    else {
        if (currentPlayer->money == 0) {
            printf("that leaves you broke\n");
        }
        else {
            if (fixing &&!moneyStatusGiven && currentPlayer->money > 0) {
                printf("-- You are now Solvent ---\n");
                moneyStatusGiven = true;
            }
        }
    }
}
void nextPlayer() {
    currentPlayerNumber =++currentPlayerNumber % numberOfPlayers;
    currentPlayer = & players[currentPlayerNumber];
    numberOfDoubles = 0;
}
int getInteger(char * prompt) {
    int num;
    char * sp;
    char[257] buf;
    while (true) {
        while (true) {
            printf(prompt);
            num = 0;
            for (sp = buf;( * sp = getchar()) != '\n';sp++) {
                if ( * sp == - 1) {
                    continue;
                }
            }
            break;
        }
        if (sp == buf) {
            continue;
        }
        for (sp = buf;isspace( * sp);sp++) {
            continue;
        }
        for (;isdigit( * sp);sp++) {
            num = num * 10 + * sp - '0';
        }
        if ( * sp == '\n') {
            return num;
        }
        else {
            printf("I can't understand that\n");
        }
    }
}
void initializeOwnerList(int playerIndex) {
    int num;
    Monopoly * originalMonopoly;
    OwnedPropertyList * propertyList;
    OwnedPropertyList * original_ownedPropertyList;
    propertyList = players[playerIndex].ownedPropertyList;
    while (propertyList) {
        switch (propertyList->square1->type) {
            case TYPE_UTIL:
                for (num = 0;propertyList && propertyList->square1->type == TYPE_UTIL;propertyList = propertyList->next) {
                    num++;
                }
                players[playerIndex].utilitiesCount = num;
                break;
            case TYPE_RAILROAD:
                for (num = 0;propertyList && propertyList->square1->type == TYPE_RAILROAD;propertyList = propertyList->next) {
                    num++;
                }
                players[playerIndex].railroadCardCount = num;
                break;
            case TYPE_PROPERTY:
                originalMonopoly = propertyList->square1->description->monopolyDescription;
                original_ownedPropertyList = propertyList;
                num = 0;
                while (propertyList && propertyList->square1->description->monopolyDescription == originalMonopoly) {
                    num++;
                    propertyList = propertyList->next;
                }
                if (originalMonopoly == 0) {
                    printf("panic:  bad monopoly descriptor: orig = %d\n", originalMonopoly);
                    printf("player # %d\n", playerIndex + 1);
                    printHoldings(playerIndex);
                    printf("orig_op = %d\n", original_ownedPropertyList);
                    printf("orig_op->sqr->type = %d (PRPTY)\n", propertyList->square1->type);
                    printf("orig_op->next = %d\n", propertyList->next);
                    printf("orig_op->sqr->desc = %d\n", propertyList->square1->description);
                    printf("op = %d\n", propertyList);
                    printf("op->sqr->type = %d (PRPTY)\n", propertyList->square1->type);
                    printf("op->next = %d\n", propertyList->next);
                    printf("op->sqr->desc = %d\n", propertyList->square1->description);
                    printf("num = %d\n", num);
                }
                if (num == originalMonopoly->housesInMonopoly) {
                    isMonopoly(originalMonopoly, playerIndex);
                }
                else {
                    isNotMonopoly(originalMonopoly);
                }
                break;
        }
    }
}
void isMonopoly(Monopoly * monopoly, int playerIndex) {
    char * sp;
    int i;
    monopoly->owner = playerIndex;
    monopoly->numberOfOwners = monopoly->housesInMonopoly;
    for (i = 0;i < monopoly->housesInMonopoly;i++) {
        monopoly->squares[i]->description->isMonopoly = true;
    }
    monopoly->name = monopoly->uppercaseColor;
}
void isNotMonopoly(Monopoly * monopoly) {
    char * sp;
    int i;
    monopoly->owner = - 1;
    for (i = 0;i < monopoly->housesInMonopoly;i++) {
        monopoly->squares[i]->description->isMonopoly = false;
    }
    monopoly->name = monopoly->lowercaseColor;
}
public static void printHoldings() {
    printHoldings(currentPlayerNumber);
}
public static void promptAndPrintHoldings() {
    int playerIndex;
    while ((playerIndex = getinp("Whose holdings do you want to see? ", playerNames)) < numberOfPlayers) {
        printHoldings(playerIndex);
    }
}
void sigquit(int sig) {
    quit_confirm();
    signal(SIGINT, sigquit);
}
public static void quit_confirm() {
    putchar('\n');
    if (getYesOrNo("Do you all really want to quit? ") == 0) {
        exit(0);
    }
}
static char[] sccsid = "@(#)misc.c	5.6 (Berkeley) 3/25/93";
int getYesOrNo(char * prompt) {
    int answerIndex;
    while (true) {
        if ((answerIndex = getinp(prompt, yesNoChoices)) < 2) {
            return answerIndex;
        }
    }
    return else {
        Invoker.invoke(functions[answerIndex - 2]) }
}
void notify1() {
    if (currentPlayer->money < 0) {
        printf("That leaves you $%d in debt\n", - currentPlayer->money);
    }
    else {
        if (currentPlayer->money == 0) {
            printf("that leaves you broke\n");
        }
        else {
            if (fixing &&!moneyStatusGiven && currentPlayer->money > 0) {
                printf("-- You are now Solvent ---\n");
                moneyStatusGiven = true;
            }
        }
    }
}
void nextPlayer() {
    currentPlayerNumber =++currentPlayerNumber % numberOfPlayers;
    currentPlayer = & players[currentPlayerNumber];
    numberOfDoubles = 0;
}
int getInteger(char * prompt) {
    int num;
    char * sp;
    char[257] buf1;
    while (true) {
        while (true) {
            printf(prompt);
            num = 0;
            for (sp = buf1;( * sp = getchar()) != '\n';sp++) {
                if ( * sp == - 1) {
                    continue;
                }
            }
            break;
        }
        if (sp == buf1) {
            continue;
        }
        for (sp = buf1;isspace( * sp);sp++) {
            continue;
        }
        for (;isdigit( * sp);sp++) {
            num = num * 10 + * sp - '0';
        }
        if ( * sp == '\n') {
            return num;
        }
        else {
            printf("I can't understand that\n");
        }
    }
}
void initializeOwnerList(int playerIndex) {
    int num;
    Monopoly * originalMonopoly;
    OwnedPropertyList * propertyList4;
    OwnedPropertyList * original_ownedPropertyList;
    propertyList4 = players[playerIndex].ownedPropertyList;
    while (propertyList4) {
        switch (propertyList4->square1->type) {
            case TYPE_UTIL:
                for (num = 0;propertyList4 && propertyList4->square1->type == TYPE_UTIL;propertyList4 = propertyList4->next) {
                    num++;
                }
                players[playerIndex].utilitiesCount = num;
                break;
            case TYPE_RAILROAD:
                for (num = 0;propertyList4 && propertyList4->square1->type == TYPE_RAILROAD;propertyList4 = propertyList4->next) {
                    num++;
                }
                players[playerIndex].railroadCardCount = num;
                break;
            case TYPE_PROPERTY:
                originalMonopoly = propertyList4->square1->description->monopolyDescription;
                original_ownedPropertyList = propertyList4;
                num = 0;
                while (propertyList4 && propertyList4->square1->description->monopolyDescription == originalMonopoly) {
                    num++;
                    propertyList4 = propertyList4->next;
                }
                if (originalMonopoly == 0) {
                    printf("panic:  bad monopoly descriptor: orig = %d\n", originalMonopoly);
                    printf("player # %d\n", playerIndex + 1);
                    printHoldings(playerIndex);
                    printf("orig_op = %d\n", original_ownedPropertyList);
                    printf("orig_op->sqr->type = %d (PRPTY)\n", propertyList4->square1->type);
                    printf("orig_op->next = %d\n", propertyList4->next);
                    printf("orig_op->sqr->desc = %d\n", propertyList4->square1->description);
                    printf("op = %d\n", propertyList4);
                    printf("op->sqr->type = %d (PRPTY)\n", propertyList4->square1->type);
                    printf("op->next = %d\n", propertyList4->next);
                    printf("op->sqr->desc = %d\n", propertyList4->square1->description);
                    printf("num = %d\n", num);
                }
                if (num == originalMonopoly->housesInMonopoly) {
                    isMonopoly(originalMonopoly, playerIndex);
                }
                else {
                    isNotMonopoly(originalMonopoly);
                }
                break;
        }
    }
}
void isMonopoly(Monopoly * monopoly, int playerIndex) {
    char * sp;
    int i;
    monopoly->owner = playerIndex;
    monopoly->numberOfOwners = monopoly->housesInMonopoly;
    for (i = 0;i < monopoly->housesInMonopoly;i++) {
        monopoly->squares[i]->description->isMonopoly = true;
    }
    monopoly->name = monopoly->uppercaseColor;
}
void isNotMonopoly(Monopoly * monopoly) {
    char * sp;
    int i;
    monopoly->owner = - 1;
    for (i = 0;i < monopoly->housesInMonopoly;i++) {
        monopoly->squares[i]->description->isMonopoly = false;
    }
    monopoly->name = monopoly->lowercaseColor;
}
public static void printHoldings() {
    printHoldings(currentPlayerNumber);
}
public static void promptAndPrintHoldings() {
    int playerIndex;
    while ((playerIndex = getinp("Whose holdings do you want to see? ", playerNames)) < numberOfPlayers) {
        printHoldings(playerIndex);
    }
}
void sigquit(int sig) {
    quit_confirm();
    signal(SIGINT, sigquit);
}
public static void quit_confirm() {
    putchar('\n');
    if (getYesOrNo("Do you all really want to quit? ") == 0) {
        exit(0);
    }
}
static char[] sccsid = "@(#)misc.c	5.6 (Berkeley) 3/25/93";
int getYesOrNo(char * prompt) {
    int answerIndex;
    while (true) {
        if ((answerIndex = getinp(prompt, Monop.yesNoChoices)) < 2) {
            return answerIndex;
        }
    }
    return else {
        Invoker.invoke(Monop.functions[answerIndex - 2]) }
}
void notify1() {
    if (Monop.currentPlayer->money < 0) {
        printf("That leaves you $%d in debt\n", - Monop.currentPlayer->money);
    }
    else {
        if (Monop.currentPlayer->money == 0) {
            printf("that leaves you broke\n");
        }
        else {
            if (Monop.fixing &&!Monop.moneyStatusGiven && Monop.currentPlayer->money > 0) {
                printf("-- You are now Solvent ---\n");
                Monop.moneyStatusGiven = true;
            }
        }
    }
}
void nextPlayer() {
    Monop.currentPlayerNumber =++Monop.currentPlayerNumber % Monop.numberOfPlayers;
    Monop.currentPlayer = & Monop.players[Monop.currentPlayerNumber];
    Monop.numberOfDoubles = 0;
}
int getInteger(char * prompt) {
    int num;
    char * sp;
    char[257] buf1;
    while (true) {
        while (true) {
            printf(prompt);
            num = 0;
            for (sp = buf1;( * sp = getchar()) != '\n';sp++) {
                if ( * sp == - 1) {
                    continue;
                }
            }
            break;
        }
        if (sp == buf1) {
            continue;
        }
        for (sp = buf1;isspace( * sp);sp++) {
            continue;
        }
        for (;isdigit( * sp);sp++) {
            num = num * 10 + * sp - '0';
        }
        if ( * sp == '\n') {
            return num;
        }
        else {
            printf("I can't understand that\n");
        }
    }
}
void initializeOwnerList(int playerIndex) {
    int num;
    Monopoly * originalMonopoly;
    OwnedPropertyList * propertyList4;
    OwnedPropertyList * original_ownedPropertyList;
    propertyList4 = Monop.players[playerIndex].ownedPropertyList;
    while (propertyList4) {
        switch (propertyList4->square1->type) {
            case TYPE_UTIL:
                for (num = 0;propertyList4 && propertyList4->square1->type == TYPE_UTIL;propertyList4 = propertyList4->next) {
                    num++;
                }
                Monop.players[playerIndex].utilitiesCount = num;
                break;
            case TYPE_RAILROAD:
                for (num = 0;propertyList4 && propertyList4->square1->type == TYPE_RAILROAD;propertyList4 = propertyList4->next) {
                    num++;
                }
                Monop.players[playerIndex].railroadCardCount = num;
                break;
            case TYPE_PROPERTY:
                originalMonopoly = propertyList4->square1->description->monopolyDescription;
                original_ownedPropertyList = propertyList4;
                num = 0;
                while (propertyList4 && propertyList4->square1->description->monopolyDescription == originalMonopoly) {
                    num++;
                    propertyList4 = propertyList4->next;
                }
                if (originalMonopoly == 0) {
                    printf("panic:  bad monopoly descriptor: orig = %d\n", originalMonopoly);
                    printf("player # %d\n", playerIndex + 1);
                    printHoldings(playerIndex);
                    printf("orig_op = %d\n", original_ownedPropertyList);
                    printf("orig_op->sqr->type = %d (PRPTY)\n", propertyList4->square1->type);
                    printf("orig_op->next = %d\n", propertyList4->next);
                    printf("orig_op->sqr->desc = %d\n", propertyList4->square1->description);
                    printf("op = %d\n", propertyList4);
                    printf("op->sqr->type = %d (PRPTY)\n", propertyList4->square1->type);
                    printf("op->next = %d\n", propertyList4->next);
                    printf("op->sqr->desc = %d\n", propertyList4->square1->description);
                    printf("num = %d\n", num);
                }
                if (num == originalMonopoly->housesInMonopoly) {
                    isMonopoly(originalMonopoly, playerIndex);
                }
                else {
                    isNotMonopoly(originalMonopoly);
                }
                break;
        }
    }
}
void isMonopoly(Monopoly * monopoly, int playerIndex) {
    char * sp;
    int i;
    monopoly->owner = playerIndex;
    monopoly->numberOfOwners = monopoly->housesInMonopoly;
    for (i = 0;i < monopoly->housesInMonopoly;i++) {
        monopoly->squares[i]->description->isMonopoly = true;
    }
    monopoly->name = monopoly->uppercaseColor;
}
void isNotMonopoly(Monopoly * monopoly) {
    char * sp;
    int i;
    monopoly->owner = - 1;
    for (i = 0;i < monopoly->housesInMonopoly;i++) {
        monopoly->squares[i]->description->isMonopoly = false;
    }
    monopoly->name = monopoly->lowercaseColor;
}
public static void printHoldings() {
    printHoldings(Monop.currentPlayerNumber);
}
public static void promptAndPrintHoldings() {
    int playerIndex;
    while ((playerIndex = getinp("Whose holdings do you want to see? ", Monop.playerNames)) < Monop.numberOfPlayers) {
        printHoldings(playerIndex);
    }
}
void sigquit(int sig) {
    quit_confirm();
    signal(SIGINT, sigquit);
}
public static void quit_confirm() {
    putchar('\n');
    if (getYesOrNo("Do you all really want to quit? ") == 0) {
        exit(0);
    }
}
static char[] sccsid = "@(#)misc.c	5.6 (Berkeley) 3/25/93";
static int getYesOrNo(char * prompt) {
    int answerIndex;
    while (true) {
        if ((answerIndex = GetInput.getinp(prompt, Monop.yesNoChoices)) < 2) {
            return answerIndex;
        }
    }
    return else {
        Invoker.invoke(Monop.functions[answerIndex - 2]) }
}
static void notify1() {
    if (Monop.currentPlayer->money < 0) {
        printf("That leaves you $%d in debt\n", - Monop.currentPlayer->money);
    }
    else {
        if (Monop.currentPlayer->money == 0) {
            printf("that leaves you broke\n");
        }
        else {
            if (Monop.fixing &&!Monop.moneyStatusGiven && Monop.currentPlayer->money > 0) {
                printf("-- You are now Solvent ---\n");
                Monop.moneyStatusGiven = true;
            }
        }
    }
}
static void nextPlayer() {
    Monop.currentPlayerNumber =++Monop.currentPlayerNumber % Monop.numberOfPlayers;
    Monop.currentPlayer = & Monop.players[Monop.currentPlayerNumber];
    Monop.numberOfDoubles = 0;
}
static int getInteger(char * prompt) {
    int num;
    char * sp;
    char[257] buf1;
    while (true) {
        while (true) {
            printf(prompt);
            num = 0;
            for (sp = buf1;( * sp = getchar()) != '\n';sp++) {
                if ( * sp == - 1) {
                    continue;
                }
            }
            break;
        }
        if (sp == buf1) {
            continue;
        }
        for (sp = buf1;isspace( * sp);sp++) {
            continue;
        }
        for (;isdigit( * sp);sp++) {
            num = num * 10 + * sp - '0';
        }
        if ( * sp == '\n') {
            return num;
        }
        else {
            printf("I can't understand that\n");
        }
    }
}
static void initializeOwnerList(int playerIndex) {
    int num;
    Monopoly * originalMonopoly;
    OwnedPropertyList * propertyList4;
    OwnedPropertyList * original_ownedPropertyList;
    propertyList4 = Monop.players[playerIndex].ownedPropertyList;
    while (propertyList4) {
        switch (propertyList4->square1->type) {
            case TYPE_UTIL:
                for (num = 0;propertyList4 && propertyList4->square1->type == TYPE_UTIL;propertyList4 = propertyList4->next) {
                    num++;
                }
                Monop.players[playerIndex].utilitiesCount = num;
                break;
            case TYPE_RAILROAD:
                for (num = 0;propertyList4 && propertyList4->square1->type == TYPE_RAILROAD;propertyList4 = propertyList4->next) {
                    num++;
                }
                Monop.players[playerIndex].railroadCardCount = num;
                break;
            case TYPE_PROPERTY:
                originalMonopoly = propertyList4->square1->description->monopolyDescription;
                original_ownedPropertyList = propertyList4;
                num = 0;
                while (propertyList4 && propertyList4->square1->description->monopolyDescription == originalMonopoly) {
                    num++;
                    propertyList4 = propertyList4->next;
                }
                if (originalMonopoly == 0) {
                    printf("panic:  bad monopoly descriptor: orig = %d\n", originalMonopoly);
                    printf("player # %d\n", playerIndex + 1);
                    Print.printHoldings(playerIndex);
                    printf("orig_op = %d\n", original_ownedPropertyList);
                    printf("orig_op->sqr->type = %d (PRPTY)\n", propertyList4->square1->type);
                    printf("orig_op->next = %d\n", propertyList4->next);
                    printf("orig_op->sqr->desc = %d\n", propertyList4->square1->description);
                    printf("op = %d\n", propertyList4);
                    printf("op->sqr->type = %d (PRPTY)\n", propertyList4->square1->type);
                    printf("op->next = %d\n", propertyList4->next);
                    printf("op->sqr->desc = %d\n", propertyList4->square1->description);
                    printf("num = %d\n", num);
                }
                if (num == originalMonopoly->housesInMonopoly) {
                    isMonopoly(originalMonopoly, playerIndex);
                }
                else {
                    isNotMonopoly(originalMonopoly);
                }
                break;
        }
    }
}
void isMonopoly(Monopoly * monopoly, int playerIndex) {
    char * sp;
    int i;
    monopoly->owner = playerIndex;
    monopoly->numberOfOwners = monopoly->housesInMonopoly;
    for (i = 0;i < monopoly->housesInMonopoly;i++) {
        monopoly->squares[i]->description->isMonopoly = true;
    }
    monopoly->name = monopoly->uppercaseColor;
}
static void isNotMonopoly(Monopoly * monopoly) {
    char * sp;
    int i;
    monopoly->owner = - 1;
    for (i = 0;i < monopoly->housesInMonopoly;i++) {
        monopoly->squares[i]->description->isMonopoly = false;
    }
    monopoly->name = monopoly->lowercaseColor;
}
public static void printHoldings() {
    Print.printHoldings(Monop.currentPlayerNumber);
}
public static void promptAndPrintHoldings() {
    int playerIndex;
    while ((playerIndex = GetInput.getinp("Whose holdings do you want to see? ", Monop.playerNames)) < Monop.numberOfPlayers) {
        Print.printHoldings(playerIndex);
    }
}
void sigquit(int sig) {
    quit_confirm();
    signal(SIGINT, sigquit);
}
public static void quit_confirm() {
    putchar('\n');
    if (getYesOrNo("Do you all really want to quit? ") == 0) {
        exit(0);
    }
}
static char[] sccsid = "@(#)misc.c	5.6 (Berkeley) 3/25/93";
static int getYesOrNo(char * prompt) {
    int answerIndex;
    while (true) {
        if ((answerIndex = GetInput.getinp(prompt, Monop.yesNoChoices)) < 2) {
            return answerIndex;
        }
    }
    return else {
        Invoker.invoke(Monop.functions[answerIndex - 2]) }
}
static void notify1() {
    if (Monop.currentPlayer->money < 0) {
        printf("That leaves you $%d in debt\n", - Monop.currentPlayer->money);
    }
    else {
        if (Monop.currentPlayer->money == 0) {
            printf("that leaves you broke\n");
        }
        else {
            if (Monop.fixing &&!Monop.moneyStatusGiven && Monop.currentPlayer->money > 0) {
                printf("-- You are now Solvent ---\n");
                Monop.moneyStatusGiven = true;
            }
        }
    }
}
static void nextPlayer() {
    Monop.currentPlayerNumber =++Monop.currentPlayerNumber % Monop.numberOfPlayers;
    Monop.currentPlayer = & Monop.players[Monop.currentPlayerNumber];
    Monop.numberOfDoubles = 0;
}
static int getInteger(char * prompt) {
    int num;
    char * sp;
    char[257] buf1;
    while (true) {
        while (true) {
            printf(prompt);
            num = 0;
            for (sp = buf1;( * sp = getchar()) != '\n';sp++) {
                if ( * sp == - 1) {
                    continue;
                }
            }
            break;
        }
        if (sp == buf1) {
            continue;
        }
        for (sp = buf1;isspace( * sp);sp++) {
            continue;
        }
        for (;isdigit( * sp);sp++) {
            num *= 10 + * sp - '0';
        }
        if ( * sp == '\n') {
            return num;
        }
        else {
            printf("I can't understand that\n");
        }
    }
}
static void initializeOwnerList(int playerIndex) {
    int num;
    Monopoly * originalMonopoly;
    OwnedPropertyList * propertyList4;
    OwnedPropertyList * original_ownedPropertyList;
    propertyList4 = Monop.players[playerIndex].ownedPropertyList;
    while (propertyList4) {
        switch (propertyList4->square1->type) {
            case TYPE_UTIL:
                for (num = 0;propertyList4 && propertyList4->square1->type == TYPE_UTIL;propertyList4 = propertyList4->next) {
                    num++;
                }
                Monop.players[playerIndex].utilitiesCount = num;
                break;
            case TYPE_RAILROAD:
                for (num = 0;propertyList4 && propertyList4->square1->type == TYPE_RAILROAD;propertyList4 = propertyList4->next) {
                    num++;
                }
                Monop.players[playerIndex].railroadCardCount = num;
                break;
            case TYPE_PROPERTY:
                originalMonopoly = propertyList4->square1->description->monopolyDescription;
                original_ownedPropertyList = propertyList4;
                num = 0;
                while (propertyList4 && propertyList4->square1->description->monopolyDescription == originalMonopoly) {
                    num++;
                    propertyList4 = propertyList4->next;
                }
                if (originalMonopoly == 0) {
                    printf("panic:  bad monopoly descriptor: orig = %d\n", originalMonopoly);
                    printf("player # %d\n", playerIndex + 1);
                    Print.printHoldings(playerIndex);
                    printf("orig_op = %d\n", original_ownedPropertyList);
                    printf("orig_op->sqr->type = %d (PRPTY)\n", propertyList4->square1->type);
                    printf("orig_op->next = %d\n", propertyList4->next);
                    printf("orig_op->sqr->desc = %d\n", propertyList4->square1->description);
                    printf("op = %d\n", propertyList4);
                    printf("op->sqr->type = %d (PRPTY)\n", propertyList4->square1->type);
                    printf("op->next = %d\n", propertyList4->next);
                    printf("op->sqr->desc = %d\n", propertyList4->square1->description);
                    printf("num = %d\n", num);
                }
                if (num == originalMonopoly->housesInMonopoly) {
                    isMonopoly(originalMonopoly, playerIndex);
                }
                else {
                    isNotMonopoly(originalMonopoly);
                }
                break;
        }
    }
}
void isMonopoly(Monopoly * monopoly, int playerIndex) {
    char * sp;
    int i;
    monopoly->owner = playerIndex;
    monopoly->numberOfOwners = monopoly->housesInMonopoly;
    for (i = 0;i < monopoly->housesInMonopoly;i++) {
        monopoly->squares[i]->description->isMonopoly = true;
    }
    monopoly->name = monopoly->uppercaseColor;
}
static void isNotMonopoly(Monopoly * monopoly) {
    char * sp;
    int i;
    monopoly->owner = - 1;
    for (i = 0;i < monopoly->housesInMonopoly;i++) {
        monopoly->squares[i]->description->isMonopoly = false;
    }
    monopoly->name = monopoly->lowercaseColor;
}
public static void printHoldings() {
    Print.printHoldings(Monop.currentPlayerNumber);
}
public static void promptAndPrintHoldings() {
    int playerIndex;
    while ((playerIndex = GetInput.getinp("Whose holdings do you want to see? ", Monop.playerNames)) < Monop.numberOfPlayers) {
        Print.printHoldings(playerIndex);
    }
}
void sigquit(int sig) {
    quit_confirm();
    signal(SIGINT, sigquit);
}
public static void quit_confirm() {
    putchar('\n');
    if (getYesOrNo("Do you all really want to quit? ") == 0) {
        exit(0);
    }
}
static char[] sccsid = "@(#)misc.c	5.6 (Berkeley) 3/25/93";
static int getYesOrNo(char * prompt) {
    int answerIndex;
    while (true) {
        answerIndex = GetInput.getinp(prompt, Monop.yesNoChoices);
        if (answerIndex < 2) {
            return answerIndex;
        }
    }
    return else {
        Invoker.invoke(Monop.functions[answerIndex - 2]) }
}
static void notify1() {
    if (Monop.currentPlayer->money < 0) {
        printf("That leaves you $%d in debt\n", - Monop.currentPlayer->money);
    }
    else {
        if (Monop.currentPlayer->money == 0) {
            printf("that leaves you broke\n");
        }
        else {
            if (Monop.fixing &&!Monop.moneyStatusGiven && Monop.currentPlayer->money > 0) {
                printf("-- You are now Solvent ---\n");
                Monop.moneyStatusGiven = true;
            }
        }
    }
}
static void nextPlayer() {
    Monop.currentPlayerNumber =++Monop.currentPlayerNumber % Monop.numberOfPlayers;
    Monop.currentPlayer = & Monop.players[Monop.currentPlayerNumber];
    Monop.numberOfDoubles = 0;
}
static int getInteger(char * prompt) {
    int num;
    char * sp;
    char[257] buf1;
    while (true) {
        while (true) {
            printf(prompt);
            num = 0;
            for (sp = buf1;( * sp = getchar()) != '\n';sp++) {
                if ( * sp == - 1) {
                    continue;
                }
            }
            break;
        }
        if (sp == buf1) {
            continue;
        }
        for (sp = buf1;isspace( * sp);sp++) {
            continue;
        }
        for (;isdigit( * sp);sp++) {
            num *= 10 + * sp - '0';
        }
        if ( * sp == '\n') {
            return num;
        }
        else {
            printf("I can't understand that\n");
        }
    }
}
static void initializeOwnerList(int playerIndex) {
    int num;
    Monopoly * originalMonopoly;
    OwnedPropertyList * propertyList4;
    OwnedPropertyList * original_ownedPropertyList;
    propertyList4 = Monop.players[playerIndex].ownedPropertyList;
    while (propertyList4) {
        switch (propertyList4->square1->type) {
            case TYPE_UTIL:
                for (num = 0;propertyList4 && propertyList4->square1->type == TYPE_UTIL;propertyList4 = propertyList4->next) {
                    num++;
                }
                Monop.players[playerIndex].utilitiesCount = num;
                break;
            case TYPE_RAILROAD:
                for (num = 0;propertyList4 && propertyList4->square1->type == TYPE_RAILROAD;propertyList4 = propertyList4->next) {
                    num++;
                }
                Monop.players[playerIndex].railroadCardCount = num;
                break;
            case TYPE_PROPERTY:
                originalMonopoly = propertyList4->square1->description->monopolyDescription;
                original_ownedPropertyList = propertyList4;
                num = 0;
                while (propertyList4 && propertyList4->square1->description->monopolyDescription == originalMonopoly) {
                    num++;
                    propertyList4 = propertyList4->next;
                }
                if (originalMonopoly == 0) {
                    printf("panic:  bad monopoly descriptor: orig = %d\n", originalMonopoly);
                    printf("player # %d\n", playerIndex + 1);
                    Print.printHoldings(playerIndex);
                    printf("orig_op = %d\n", original_ownedPropertyList);
                    printf("orig_op->sqr->type = %d (PRPTY)\n", propertyList4->square1->type);
                    printf("orig_op->next = %d\n", propertyList4->next);
                    printf("orig_op->sqr->desc = %d\n", propertyList4->square1->description);
                    printf("op = %d\n", propertyList4);
                    printf("op->sqr->type = %d (PRPTY)\n", propertyList4->square1->type);
                    printf("op->next = %d\n", propertyList4->next);
                    printf("op->sqr->desc = %d\n", propertyList4->square1->description);
                    printf("num = %d\n", num);
                }
                if (num == originalMonopoly->housesInMonopoly) {
                    isMonopoly(originalMonopoly, playerIndex);
                }
                else {
                    isNotMonopoly(originalMonopoly);
                }
                break;
        }
    }
}
void isMonopoly(Monopoly * monopoly, int playerIndex) {
    char * sp;
    int i;
    monopoly->owner = playerIndex;
    monopoly->numberOfOwners = monopoly->housesInMonopoly;
    for (i = 0;i < monopoly->housesInMonopoly;i++) {
        monopoly->squares[i]->description->isMonopoly = true;
    }
    monopoly->name = monopoly->uppercaseColor;
}
static void isNotMonopoly(Monopoly * monopoly) {
    char * sp;
    int i;
    monopoly->owner = - 1;
    for (i = 0;i < monopoly->housesInMonopoly;i++) {
        monopoly->squares[i]->description->isMonopoly = false;
    }
    monopoly->name = monopoly->lowercaseColor;
}
public static void printHoldings() {
    Print.printHoldings(Monop.currentPlayerNumber);
}
public static void promptAndPrintHoldings() {
    int playerIndex;
    while ((playerIndex = GetInput.getinp("Whose holdings do you want to see? ", Monop.playerNames)) < Monop.numberOfPlayers) {
        Print.printHoldings(playerIndex);
    }
}
void sigquit(int sig) {
    quit_confirm();
    signal(SIGINT, sigquit);
}
public static void quit_confirm() {
    putchar('\n');
    if (getYesOrNo("Do you all really want to quit? ") == 0) {
        exit(0);
    }
}
static char[] sccsid = "@(#)misc.c	5.6 (Berkeley) 3/25/93";
static int getYesOrNo(char * prompt) {
    int answerIndex;
    while (true) {
        answerIndex = GetInput.getinp(prompt, Monop.yesNoChoices);
        if (answerIndex < 2) {
            return answerIndex;
        }
    }
    return else {
        Invoker.invoke(Monop.functions[answerIndex - 2]) }
}
static void notify1() {
    if (Monop.currentPlayer->money < 0) {
        printf("That leaves you $%d in debt\n", - Monop.currentPlayer->money);
    }
    else {
        if (Monop.currentPlayer->money == 0) {
            printf("that leaves you broke\n");
        }
        else {
            if (Monop.fixing &&!Monop.moneyStatusGiven && Monop.currentPlayer->money > 0) {
                printf("-- You are now Solvent ---\n");
                Monop.moneyStatusGiven = true;
            }
        }
    }
}
static void nextPlayer() {
    Monop.currentPlayerNumber =++Monop.currentPlayerNumber % Monop.numberOfPlayers;
    Monop.currentPlayer = & Monop.players[Monop.currentPlayerNumber];
    Monop.numberOfDoubles = 0;
}
static int getInteger(char * prompt) {
    int num;
    char * sp;
    char[257] buf1;
    while (true) {
        while (true) {
            printf(prompt);
            num = 0;
            buf1 = stdin.readLine();
            break;
        }
        if (sp == buf1) {
            continue;
        }
        for (sp = buf1;isspace( * sp);sp++) {
            continue;
        }
        for (;isdigit( * sp);sp++) {
            num *= 10 + * sp - '0';
        }
        if ( * sp == '\n') {
            return num;
        }
        else {
            printf("I can't understand that\n");
        }
    }
}
static void initializeOwnerList(int playerIndex) {
    int num;
    Monopoly * originalMonopoly;
    OwnedPropertyList * propertyList4;
    OwnedPropertyList * original_ownedPropertyList;
    propertyList4 = Monop.players[playerIndex].ownedPropertyList;
    while (propertyList4) {
        switch (propertyList4->square1->type) {
            case TYPE_UTIL:
                for (num = 0;propertyList4 && propertyList4->square1->type == TYPE_UTIL;propertyList4 = propertyList4->next) {
                    num++;
                }
                Monop.players[playerIndex].utilitiesCount = num;
                break;
            case TYPE_RAILROAD:
                for (num = 0;propertyList4 && propertyList4->square1->type == TYPE_RAILROAD;propertyList4 = propertyList4->next) {
                    num++;
                }
                Monop.players[playerIndex].railroadCardCount = num;
                break;
            case TYPE_PROPERTY:
                originalMonopoly = propertyList4->square1->description->monopolyDescription;
                original_ownedPropertyList = propertyList4;
                num = 0;
                while (propertyList4 && propertyList4->square1->description->monopolyDescription == originalMonopoly) {
                    num++;
                    propertyList4 = propertyList4->next;
                }
                if (originalMonopoly == 0) {
                    printf("panic:  bad monopoly descriptor: orig = %d\n", originalMonopoly);
                    printf("player # %d\n", playerIndex + 1);
                    Print.printHoldings(playerIndex);
                    printf("orig_op = %d\n", original_ownedPropertyList);
                    printf("orig_op->sqr->type = %d (PRPTY)\n", propertyList4->square1->type);
                    printf("orig_op->next = %d\n", propertyList4->next);
                    printf("orig_op->sqr->desc = %d\n", propertyList4->square1->description);
                    printf("op = %d\n", propertyList4);
                    printf("op->sqr->type = %d (PRPTY)\n", propertyList4->square1->type);
                    printf("op->next = %d\n", propertyList4->next);
                    printf("op->sqr->desc = %d\n", propertyList4->square1->description);
                    printf("num = %d\n", num);
                }
                if (num == origin