| Rules Applied | JavaKeywordRule | app0.txt | PPspaceRule | PPifndefRule | PPRule | PPdefineRule.DefineReplacementRule | snippets0b.txt | TypedefRule.DefineReplacementRule | ArrayDeclaration0Rule | AddBracesRule | ConflictingVariableDeclarationRule | StaticVariablesRule | StaticFunctionsRule | ArrayDeclarationRule | StringRule | DeclarationAssignmentRule | PointerRule | snippets2.txt | snippets3.txt | ElseIfRule | PrintfRule | UninitializedVariableRule | InsertClassRule | (Final Version) | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| JavaKeywordRule app0.txt PPspaceRule PPifndefRule PPRule PPdefineRule.DefineReplacementRule snippets0b.txt TypedefRule.DefineReplacementRule ArrayDeclaration0Rule AddBracesRule ConflictingVariableDeclarationRule StaticVariablesRule StaticFunctionsRule ArrayDeclarationRule StringRule DeclarationAssignmentRule PointerRule snippets2.txt snippets3.txt ElseIfRule PrintfRule UninitializedVariableRule InsertClassRule final | #ifndef lint
static char sccsid[] = "@(#)rent.c 5.3 (Berkeley) 6/1/90";
#endif
# include "monop.ext"
void rent(register SQUARE * sqp) {
regint rnt;
reg PROP * pp;
PLAY * plp;
plp = & play[sqp->owner];
printf("Owned by %s\n", plp->name);
if (sqp->desc->morg) {
lucky("The thing is mortgaged. ");
return;
}
switch (sqp->type) {
case PRPTY:
pp = sqp->desc;
if (pp->monop) if (pp->houses == 0) printf("rent is %d\n", rnt = pp->rent[0] * 2);
else if (pp->houses < 5) printf("with %d houses, rent is %d\n", pp->houses, rnt = pp->rent[pp->houses]);
else printf("with a hotel, rent is %d\n", rnt = pp->rent[pp->houses]);
else printf("rent is %d\n", rnt = pp->rent[0]);
break;
case RR:
rnt = 25;
rnt <<= (plp->num_rr - 1);
if (spec) rnt <<= 1;
printf("rent is %d\n", rnt);
break;
case UTIL:
rnt = roll(2, 6);
if (plp->num_util == 2 || spec) {
printf("rent is 10 * roll (%d) = %d\n", rnt, rnt * 10);
rnt *= 10;
}
else {
printf("rent is 4 * roll (%d) = %d\n", rnt, rnt * 4);
rnt *= 4;
}
break;
}
cur_p->money -= rnt;
plp->money += rnt;
}
| #ifndef lint
static char sccsid[] = "@(#)rent.c 5.3 (Berkeley) 6/1/90";
#endif
# include "monop.ext"
void rent(register SQUARE * square) {
regint rentAmount;
reg PROP * property;
PLAY * player;
player = & players[square->owner];
printf("Owned by %s\n", player->name);
if (square->description->isMortgaged) {
printLuckyMessage("The thing is mortgaged. ");
return;
}
switch (square->type) {
case TYPE_PROPERTY:
property = square->description;
if (property->isMonopoly) if (property->houseCount == 0) printf("rent is %d\n", rentAmount = property->rent[0] * 2);
else if (property->houseCount < 5) printf("with %d houses, rent is %d\n", property->houseCount, rentAmount = property->rent[property->houseCount]);
else printf("with a hotel, rent is %d\n", rentAmount = property->rent[property->houseCount]);
else printf("rent is %d\n", rentAmount = property->rent[0]);
break;
case TYPE_RAILROAD:
rentAmount = 25;
rentAmount <<= (player->railroadCardCount - 1);
if (isSpecialCard) rentAmount <<= 1;
printf("rent is %d\n", rentAmount);
break;
case TYPE_UTIL:
rentAmount = roll(2, 6);
if (player->utilitiesCount == 2 || isSpecialCard) {
printf("rent is 10 * roll (%d) = %d\n", rentAmount, rentAmount * 10);
rentAmount *= 10;
}
else {
printf("rent is 4 * roll (%d) = %d\n", rentAmount, rentAmount * 4);
rentAmount *= 4;
}
break;
}
currentPlayer->money -= rentAmount;
player->money += rentAmount;
}
| #ifndef lint
static char sccsid[] = "@(#)rent.c 5.3 (Berkeley) 6/1/90";
#endif
#include "monop.ext"
void rent(register SQUARE * square) {
regint rentAmount;
reg PROP * property;
PLAY * player;
player = & players[square->owner];
printf("Owned by %s\n", player->name);
if (square->description->isMortgaged) {
printLuckyMessage("The thing is mortgaged. ");
return;
}
switch (square->type) {
case TYPE_PROPERTY:
property = square->description;
if (property->isMonopoly) if (property->houseCount == 0) printf("rent is %d\n", rentAmount = property->rent[0] * 2);
else if (property->houseCount < 5) printf("with %d houses, rent is %d\n", property->houseCount, rentAmount = property->rent[property->houseCount]);
else printf("with a hotel, rent is %d\n", rentAmount = property->rent[property->houseCount]);
else printf("rent is %d\n", rentAmount = property->rent[0]);
break;
case TYPE_RAILROAD:
rentAmount = 25;
rentAmount <<= (player->railroadCardCount - 1);
if (isSpecialCard) rentAmount <<= 1;
printf("rent is %d\n", rentAmount);
break;
case TYPE_UTIL:
rentAmount = roll(2, 6);
if (player->utilitiesCount == 2 || isSpecialCard) {
printf("rent is 10 * roll (%d) = %d\n", rentAmount, rentAmount * 10);
rentAmount *= 10;
}
else {
printf("rent is 4 * roll (%d) = %d\n", rentAmount, rentAmount * 4);
rentAmount *= 4;
}
break;
}
currentPlayer->money -= rentAmount;
player->money += rentAmount;
}
| #if !defined(lint)
static char sccsid[] = "@(#)rent.c 5.3 (Berkeley) 6/1/90";
#endif
#include "monop.ext"
void rent(register SQUARE * square) {
regint rentAmount;
reg PROP * property;
PLAY * player;
player = & players[square->owner];
printf("Owned by %s\n", player->name);
if (square->description->isMortgaged) {
printLuckyMessage("The thing is mortgaged. ");
return;
}
switch (square->type) {
case TYPE_PROPERTY:
property = square->description;
if (property->isMonopoly) if (property->houseCount == 0) printf("rent is %d\n", rentAmount = property->rent[0] * 2);
else if (property->houseCount < 5) printf("with %d houses, rent is %d\n", property->houseCount, rentAmount = property->rent[property->houseCount]);
else printf("with a hotel, rent is %d\n", rentAmount = property->rent[property->houseCount]);
else printf("rent is %d\n", rentAmount = property->rent[0]);
break;
case TYPE_RAILROAD:
rentAmount = 25;
rentAmount <<= (player->railroadCardCount - 1);
if (isSpecialCard) rentAmount <<= 1;
printf("rent is %d\n", rentAmount);
break;
case TYPE_UTIL:
rentAmount = roll(2, 6);
if (player->utilitiesCount == 2 || isSpecialCard) {
printf("rent is 10 * roll (%d) = %d\n", rentAmount, rentAmount * 10);
rentAmount *= 10;
}
else {
printf("rent is 4 * roll (%d) = %d\n", rentAmount, rentAmount * 4);
rentAmount *= 4;
}
break;
}
currentPlayer->money -= rentAmount;
player->money += rentAmount;
}
| static char sccsid[] = "@(#)rent.c 5.3 (Berkeley) 6/1/90";
void rent(register SQUARE * square) {
regint rentAmount;
reg PROP * property;
PLAY * player;
player = & players[square->owner];
printf("Owned by %s\n", player->name);
if (square->description->isMortgaged) {
printLuckyMessage("The thing is mortgaged. ");
return;
}
switch (square->type) {
case TYPE_PROPERTY:
property = square->description;
if (property->isMonopoly) if (property->houseCount == 0) printf("rent is %d\n", rentAmount = property->rent[0] * 2);
else if (property->houseCount < 5) printf("with %d houses, rent is %d\n", property->houseCount, rentAmount = property->rent[property->houseCount]);
else printf("with a hotel, rent is %d\n", rentAmount = property->rent[property->houseCount]);
else printf("rent is %d\n", rentAmount = property->rent[0]);
break;
case TYPE_RAILROAD:
rentAmount = 25;
rentAmount <<= (player->railroadCardCount - 1);
if (isSpecialCard) rentAmount <<= 1;
printf("rent is %d\n", rentAmount);
break;
case TYPE_UTIL:
rentAmount = roll(2, 6);
if (player->utilitiesCount == 2 || isSpecialCard) {
printf("rent is 10 * roll (%d) = %d\n", rentAmount, rentAmount * 10);
rentAmount *= 10;
}
else {
printf("rent is 4 * roll (%d) = %d\n", rentAmount, rentAmount * 4);
rentAmount *= 4;
}
break;
}
currentPlayer->money -= rentAmount;
player->money += rentAmount;
}
| static char sccsid[] = "@(#)rent.c 5.3 (Berkeley) 6/1/90";
void rent(register SQUARE * square) {
register int rentAmount;
register PROP * property;
PLAY * player;
player = & players[square->owner];
printf("Owned by %s\n", player->name);
if (square->description->isMortgaged) {
printLuckyMessage("The thing is mortgaged. ");
return;
}
switch (square->type) {
case TYPE_PROPERTY:
property = square->description;
if (property->isMonopoly) if (property->houseCount == 0) printf("rent is %d\n", rentAmount = property->rent[0] * 2);
else if (property->houseCount < 5) printf("with %d houses, rent is %d\n", property->houseCount, rentAmount = property->rent[property->houseCount]);
else printf("with a hotel, rent is %d\n", rentAmount = property->rent[property->houseCount]);
else printf("rent is %d\n", rentAmount = property->rent[0]);
break;
case TYPE_RAILROAD:
rentAmount = 25;
rentAmount <<= (player->railroadCardCount - 1);
if (isSpecialCard) rentAmount <<= 1;
printf("rent is %d\n", rentAmount);
break;
case TYPE_UTIL:
rentAmount = roll(2, 6);
if (player->utilitiesCount == 2 || isSpecialCard) {
printf("rent is 10 * roll (%d) = %d\n", rentAmount, rentAmount * 10);
rentAmount *= 10;
}
else {
printf("rent is 4 * roll (%d) = %d\n", rentAmount, rentAmount * 4);
rentAmount *= 4;
}
break;
}
currentPlayer->money -= rentAmount;
player->money += rentAmount;
}
| static char sccsid[] = "@(#)rent.c 5.3 (Berkeley) 6/1/90";
void rent(SQUARE * square) {
int rentAmount;
PROP * property;
PLAY * player;
player = & players[square->owner];
printf("Owned by %s\n", player->name);
if (square->description->isMortgaged) {
printLuckyMessage("The thing is mortgaged. ");
return;
}
switch (square->type) {
case TYPE_PROPERTY:
property = square->description;
if (property->isMonopoly) if (property->houseCount == 0) printf("rent is %d\n", rentAmount = property->rent[0] * 2);
else if (property->houseCount < 5) printf("with %d houses, rent is %d\n", property->houseCount, rentAmount = property->rent[property->houseCount]);
else printf("with a hotel, rent is %d\n", rentAmount = property->rent[property->houseCount]);
else printf("rent is %d\n", rentAmount = property->rent[0]);
break;
case TYPE_RAILROAD:
rentAmount = 25;
rentAmount <<= (player->railroadCardCount - 1);
if (isSpecialCard) rentAmount <<= 1;
printf("rent is %d\n", rentAmount);
break;
case TYPE_UTIL:
rentAmount = roll(2, 6);
if (player->utilitiesCount == 2 || isSpecialCard) {
printf("rent is 10 * roll (%d) = %d\n", rentAmount, rentAmount * 10);
rentAmount *= 10;
}
else {
printf("rent is 4 * roll (%d) = %d\n", rentAmount, rentAmount * 4);
rentAmount *= 4;
}
break;
}
currentPlayer->money -= rentAmount;
player->money += rentAmount;
}
| static char sccsid[] = "@(#)rent.c 5.3 (Berkeley) 6/1/90";
void rent(Square * square) {
int rentAmount;
Property * property;
Player * player;
player = & players[square->owner];
printf("Owned by %s\n", player->name);
if (square->description->isMortgaged) {
printLuckyMessage("The thing is mortgaged. ");
return;
}
switch (square->type) {
case TYPE_PROPERTY:
property = square->description;
if (property->isMonopoly) if (property->houseCount == 0) printf("rent is %d\n", rentAmount = property->rent[0] * 2);
else if (property->houseCount < 5) printf("with %d houses, rent is %d\n", property->houseCount, rentAmount = property->rent[property->houseCount]);
else printf("with a hotel, rent is %d\n", rentAmount = property->rent[property->houseCount]);
else printf("rent is %d\n", rentAmount = property->rent[0]);
break;
case TYPE_RAILROAD:
rentAmount = 25;
rentAmount <<= (player->railroadCardCount - 1);
if (isSpecialCard) rentAmount <<= 1;
printf("rent is %d\n", rentAmount);
break;
case TYPE_UTIL:
rentAmount = roll(2, 6);
if (player->utilitiesCount == 2 || isSpecialCard) {
printf("rent is 10 * roll (%d) = %d\n", rentAmount, rentAmount * 10);
rentAmount *= 10;
}
else {
printf("rent is 4 * roll (%d) = %d\n", rentAmount, rentAmount * 4);
rentAmount *= 4;
}
break;
}
currentPlayer->money -= rentAmount;
player->money += rentAmount;
}
| static char[] sccsid = "@(#)rent.c 5.3 (Berkeley) 6/1/90";
void rent(Square * square) {
int rentAmount;
Property * property;
Player * player;
player = & players[square->owner];
printf("Owned by %s\n", player->name);
if (square->description->isMortgaged) {
printLuckyMessage("The thing is mortgaged. ");
return;
}
switch (square->type) {
case TYPE_PROPERTY:
property = square->description;
if (property->isMonopoly) if (property->houseCount == 0) printf("rent is %d\n", rentAmount = property->rent[0] * 2);
else if (property->houseCount < 5) printf("with %d houses, rent is %d\n", property->houseCount, rentAmount = property->rent[property->houseCount]);
else printf("with a hotel, rent is %d\n", rentAmount = property->rent[property->houseCount]);
else printf("rent is %d\n", rentAmount = property->rent[0]);
break;
case TYPE_RAILROAD:
rentAmount = 25;
rentAmount <<= (player->railroadCardCount - 1);
if (isSpecialCard) rentAmount <<= 1;
printf("rent is %d\n", rentAmount);
break;
case TYPE_UTIL:
rentAmount = roll(2, 6);
if (player->utilitiesCount == 2 || isSpecialCard) {
printf("rent is 10 * roll (%d) = %d\n", rentAmount, rentAmount * 10);
rentAmount *= 10;
}
else {
printf("rent is 4 * roll (%d) = %d\n", rentAmount, rentAmount * 4);
rentAmount *= 4;
}
break;
}
currentPlayer->money -= rentAmount;
player->money += rentAmount;
}
| static char[] sccsid = "@(#)rent.c 5.3 (Berkeley) 6/1/90";
void rent(Square * square) {
int rentAmount;
Property * property;
Player * player;
player = & players[square->owner];
printf("Owned by %s\n", player->name);
if (square->description->isMortgaged) {
printLuckyMessage("The thing is mortgaged. ");
return;
}
switch (square->type) {
case TYPE_PROPERTY:
property = square->description;
if (property->isMonopoly) {
if (property->houseCount == 0) {
printf("rent is %d\n", rentAmount = property->rent[0] * 2);
}
else {
if (property->houseCount < 5) {
printf("with %d houses, rent is %d\n", property->houseCount, rentAmount = property->rent[property->houseCount]);
}
else {
printf("with a hotel, rent is %d\n", rentAmount = property->rent[property->houseCount]);
}
}
}
else {
printf("rent is %d\n", rentAmount = property->rent[0]);
}
break;
case TYPE_RAILROAD:
rentAmount = 25;
rentAmount <<= (player->railroadCardCount - 1);
if (isSpecialCard) {
rentAmount <<= 1;
}
printf("rent is %d\n", rentAmount);
break;
case TYPE_UTIL:
rentAmount = roll(2, 6);
if (player->utilitiesCount == 2 || isSpecialCard) {
printf("rent is 10 * roll (%d) = %d\n", rentAmount, rentAmount * 10);
rentAmount *= 10;
}
else {
printf("rent is 4 * roll (%d) = %d\n", rentAmount, rentAmount * 4);
rentAmount *= 4;
}
break;
}
currentPlayer->money -= rentAmount;
player->money += rentAmount;
}
| static char[] sccsid = "@(#)rent.c 5.3 (Berkeley) 6/1/90";
void rent(Square * square7) {
int rentAmount;
Property * property;
Player * player;
player = & players[square7->owner];
printf("Owned by %s\n", player->name);
if (square7->description->isMortgaged) {
printLuckyMessage("The thing is mortgaged. ");
return;
}
switch (square7->type) {
case TYPE_PROPERTY:
property = square7->description;
if (property->isMonopoly) {
if (property->houseCount == 0) {
printf("rent is %d\n", rentAmount = property->rent[0] * 2);
}
else {
if (property->houseCount < 5) {
printf("with %d houses, rent is %d\n", property->houseCount, rentAmount = property->rent[property->houseCount]);
}
else {
printf("with a hotel, rent is %d\n", rentAmount = property->rent[property->houseCount]);
}
}
}
else {
printf("rent is %d\n", rentAmount = property->rent[0]);
}
break;
case TYPE_RAILROAD:
rentAmount = 25;
rentAmount <<= (player->railroadCardCount - 1);
if (isSpecialCard) {
rentAmount <<= 1;
}
printf("rent is %d\n", rentAmount);
break;
case TYPE_UTIL:
rentAmount = roll(2, 6);
if (player->utilitiesCount == 2 || isSpecialCard) {
printf("rent is 10 * roll (%d) = %d\n", rentAmount, rentAmount * 10);
rentAmount *= 10;
}
else {
printf("rent is 4 * roll (%d) = %d\n", rentAmount, rentAmount * 4);
rentAmount *= 4;
}
break;
}
currentPlayer->money -= rentAmount;
player->money += rentAmount;
}
| static char[] sccsid = "@(#)rent.c 5.3 (Berkeley) 6/1/90";
void rent(Square * square7) {
int rentAmount;
Property * property;
Player * player;
player = & Monop.players[square7->owner];
printf("Owned by %s\n", player->name);
if (square7->description->isMortgaged) {
printLuckyMessage("The thing is mortgaged. ");
return;
}
switch (square7->type) {
case TYPE_PROPERTY:
property = square7->description;
if (property->isMonopoly) {
if (property->houseCount == 0) {
printf("rent is %d\n", rentAmount = property->rent[0] * 2);
}
else {
if (property->houseCount < 5) {
printf("with %d houses, rent is %d\n", property->houseCount, rentAmount = property->rent[property->houseCount]);
}
else {
printf("with a hotel, rent is %d\n", rentAmount = property->rent[property->houseCount]);
}
}
}
else {
printf("rent is %d\n", rentAmount = property->rent[0]);
}
break;
case TYPE_RAILROAD:
rentAmount = 25;
rentAmount <<= (player->railroadCardCount - 1);
if (Monop.isSpecialCard) {
rentAmount <<= 1;
}
printf("rent is %d\n", rentAmount);
break;
case TYPE_UTIL:
rentAmount = roll(2, 6);
if (player->utilitiesCount == 2 || Monop.isSpecialCard) {
printf("rent is 10 * roll (%d) = %d\n", rentAmount, rentAmount * 10);
rentAmount *= 10;
}
else {
printf("rent is 4 * roll (%d) = %d\n", rentAmount, rentAmount * 4);
rentAmount *= 4;
}
break;
}
Monop.currentPlayer->money -= rentAmount;
player->money += rentAmount;
}
| static char[] sccsid = "@(#)rent.c 5.3 (Berkeley) 6/1/90";
static void rent(Square * square7) {
int rentAmount;
Property * property;
Player * player;
player = & Monop.players[square7->owner];
printf("Owned by %s\n", player->name);
if (square7->description->isMortgaged) {
printLuckyMessage("The thing is mortgaged. ");
return;
}
switch (square7->type) {
case TYPE_PROPERTY:
property = square7->description;
if (property->isMonopoly) {
if (property->houseCount == 0) {
printf("rent is %d\n", rentAmount = property->rent[0] * 2);
}
else {
if (property->houseCount < 5) {
printf("with %d houses, rent is %d\n", property->houseCount, rentAmount = property->rent[property->houseCount]);
}
else {
printf("with a hotel, rent is %d\n", rentAmount = property->rent[property->houseCount]);
}
}
}
else {
printf("rent is %d\n", rentAmount = property->rent[0]);
}
break;
case TYPE_RAILROAD:
rentAmount = 25;
rentAmount <<= (player->railroadCardCount - 1);
if (Monop.isSpecialCard) {
rentAmount <<= 1;
}
printf("rent is %d\n", rentAmount);
break;
case TYPE_UTIL:
rentAmount = Roll.roll(2, 6);
if (player->utilitiesCount == 2 || Monop.isSpecialCard) {
printf("rent is 10 * roll (%d) = %d\n", rentAmount, rentAmount * 10);
rentAmount *= 10;
}
else {
printf("rent is 4 * roll (%d) = %d\n", rentAmount, rentAmount * 4);
rentAmount *= 4;
}
break;
}
Monop.currentPlayer->money -= rentAmount;
player->money += rentAmount;
}
| static char[] sccsid = "@(#)rent.c 5.3 (Berkeley) 6/1/90";
static void rent(Square * square7) {
int rentAmount;
Property * property;
Player * player;
player = & Monop.players[square7->owner];
printf("Owned by %s\n", player->name);
if (square7->description->isMortgaged) {
printLuckyMessage("The thing is mortgaged. ");
return;
}
switch (square7->type) {
case TYPE_PROPERTY:
property = square7->description;
if (property->isMonopoly) {
if (property->houseCount == 0) {
printf("rent is %d\n", rentAmount = property->rent[0] * 2);
}
else {
if (property->houseCount < 5) {
printf("with %d houses, rent is %d\n", property->houseCount, rentAmount = property->rent[property->houseCount]);
}
else {
printf("with a hotel, rent is %d\n", rentAmount = property->rent[property->houseCount]);
}
}
}
else {
printf("rent is %d\n", rentAmount = property->rent[0]);
}
break;
case TYPE_RAILROAD:
rentAmount = 25;
rentAmount <<= (player->railroadCardCount - 1);
if (Monop.isSpecialCard) {
rentAmount <<= 1;
}
printf("rent is %d\n", rentAmount);
break;
case TYPE_UTIL:
rentAmount = Roll.roll(2, 6);
if (player->utilitiesCount == 2 || Monop.isSpecialCard) {
printf("rent is 10 * roll (%d) = %d\n", rentAmount, rentAmount * 10);
rentAmount *= 10;
}
else {
printf("rent is 4 * roll (%d) = %d\n", rentAmount, rentAmount * 4);
rentAmount *= 4;
}
break;
}
Monop.currentPlayer->money -= rentAmount;
player->money += rentAmount;
}
| static String sccsid = "@(#)rent.c 5.3 (Berkeley) 6/1/90";
static void rent(Square * square7) {
int rentAmount;
Property * property;
Player * player;
player = & Monop.players[square7->owner];
printf("Owned by %s\n", player->name);
if (square7->description->isMortgaged) {
printLuckyMessage("The thing is mortgaged. ");
return;
}
switch (square7->type) {
case TYPE_PROPERTY:
property = square7->description;
if (property->isMonopoly) {
if (property->houseCount == 0) {
printf("rent is %d\n", rentAmount = property->rent[0] * 2);
}
else {
if (property->houseCount < 5) {
printf("with %d houses, rent is %d\n", property->houseCount, rentAmount = property->rent[property->houseCount]);
}
else {
printf("with a hotel, rent is %d\n", rentAmount = property->rent[property->houseCount]);
}
}
}
else {
printf("rent is %d\n", rentAmount = property->rent[0]);
}
break;
case TYPE_RAILROAD:
rentAmount = 25;
rentAmount <<= (player->railroadCardCount - 1);
if (Monop.isSpecialCard) {
rentAmount <<= 1;
}
printf("rent is %d\n", rentAmount);
break;
case TYPE_UTIL:
rentAmount = Roll.roll(2, 6);
if (player->utilitiesCount == 2 || Monop.isSpecialCard) {
printf("rent is 10 * roll (%d) = %d\n", rentAmount, rentAmount * 10);
rentAmount *= 10;
}
else {
printf("rent is 4 * roll (%d) = %d\n", rentAmount, rentAmount * 4);
rentAmount *= 4;
}
break;
}
Monop.currentPlayer->money -= rentAmount;
player->money += rentAmount;
}
| static String sccsid;
sccsid = "@(#)rent.c 5.3 (Berkeley) 6/1/90";
static void rent(Square * square7) {
int rentAmount;
Property * property;
Player * player;
player = & Monop.players[square7->owner];
printf("Owned by %s\n", player->name);
if (square7->description->isMortgaged) {
printLuckyMessage("The thing is mortgaged. ");
return;
}
switch (square7->type) {
case TYPE_PROPERTY:
property = square7->description;
if (property->isMonopoly) {
if (property->houseCount == 0) {
printf("rent is %d\n", rentAmount = property->rent[0] * 2);
}
else {
if (property->houseCount < 5) {
printf("with %d houses, rent is %d\n", property->houseCount, rentAmount = property->rent[property->houseCount]);
}
else {
printf("with a hotel, rent is %d\n", rentAmount = property->rent[property->houseCount]);
}
}
}
else {
printf("rent is %d\n", rentAmount = property->rent[0]);
}
break;
case TYPE_RAILROAD:
rentAmount = 25;
rentAmount <<= (player->railroadCardCount - 1);
if (Monop.isSpecialCard) {
rentAmount <<= 1;
}
printf("rent is %d\n", rentAmount);
break;
case TYPE_UTIL:
rentAmount = Roll.roll(2, 6);
if (player->utilitiesCount == 2 || Monop.isSpecialCard) {
printf("rent is 10 * roll (%d) = %d\n", rentAmount, rentAmount * 10);
rentAmount *= 10;
}
else {
printf("rent is 4 * roll (%d) = %d\n", rentAmount, rentAmount * 4);
rentAmount *= 4;
}
break;
}
Monop.currentPlayer->money -= rentAmount;
player->money += rentAmount;
}
| static String sccsid;
sccsid = "@(#)rent.c 5.3 (Berkeley) 6/1/90";
static void rent(Square square7) {
int rentAmount;
Property property;
Player player;
player = Monop.players[square7.owner];
printf("Owned by %s\n", player.name);
if (square7.description.isMortgaged) {
printLuckyMessage("The thing is mortgaged. ");
return;
}
switch (square7.type) {
case TYPE_PROPERTY:
property = square7.description;
if (property.isMonopoly) {
if (property.houseCount == 0) {
printf("rent is %d\n", rentAmount = property.rent[0] * 2);
}
else {
if (property.houseCount < 5) {
printf("with %d houses, rent is %d\n", property.houseCount, rentAmount = property.rent[property.houseCount]);
}
else {
printf("with a hotel, rent is %d\n", rentAmount = property.rent[property.houseCount]);
}
}
}
else {
printf("rent is %d\n", rentAmount = property.rent[0]);
}
break;
case TYPE_RAILROAD:
rentAmount = 25;
rentAmount <<= (player.railroadCardCount - 1);
if (Monop.isSpecialCard) {
rentAmount <<= 1;
}
printf("rent is %d\n", rentAmount);
break;
case TYPE_UTIL:
rentAmount = Roll.roll(2, 6);
if (player.utilitiesCount == 2 || Monop.isSpecialCard) {
printf("rent is 10 * roll (%d) = %d\n", rentAmount, rentAmount * 10);
rentAmount *= 10;
}
else {
printf("rent is 4 * roll (%d) = %d\n", rentAmount, rentAmount * 4);
rentAmount *= 4;
}
break;
}
Monop.currentPlayer.money -= rentAmount;
player.money += rentAmount;
}
| static String sccsid;
sccsid = "@(#)rent.c 5.3 (Berkeley) 6/1/90";
static void rent(Square square7) {
int rentAmount;
Property property;
Player player;
player = Monop.players[square7.owner];
fprintf(stdout, "Owned by %s\n", player.name);
if (square7.description.isMortgaged) {
printLuckyMessage("The thing is mortgaged. ");
return;
}
switch (square7.type) {
case TYPE_PROPERTY:
property = square7.description;
if (property.isMonopoly) {
if (property.houseCount == 0) {
fprintf(stdout, "rent is %d\n", rentAmount = property.rent[0] * 2);
}
else {
if (property.houseCount < 5) {
fprintf(stdout, "with %d houses, rent is %d\n", property.houseCount, rentAmount = property.rent[property.houseCount]);
}
else {
fprintf(stdout, "with a hotel, rent is %d\n", rentAmount = property.rent[property.houseCount]);
}
}
}
else {
fprintf(stdout, "rent is %d\n", rentAmount = property.rent[0]);
}
break;
case TYPE_RAILROAD:
rentAmount = 25;
rentAmount <<= (player.railroadCardCount - 1);
if (Monop.isSpecialCard) {
rentAmount <<= 1;
}
fprintf(stdout, "rent is %d\n", rentAmount);
break;
case TYPE_UTIL:
rentAmount = Roll.roll(2, 6);
if (player.utilitiesCount == 2 || Monop.isSpecialCard) {
fprintf(stdout, "rent is 10 * roll (%d) = %d\n", rentAmount, rentAmount * 10);
rentAmount *= 10;
}
else {
fprintf(stdout, "rent is 4 * roll (%d) = %d\n", rentAmount, rentAmount * 4);
rentAmount *= 4;
}
break;
}
Monop.currentPlayer.money -= rentAmount;
player.money += rentAmount;
}
| static String sccsid = "@(#)rent.c 5.3 (Berkeley) 6/1/90";
static void rent(Square square7) {
int rentAmount;
Property property;
Player player = Monop.players[square7.owner];
fprintf(stdout, "Owned by %s\n", player.name);
if (square7.description.isMortgaged) {
printLuckyMessage("The thing is mortgaged. ");
return;
}
switch (square7.type) {
case TYPE_PROPERTY:
property = square7.description;
if (property.isMonopoly) {
if (property.houseCount == 0) {
fprintf(stdout, "rent is %d\n", rentAmount = property.rent[0] * 2);
}
else {
if (property.houseCount < 5) {
fprintf(stdout, "with %d houses, rent is %d\n", property.houseCount, rentAmount = property.rent[property.houseCount]);
}
else {
fprintf(stdout, "with a hotel, rent is %d\n", rentAmount = property.rent[property.houseCount]);
}
}
}
else {
fprintf(stdout, "rent is %d\n", rentAmount = property.rent[0]);
}
break;
case TYPE_RAILROAD:
rentAmount = 25;
rentAmount <<= (player.railroadCardCount - 1);
if (Monop.isSpecialCard) {
rentAmount <<= 1;
}
fprintf(stdout, "rent is %d\n", rentAmount);
break;
case TYPE_UTIL:
rentAmount = Roll.roll(2, 6);
if (player.utilitiesCount == 2 || Monop.isSpecialCard) {
fprintf(stdout, "rent is 10 * roll (%d) = %d\n", rentAmount, rentAmount * 10);
rentAmount *= 10;
}
else {
fprintf(stdout, "rent is 4 * roll (%d) = %d\n", rentAmount, rentAmount * 4);
rentAmount *= 4;
}
break;
}
Monop.currentPlayer.money -= rentAmount;
player.money += rentAmount;
}
| static String sccsid = "@(#)rent.c 5.3 (Berkeley) 6/1/90";
static void rent(Square square7) {
int rentAmount;
Property property;
Player player = Monop.players[square7.owner];
fprintf(stdout, "Owned by %s\n", player.name);
if (square7.description.isMortgaged) {
printLuckyMessage("The thing is mortgaged. ");
return;
}
switch (square7.type) {
case TYPE_PROPERTY:
property = square7.description;
if (property.isMonopoly) {
if (property.houseCount == 0) {
fprintf(stdout, "rent is %d\n", rentAmount = property.rent[0] * 2);
}
else if (property.houseCount < 5) {
fprintf(stdout, "with %d houses, rent is %d\n", property.houseCount, rentAmount = property.rent[property.houseCount]);
}
else {
fprintf(stdout, "with a hotel, rent is %d\n", rentAmount = property.rent[property.houseCount]);
}
}
else {
fprintf(stdout, "rent is %d\n", rentAmount = property.rent[0]);
}
break;
case TYPE_RAILROAD:
rentAmount = 25;
rentAmount <<= (player.railroadCardCount - 1);
if (Monop.isSpecialCard) {
rentAmount <<= 1;
}
fprintf(stdout, "rent is %d\n", rentAmount);
break;
case TYPE_UTIL:
rentAmount = Roll.roll(2, 6);
if (player.utilitiesCount == 2 || Monop.isSpecialCard) {
fprintf(stdout, "rent is 10 * roll (%d) = %d\n", rentAmount, rentAmount * 10);
rentAmount *= 10;
}
else {
fprintf(stdout, "rent is 4 * roll (%d) = %d\n", rentAmount, rentAmount * 4);
rentAmount *= 4;
}
break;
}
Monop.currentPlayer.money -= rentAmount;
player.money += rentAmount;
}
| static String sccsid = "@(#)rent.c 5.3 (Berkeley) 6/1/90";
static void rent(Square square7) {
int rentAmount;
Property property;
Player player = Monop.players[square7.owner];
System.out.println("Owned by " + player.name);
if (square7.description.isMortgaged) {
printLuckyMessage("The thing is mortgaged. ");
return;
}
switch (square7.type) {
case TYPE_PROPERTY:
property = square7.description;
if (property.isMonopoly) {
if (property.houseCount == 0) {
System.out.println("rent is " + (rentAmount = property.rent[0] * 2));
}
else if (property.houseCount < 5) {
System.out.println("with " + property.houseCount + " houses, rent is " + (rentAmount = property.rent[property.houseCount]));
}
else {
System.out.println("with a hotel, rent is " + (rentAmount = property.rent[property.houseCount]));
}
}
else {
System.out.println("rent is " + (rentAmount = property.rent[0]));
}
break;
case TYPE_RAILROAD:
rentAmount = 25;
rentAmount <<= (player.railroadCardCount - 1);
if (Monop.isSpecialCard) {
rentAmount <<= 1;
}
System.out.println("rent is " + rentAmount);
break;
case TYPE_UTIL:
rentAmount = Roll.roll(2, 6);
if (player.utilitiesCount == 2 || Monop.isSpecialCard) {
System.out.println("rent is 10 * roll (" + rentAmount + ") = " + (rentAmount * 10));
rentAmount *= 10;
}
else {
System.out.println("rent is 4 * roll (" + rentAmount + ") = " + (rentAmount * 4));
rentAmount *= 4;
}
break;
}
Monop.currentPlayer.money -= rentAmount;
player.money += rentAmount;
}
| static String sccsid = "@(#)rent.c 5.3 (Berkeley) 6/1/90";
static void rent(Square square7) {
int rentAmount = 0;
Property property = null;
Player player = Monop.players[square7.owner];
System.out.println("Owned by " + player.name);
if (square7.description.isMortgaged) {
printLuckyMessage("The thing is mortgaged. ");
return;
}
switch (square7.type) {
case TYPE_PROPERTY:
property = square7.description;
if (property.isMonopoly) {
if (property.houseCount == 0) {
System.out.println("rent is " + (rentAmount = property.rent[0] * 2));
}
else if (property.houseCount < 5) {
System.out.println("with " + property.houseCount + " houses, rent is " + (rentAmount = property.rent[property.houseCount]));
}
else {
System.out.println("with a hotel, rent is " + (rentAmount = property.rent[property.houseCount]));
}
}
else {
System.out.println("rent is " + (rentAmount = property.rent[0]));
}
break;
case TYPE_RAILROAD:
rentAmount = 25;
rentAmount <<= (player.railroadCardCount - 1);
if (Monop.isSpecialCard) {
rentAmount <<= 1;
}
System.out.println("rent is " + rentAmount);
break;
case TYPE_UTIL:
rentAmount = Roll.roll(2, 6);
if (player.utilitiesCount == 2 || Monop.isSpecialCard) {
System.out.println("rent is 10 * roll (" + rentAmount + ") = " + (rentAmount * 10));
rentAmount *= 10;
}
else {
System.out.println("rent is 4 * roll (" + rentAmount + ") = " + (rentAmount * 4));
rentAmount *= 4;
}
break;
}
Monop.currentPlayer.money -= rentAmount;
player.money += rentAmount;
}
| public class Rent {
static String sccsid = "@(#)rent.c 5.3 (Berkeley) 6/1/90";
static void rent(Square square7) {
int rentAmount = 0;
Property property = null;
Player player = Monop.players[square7.owner];
System.out.println("Owned by " + player.name);
if (square7.description.isMortgaged) {
printLuckyMessage("The thing is mortgaged. ");
return;
}
switch (square7.type) {
case TYPE_PROPERTY:
property = square7.description;
if (property.isMonopoly) {
if (property.houseCount == 0) {
System.out.println("rent is " + (rentAmount = property.rent[0] * 2));
}
else if (property.houseCount < 5) {
System.out.println("with " + property.houseCount + " houses, rent is " + (rentAmount = property.rent[property.houseCount]));
}
else {
System.out.println("with a hotel, rent is " + (rentAmount = property.rent[property.houseCount]));
}
}
else {
System.out.println("rent is " + (rentAmount = property.rent[0]));
}
break;
case TYPE_RAILROAD:
rentAmount = 25;
rentAmount <<= (player.railroadCardCount - 1);
if (Monop.isSpecialCard) {
rentAmount <<= 1;
}
System.out.println("rent is " + rentAmount);
break;
case TYPE_UTIL:
rentAmount = Roll.roll(2, 6);
if (player.utilitiesCount == 2 || Monop.isSpecialCard) {
System.out.println("rent is 10 * roll (" + rentAmount + ") = " + (rentAmount * 10));
rentAmount *= 10;
}
else {
System.out.println("rent is 4 * roll (" + rentAmount + ") = " + (rentAmount * 4));
rentAmount *= 4;
}
break;
}
Monop.currentPlayer.money -= rentAmount;
player.money += rentAmount;
}
}
| public class Rent {
static String sccsid = "@(#)rent.c 5.3 (Berkeley) 6/1/90";
static void rent(Square square7) {
int rentAmount = 0;
Property property = null;
Player player = Monop.players[square7.owner];
System.out.println("Owned by " + player.name);
if (square7.description.isMortgaged) {
printLuckyMessage("The thing is mortgaged. ");
return;
}
switch (square7.type) {
case TYPE_PROPERTY:
property = square7.description;
if (property.isMonopoly) {
if (property.houseCount == 0) {
System.out.println("rent is " + (rentAmount = property.rent[0] * 2));
}
else if (property.houseCount < 5) {
System.out.println("with " + property.houseCount + " houses, rent is " + (rentAmount = property.rent[property.houseCount]));
}
else {
System.out.println("with a hotel, rent is " + (rentAmount = property.rent[property.houseCount]));
}
}
else {
System.out.println("rent is " + (rentAmount = property.rent[0]));
}
break;
case TYPE_RAILROAD:
rentAmount = 25;
rentAmount <<= (player.railroadCardCount - 1);
if (Monop.isSpecialCard) {
rentAmount <<= 1;
}
System.out.println("rent is " + rentAmount);
break;
case TYPE_UTIL:
rentAmount = Roll.roll(2, 6);
if (player.utilitiesCount == 2 || Monop.isSpecialCard) {
System.out.println("rent is 10 * roll (" + rentAmount + ") = " + (rentAmount * 10));
rentAmount *= 10;
}
else {
System.out.println("rent is 4 * roll (" + rentAmount + ") = " + (rentAmount * 4));
rentAmount *= 4;
}
break;
}
Monop.currentPlayer.money -= rentAmount;
player.money += rentAmount;
}
}
|