| Rules Applied | JavaKeywordRule | app0.txt | PPspaceRule | PPifndefRule | PPRule | PPdefineRule.DefineReplacementRule | snippets0b.txt | TypedefRule.DefineReplacementRule | FunctionPointerReferenceRule | OneDeclarationPerLineRule | ArrayDeclaration0Rule | AddBracesRule | LabelRemoverRule | voidstarsnippet.txt | ConflictingVariableDeclarationRule | StaticVariablesRule | StaticFunctionsRule | MultipleAssignmentRule | readline2.lsnippet | ArrayDeclarationRule | StringRule | DeclarationAssignmentRule | PointerRule | BooleanFunctionRule | BooleanUsageRule | ForceToBooleanRule | FalseToZeroRule | snippets2.txt | snippets3.txt | ElseIfRule | PrintfRule | stdin.txt | IOExceptionRule | UninitializedVariableRule | InsertClassRule | ImportRule | (Final Version) | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| JavaKeywordRule app0.txt PPspaceRule PPifndefRule PPRule PPdefineRule.DefineReplacementRule snippets0b.txt TypedefRule.DefineReplacementRule FunctionPointerReferenceRule OneDeclarationPerLineRule ArrayDeclaration0Rule AddBracesRule LabelRemoverRule voidstarsnippet.txt ConflictingVariableDeclarationRule StaticVariablesRule StaticFunctionsRule MultipleAssignmentRule readline2.lsnippet ArrayDeclarationRule StringRule DeclarationAssignmentRule PointerRule BooleanFunctionRule BooleanUsageRule ForceToBooleanRule FalseToZeroRule snippets2.txt snippets3.txt ElseIfRule PrintfRule stdin.txt IOExceptionRule UninitializedVariableRule InsertClassRule ImportRule final | #ifndef lint static char sccsid[] = "@(#)execute.c 5.5 (Berkeley) 2/28/91"; #endif # include "monop.ext" # include | #ifndef lint static char sccsid[] = "@(#)execute.c 5.5 (Berkeley) 2/28/91"; #endif # include "monop.ext" # include | #ifndef lint static char sccsid[] = "@(#)execute.c 5.5 (Berkeley) 2/28/91"; #endif #include "monop.ext" #include | #if !defined(lint) static char sccsid[] = "@(#)execute.c 5.5 (Berkeley) 2/28/91"; #endif #include "monop.ext" #include | static char sccsid[] = "@(#)execute.c 5.5 (Berkeley) 2/28/91";
public final static int SEGSIZE = 8192;
extern char etext[],
rub();
static char buf[257],
* yn_only[] = {
"yes",
"no"}
;
static bool currentPlayerNumber;
void execute(register int answer) {
currentPlayerNumber = FALSE;
( * functions[answer]) ();
notify1();
fixupPrompt();
if (currentPlayerNumber) nextPlayer();
else if (numberOfDoubles) printf("%s rolled doubles. Goes again\n", currentPlayer->name);
}
void doMove(void) {
regint r1,
r2;
reg bool wasInJail;
currentPlayerNumber = wasInJail = FALSE;
printf("roll is %d, %d\n", r1 = roll(1, 6) , r2 = roll(1, 6));
if (currentPlayer->location == JAIL_SQUARE_NUMBER) {
wasInJail++;
if (!checkForDoubles(r1, r2)) {
currentPlayerNumber++;
return;
}
}
else {
if (r1 == r2 &&++numberOfDoubles == 3) {
printf("That's 3 doubles. You go to jail\n");
gotoJail();
currentPlayerNumber++;
return;
}
move(r1 + r2);
}
if (r1 != r2 || wasInJail) currentPlayerNumber++;
ret:return;
}
void move(register int rl) {
regint oldLocation;
oldLocation = currentPlayer->location;
currentPlayer->location = (currentPlayer->location + rl) % NUMBER_OF_SQUARES;
if (currentPlayer->location < oldLocation && rl > 0) {
currentPlayer->money += 200;
printf("You pass %s and get $200\n", board[0].name);
}
showMove();
}
void showMove(void) {
reg SQUARE * square;
square = & board[currentPlayer->location];
printf("That puts you on %s\n", square->name);
switch (square->type) {
case TYPE_SAFE:
printf("That is a safe place\n");
break;
case TYPE_COMMUNITY_CHEST:
pickCommunityChestCard();
break;
case TYPE_CHANCE:
pickChanceCard();
break;
case TYPE_INCOME_TAX:
incomeTax();
break;
case TYPE_GOTO_JAIL:
gotoJail();
break;
case TYPE_LUXURY_TAX:
luxuryTax();
break;
case TYPE_PROPERTY:
case TYPE_RAILROAD:
case TYPE_UTIL:
if (square->owner < 0) {
printf("That would cost $%d\n", square->cost);
if (getYesOrNo("Do you want to buy? ") == 0) {
buy(currentPlayerNumber, square);
currentPlayer->money -= square->cost;
}
else if (numberOfPlayers > 2) bid();
}
else if (square->owner == currentPlayerNumber) printf("You own it.\n");
else rent(square);
}
}
void saveGame(void) {
}
void restoreGame(void) {
regchar * sp;
printf("Which file do you wish to restore from? ");
for (sp = buf;( * sp = getchar()) != '\n';sp++) continue;
* sp = '\0';
restoreFromFile(buf);
}
int restoreFromFile(register char * file) {
return TRUE;
}
| static char sccsid[] = "@(#)execute.c 5.5 (Berkeley) 2/28/91";
public final static int SEGSIZE = 8192;
extern char etext[],
rub();
static char buf[257],
* yn_only[] = {
"yes",
"no"}
;
static boolean currentPlayerNumber;
void execute(register int answer) {
currentPlayerNumber = false;
( * functions[answer]) ();
notify1();
fixupPrompt();
if (currentPlayerNumber) nextPlayer();
else if (numberOfDoubles) printf("%s rolled doubles. Goes again\n", currentPlayer->name);
}
void doMove(void) {
register int r1,
r2;
register boolean wasInJail;
currentPlayerNumber = wasInJail = false;
printf("roll is %d, %d\n", r1 = roll(1, 6) , r2 = roll(1, 6));
if (currentPlayer->location == JAIL_SQUARE_NUMBER) {
wasInJail++;
if (!checkForDoubles(r1, r2)) {
currentPlayerNumber++;
return;
}
}
else {
if (r1 == r2 &&++numberOfDoubles == 3) {
printf("That's 3 doubles. You go to jail\n");
gotoJail();
currentPlayerNumber++;
return;
}
move(r1 + r2);
}
if (r1 != r2 || wasInJail) currentPlayerNumber++;
ret:return;
}
void move(register int rl) {
register int oldLocation;
oldLocation = currentPlayer->location;
currentPlayer->location = (currentPlayer->location + rl) % NUMBER_OF_SQUARES;
if (currentPlayer->location < oldLocation && rl > 0) {
currentPlayer->money += 200;
printf("You pass %s and get $200\n", board[0].name);
}
showMove();
}
void showMove(void) {
register SQUARE * square;
square = & board[currentPlayer->location];
printf("That puts you on %s\n", square->name);
switch (square->type) {
case TYPE_SAFE:
printf("That is a safe place\n");
break;
case TYPE_COMMUNITY_CHEST:
pickCommunityChestCard();
break;
case TYPE_CHANCE:
pickChanceCard();
break;
case TYPE_INCOME_TAX:
incomeTax();
break;
case TYPE_GOTO_JAIL:
gotoJail();
break;
case TYPE_LUXURY_TAX:
luxuryTax();
break;
case TYPE_PROPERTY:
case TYPE_RAILROAD:
case TYPE_UTIL:
if (square->owner < 0) {
printf("That would cost $%d\n", square->cost);
if (getYesOrNo("Do you want to buy? ") == 0) {
buy(currentPlayerNumber, square);
currentPlayer->money -= square->cost;
}
else if (numberOfPlayers > 2) bid();
}
else if (square->owner == currentPlayerNumber) printf("You own it.\n");
else rent(square);
}
}
void saveGame(void) {
}
void restoreGame(void) {
register char * sp;
printf("Which file do you wish to restore from? ");
for (sp = buf;( * sp = getchar()) != '\n';sp++) continue;
* sp = '\0';
restoreFromFile(buf);
}
int restoreFromFile(register char * file) {
return true;
}
| static char sccsid[] = "@(#)execute.c 5.5 (Berkeley) 2/28/91";
public final static int SEGSIZE = 8192;
static char buf[257],
* yn_only[] = {
"yes",
"no"}
;
static boolean currentPlayerNumber;
void execute(int answer) {
currentPlayerNumber = false;
( * functions[answer]) ();
notify1();
fixupPrompt();
if (currentPlayerNumber) nextPlayer();
else if (numberOfDoubles) printf("%s rolled doubles. Goes again\n", currentPlayer->name);
}
void doMove(void) {
int r1,
r2;
boolean wasInJail;
currentPlayerNumber = wasInJail = false;
printf("roll is %d, %d\n", r1 = roll(1, 6) , r2 = roll(1, 6));
if (currentPlayer->location == JAIL_SQUARE_NUMBER) {
wasInJail++;
if (!checkForDoubles(r1, r2)) {
currentPlayerNumber++;
return;
}
}
else {
if (r1 == r2 &&++numberOfDoubles == 3) {
printf("That's 3 doubles. You go to jail\n");
gotoJail();
currentPlayerNumber++;
return;
}
move(r1 + r2);
}
if (r1 != r2 || wasInJail) currentPlayerNumber++;
ret:return;
}
void move(int rl) {
int oldLocation;
oldLocation = currentPlayer->location;
currentPlayer->location = (currentPlayer->location + rl) % NUMBER_OF_SQUARES;
if (currentPlayer->location < oldLocation && rl > 0) {
currentPlayer->money += 200;
printf("You pass %s and get $200\n", board[0].name);
}
showMove();
}
void showMove(void) {
SQUARE * square;
square = & board[currentPlayer->location];
printf("That puts you on %s\n", square->name);
switch (square->type) {
case TYPE_SAFE:
printf("That is a safe place\n");
break;
case TYPE_COMMUNITY_CHEST:
pickCommunityChestCard();
break;
case TYPE_CHANCE:
pickChanceCard();
break;
case TYPE_INCOME_TAX:
incomeTax();
break;
case TYPE_GOTO_JAIL:
gotoJail();
break;
case TYPE_LUXURY_TAX:
luxuryTax();
break;
case TYPE_PROPERTY:
case TYPE_RAILROAD:
case TYPE_UTIL:
if (square->owner < 0) {
printf("That would cost $%d\n", square->cost);
if (getYesOrNo("Do you want to buy? ") == 0) {
buy(currentPlayerNumber, square);
currentPlayer->money -= square->cost;
}
else if (numberOfPlayers > 2) bid();
}
else if (square->owner == currentPlayerNumber) printf("You own it.\n");
else rent(square);
}
}
void saveGame(void) {
}
void restoreGame(void) {
char * sp;
printf("Which file do you wish to restore from? ");
for (sp = buf;( * sp = getchar()) != '\n';sp++) continue;
* sp = '\0';
restoreFromFile(buf);
}
int restoreFromFile(char * file) {
return true;
}
| static char sccsid[] = "@(#)execute.c 5.5 (Berkeley) 2/28/91";
public final static int SEGSIZE = 8192;
static char buf[257],
* yn_only[] = {
"yes",
"no"}
;
static boolean currentPlayerNumber;
void execute(int answer) {
currentPlayerNumber = false;
( * functions[answer]) ();
notify1();
fixupPrompt();
if (currentPlayerNumber) nextPlayer();
else if (numberOfDoubles) printf("%s rolled doubles. Goes again\n", currentPlayer->name);
}
void doMove(void) {
int r1,
r2;
boolean wasInJail;
currentPlayerNumber = wasInJail = false;
printf("roll is %d, %d\n", r1 = roll(1, 6) , r2 = roll(1, 6));
if (currentPlayer->location == JAIL_SQUARE_NUMBER) {
wasInJail++;
if (!checkForDoubles(r1, r2)) {
currentPlayerNumber++;
return;
}
}
else {
if (r1 == r2 &&++numberOfDoubles == 3) {
printf("That's 3 doubles. You go to jail\n");
gotoJail();
currentPlayerNumber++;
return;
}
move(r1 + r2);
}
if (r1 != r2 || wasInJail) currentPlayerNumber++;
ret:return;
}
void move(int rl) {
int oldLocation;
oldLocation = currentPlayer->location;
currentPlayer->location = (currentPlayer->location + rl) % NUMBER_OF_SQUARES;
if (currentPlayer->location < oldLocation && rl > 0) {
currentPlayer->money += 200;
printf("You pass %s and get $200\n", board[0].name);
}
showMove();
}
void showMove(void) {
Square * square;
square = & board[currentPlayer->location];
printf("That puts you on %s\n", square->name);
switch (square->type) {
case TYPE_SAFE:
printf("That is a safe place\n");
break;
case TYPE_COMMUNITY_CHEST:
pickCommunityChestCard();
break;
case TYPE_CHANCE:
pickChanceCard();
break;
case TYPE_INCOME_TAX:
incomeTax();
break;
case TYPE_GOTO_JAIL:
gotoJail();
break;
case TYPE_LUXURY_TAX:
luxuryTax();
break;
case TYPE_PROPERTY:
case TYPE_RAILROAD:
case TYPE_UTIL:
if (square->owner < 0) {
printf("That would cost $%d\n", square->cost);
if (getYesOrNo("Do you want to buy? ") == 0) {
buy(currentPlayerNumber, square);
currentPlayer->money -= square->cost;
}
else if (numberOfPlayers > 2) bid();
}
else if (square->owner == currentPlayerNumber) printf("You own it.\n");
else rent(square);
}
}
void saveGame(void) {
}
void restoreGame(void) {
char * sp;
printf("Which file do you wish to restore from? ");
for (sp = buf;( * sp = getchar()) != '\n';sp++) continue;
* sp = '\0';
restoreFromFile(buf);
}
int restoreFromFile(char * file) {
return true;
}
| static char sccsid[] = "@(#)execute.c 5.5 (Berkeley) 2/28/91";
public final static int SEGSIZE = 8192;
static char buf[257],
* yn_only[] = {
"yes",
"no"}
;
static boolean currentPlayerNumber;
void execute(int answer) {
currentPlayerNumber = false;
Invoker.invoke(functions[answer]) notify1();
fixupPrompt();
if (currentPlayerNumber) nextPlayer();
else if (numberOfDoubles) printf("%s rolled doubles. Goes again\n", currentPlayer->name);
}
public static void doMove(void) {
int r1,
r2;
boolean wasInJail;
currentPlayerNumber = wasInJail = false;
printf("roll is %d, %d\n", r1 = roll(1, 6) , r2 = roll(1, 6));
if (currentPlayer->location == JAIL_SQUARE_NUMBER) {
wasInJail++;
if (!checkForDoubles(r1, r2)) {
currentPlayerNumber++;
return;
}
}
else {
if (r1 == r2 &&++numberOfDoubles == 3) {
printf("That's 3 doubles. You go to jail\n");
gotoJail();
currentPlayerNumber++;
return;
}
move(r1 + r2);
}
if (r1 != r2 || wasInJail) currentPlayerNumber++;
ret:return;
}
void move(int rl) {
int oldLocation;
oldLocation = currentPlayer->location;
currentPlayer->location = (currentPlayer->location + rl) % NUMBER_OF_SQUARES;
if (currentPlayer->location < oldLocation && rl > 0) {
currentPlayer->money += 200;
printf("You pass %s and get $200\n", board[0].name);
}
showMove();
}
void showMove(void) {
Square * square;
square = & board[currentPlayer->location];
printf("That puts you on %s\n", square->name);
switch (square->type) {
case TYPE_SAFE:
printf("That is a safe place\n");
break;
case TYPE_COMMUNITY_CHEST:
pickCommunityChestCard();
break;
case TYPE_CHANCE:
pickChanceCard();
break;
case TYPE_INCOME_TAX:
incomeTax();
break;
case TYPE_GOTO_JAIL:
gotoJail();
break;
case TYPE_LUXURY_TAX:
luxuryTax();
break;
case TYPE_PROPERTY:
case TYPE_RAILROAD:
case TYPE_UTIL:
if (square->owner < 0) {
printf("That would cost $%d\n", square->cost);
if (getYesOrNo("Do you want to buy? ") == 0) {
buy(currentPlayerNumber, square);
currentPlayer->money -= square->cost;
}
else if (numberOfPlayers > 2) bid();
}
else if (square->owner == currentPlayerNumber) printf("You own it.\n");
else rent(square);
}
}
public static void saveGame(void) {
}
public static void restoreGame(void) {
char * sp;
printf("Which file do you wish to restore from? ");
for (sp = buf;( * sp = getchar()) != '\n';sp++) continue;
* sp = '\0';
restoreFromFile(buf);
}
int restoreFromFile(char * file) {
return true;
}
| static char sccsid[] = "@(#)execute.c 5.5 (Berkeley) 2/28/91";
public final static int SEGSIZE = 8192;
static char buf[257];
static char * yn_only[] = {
"yes",
"no"}
;
static boolean currentPlayerNumber;
void execute(int answer) {
currentPlayerNumber = false;
Invoker.invoke(functions[answer]) notify1();
fixupPrompt();
if (currentPlayerNumber) nextPlayer();
else if (numberOfDoubles) printf("%s rolled doubles. Goes again\n", currentPlayer->name);
}
public static void doMove(void) {
int r1;
int r2;
boolean wasInJail;
currentPlayerNumber = wasInJail = false;
printf("roll is %d, %d\n", r1 = roll(1, 6) , r2 = roll(1, 6));
if (currentPlayer->location == JAIL_SQUARE_NUMBER) {
wasInJail++;
if (!checkForDoubles(r1, r2)) {
currentPlayerNumber++;
return;
}
}
else {
if (r1 == r2 &&++numberOfDoubles == 3) {
printf("That's 3 doubles. You go to jail\n");
gotoJail();
currentPlayerNumber++;
return;
}
move(r1 + r2);
}
if (r1 != r2 || wasInJail) currentPlayerNumber++;
ret:return;
}
void move(int rl) {
int oldLocation;
oldLocation = currentPlayer->location;
currentPlayer->location = (currentPlayer->location + rl) % NUMBER_OF_SQUARES;
if (currentPlayer->location < oldLocation && rl > 0) {
currentPlayer->money += 200;
printf("You pass %s and get $200\n", board[0].name);
}
showMove();
}
void showMove(void) {
Square * square;
square = & board[currentPlayer->location];
printf("That puts you on %s\n", square->name);
switch (square->type) {
case TYPE_SAFE:
printf("That is a safe place\n");
break;
case TYPE_COMMUNITY_CHEST:
pickCommunityChestCard();
break;
case TYPE_CHANCE:
pickChanceCard();
break;
case TYPE_INCOME_TAX:
incomeTax();
break;
case TYPE_GOTO_JAIL:
gotoJail();
break;
case TYPE_LUXURY_TAX:
luxuryTax();
break;
case TYPE_PROPERTY:
case TYPE_RAILROAD:
case TYPE_UTIL:
if (square->owner < 0) {
printf("That would cost $%d\n", square->cost);
if (getYesOrNo("Do you want to buy? ") == 0) {
buy(currentPlayerNumber, square);
currentPlayer->money -= square->cost;
}
else if (numberOfPlayers > 2) bid();
}
else if (square->owner == currentPlayerNumber) printf("You own it.\n");
else rent(square);
}
}
public static void saveGame(void) {
}
public static void restoreGame(void) {
char * sp;
printf("Which file do you wish to restore from? ");
for (sp = buf;( * sp = getchar()) != '\n';sp++) continue;
* sp = '\0';
restoreFromFile(buf);
}
int restoreFromFile(char * file) {
return true;
}
| static char[] sccsid = "@(#)execute.c 5.5 (Berkeley) 2/28/91";
public final static int SEGSIZE = 8192;
static char[257] buf;
static String[] yn_only = {
"yes",
"no"}
;
static boolean currentPlayerNumber;
void execute(int answer) {
currentPlayerNumber = false;
Invoker.invoke(functions[answer]) notify1();
fixupPrompt();
if (currentPlayerNumber) nextPlayer();
else if (numberOfDoubles) printf("%s rolled doubles. Goes again\n", currentPlayer->name);
}
public static void doMove(void) {
int r1;
int r2;
boolean wasInJail;
currentPlayerNumber = wasInJail = false;
printf("roll is %d, %d\n", r1 = roll(1, 6) , r2 = roll(1, 6));
if (currentPlayer->location == JAIL_SQUARE_NUMBER) {
wasInJail++;
if (!checkForDoubles(r1, r2)) {
currentPlayerNumber++;
return;
}
}
else {
if (r1 == r2 &&++numberOfDoubles == 3) {
printf("That's 3 doubles. You go to jail\n");
gotoJail();
currentPlayerNumber++;
return;
}
move(r1 + r2);
}
if (r1 != r2 || wasInJail) currentPlayerNumber++;
ret:return;
}
void move(int rl) {
int oldLocation;
oldLocation = currentPlayer->location;
currentPlayer->location = (currentPlayer->location + rl) % NUMBER_OF_SQUARES;
if (currentPlayer->location < oldLocation && rl > 0) {
currentPlayer->money += 200;
printf("You pass %s and get $200\n", board[0].name);
}
showMove();
}
void showMove(void) {
Square * square;
square = & board[currentPlayer->location];
printf("That puts you on %s\n", square->name);
switch (square->type) {
case TYPE_SAFE:
printf("That is a safe place\n");
break;
case TYPE_COMMUNITY_CHEST:
pickCommunityChestCard();
break;
case TYPE_CHANCE:
pickChanceCard();
break;
case TYPE_INCOME_TAX:
incomeTax();
break;
case TYPE_GOTO_JAIL:
gotoJail();
break;
case TYPE_LUXURY_TAX:
luxuryTax();
break;
case TYPE_PROPERTY:
case TYPE_RAILROAD:
case TYPE_UTIL:
if (square->owner < 0) {
printf("That would cost $%d\n", square->cost);
if (getYesOrNo("Do you want to buy? ") == 0) {
buy(currentPlayerNumber, square);
currentPlayer->money -= square->cost;
}
else if (numberOfPlayers > 2) bid();
}
else if (square->owner == currentPlayerNumber) printf("You own it.\n");
else rent(square);
}
}
public static void saveGame(void) {
}
public static void restoreGame(void) {
char * sp;
printf("Which file do you wish to restore from? ");
for (sp = buf;( * sp = getchar()) != '\n';sp++) continue;
* sp = '\0';
restoreFromFile(buf);
}
int restoreFromFile(char * file) {
return true;
}
| static char[] sccsid = "@(#)execute.c 5.5 (Berkeley) 2/28/91";
public final static int SEGSIZE = 8192;
static char[257] buf;
static String[] yn_only = {
"yes",
"no"}
;
static boolean currentPlayerNumber;
void execute(int answer) {
currentPlayerNumber = false;
Invoker.invoke(functions[answer]) notify1();
fixupPrompt();
if (currentPlayerNumber) {
nextPlayer();
}
else {
if (numberOfDoubles) {
printf("%s rolled doubles. Goes again\n", currentPlayer->name);
}
}
}
public static void doMove(void) {
int r1;
int r2;
boolean wasInJail;
currentPlayerNumber = wasInJail = false;
printf("roll is %d, %d\n", r1 = roll(1, 6) , r2 = roll(1, 6));
if (currentPlayer->location == JAIL_SQUARE_NUMBER) {
wasInJail++;
if (!checkForDoubles(r1, r2)) {
currentPlayerNumber++;
return;
}
}
else {
if (r1 == r2 &&++numberOfDoubles == 3) {
printf("That's 3 doubles. You go to jail\n");
gotoJail();
currentPlayerNumber++;
return;
}
move(r1 + r2);
}
if (r1 != r2 || wasInJail) {
currentPlayerNumber++;
}
ret:return;
}
void move(int rl) {
int oldLocation;
oldLocation = currentPlayer->location;
currentPlayer->location = (currentPlayer->location + rl) % NUMBER_OF_SQUARES;
if (currentPlayer->location < oldLocation && rl > 0) {
currentPlayer->money += 200;
printf("You pass %s and get $200\n", board[0].name);
}
showMove();
}
void showMove(void) {
Square * square;
square = & board[currentPlayer->location];
printf("That puts you on %s\n", square->name);
switch (square->type) {
case TYPE_SAFE:
printf("That is a safe place\n");
break;
case TYPE_COMMUNITY_CHEST:
pickCommunityChestCard();
break;
case TYPE_CHANCE:
pickChanceCard();
break;
case TYPE_INCOME_TAX:
incomeTax();
break;
case TYPE_GOTO_JAIL:
gotoJail();
break;
case TYPE_LUXURY_TAX:
luxuryTax();
break;
case TYPE_PROPERTY:
case TYPE_RAILROAD:
case TYPE_UTIL:
if (square->owner < 0) {
printf("That would cost $%d\n", square->cost);
if (getYesOrNo("Do you want to buy? ") == 0) {
buy(currentPlayerNumber, square);
currentPlayer->money -= square->cost;
}
else {
if (numberOfPlayers > 2) {
bid();
}
}
}
else {
if (square->owner == currentPlayerNumber) {
printf("You own it.\n");
}
else {
rent(square);
}
}
}
}
public static void saveGame(void) {
}
public static void restoreGame(void) {
char * sp;
printf("Which file do you wish to restore from? ");
for (sp = buf;( * sp = getchar()) != '\n';sp++) {
continue;
}
* sp = '\0';
restoreFromFile(buf);
}
int restoreFromFile(char * file) {
return true;
}
| static char[] sccsid = "@(#)execute.c 5.5 (Berkeley) 2/28/91";
public final static int SEGSIZE = 8192;
static char[257] buf;
static String[] yn_only = {
"yes",
"no"}
;
static boolean currentPlayerNumber;
void execute(int answer) {
currentPlayerNumber = false;
Invoker.invoke(functions[answer]) notify1();
fixupPrompt();
if (currentPlayerNumber) {
nextPlayer();
}
else {
if (numberOfDoubles) {
printf("%s rolled doubles. Goes again\n", currentPlayer->name);
}
}
}
public static void doMove(void) {
int r1;
int r2;
boolean wasInJail;
currentPlayerNumber = wasInJail = false;
printf("roll is %d, %d\n", r1 = roll(1, 6) , r2 = roll(1, 6));
if (currentPlayer->location == JAIL_SQUARE_NUMBER) {
wasInJail++;
if (!checkForDoubles(r1, r2)) {
currentPlayerNumber++;
return;
}
}
else {
if (r1 == r2 &&++numberOfDoubles == 3) {
printf("That's 3 doubles. You go to jail\n");
gotoJail();
currentPlayerNumber++;
return;
}
move(r1 + r2);
}
if (r1 != r2 || wasInJail) {
currentPlayerNumber++;
}
return;
}
void move(int rl) {
int oldLocation;
oldLocation = currentPlayer->location;
currentPlayer->location = (currentPlayer->location + rl) % NUMBER_OF_SQUARES;
if (currentPlayer->location < oldLocation && rl > 0) {
currentPlayer->money += 200;
printf("You pass %s and get $200\n", board[0].name);
}
showMove();
}
void showMove(void) {
Square * square;
square = & board[currentPlayer->location];
printf("That puts you on %s\n", square->name);
switch (square->type) {
case TYPE_SAFE:
printf("That is a safe place\n");
break;
case TYPE_COMMUNITY_CHEST:
pickCommunityChestCard();
break;
case TYPE_CHANCE:
pickChanceCard();
break;
case TYPE_INCOME_TAX:
incomeTax();
break;
case TYPE_GOTO_JAIL:
gotoJail();
break;
case TYPE_LUXURY_TAX:
luxuryTax();
break;
case TYPE_PROPERTY:
case TYPE_RAILROAD:
case TYPE_UTIL:
if (square->owner < 0) {
printf("That would cost $%d\n", square->cost);
if (getYesOrNo("Do you want to buy? ") == 0) {
buy(currentPlayerNumber, square);
currentPlayer->money -= square->cost;
}
else {
if (numberOfPlayers > 2) {
bid();
}
}
}
else {
if (square->owner == currentPlayerNumber) {
printf("You own it.\n");
}
else {
rent(square);
}
}
}
}
public static void saveGame(void) {
}
public static void restoreGame(void) {
char * sp;
printf("Which file do you wish to restore from? ");
for (sp = buf;( * sp = getchar()) != '\n';sp++) {
continue;
}
* sp = '\0';
restoreFromFile(buf);
}
int restoreFromFile(char * file) {
return true;
}
| static char[] sccsid = "@(#)execute.c 5.5 (Berkeley) 2/28/91";
public final static int SEGSIZE = 8192;
static char[257] buf;
static String[] yn_only = {
"yes",
"no"}
;
static boolean currentPlayerNumber;
void execute(int answer) {
currentPlayerNumber = false;
Invoker.invoke(functions[answer]) notify1();
fixupPrompt();
if (currentPlayerNumber) {
nextPlayer();
}
else {
if (numberOfDoubles) {
printf("%s rolled doubles. Goes again\n", currentPlayer->name);
}
}
}
public static void doMove() {
int r1;
int r2;
boolean wasInJail;
currentPlayerNumber = wasInJail = false;
printf("roll is %d, %d\n", r1 = roll(1, 6) , r2 = roll(1, 6));
if (currentPlayer->location == JAIL_SQUARE_NUMBER) {
wasInJail++;
if (!checkForDoubles(r1, r2)) {
currentPlayerNumber++;
return;
}
}
else {
if (r1 == r2 &&++numberOfDoubles == 3) {
printf("That's 3 doubles. You go to jail\n");
gotoJail();
currentPlayerNumber++;
return;
}
move(r1 + r2);
}
if (r1 != r2 || wasInJail) {
currentPlayerNumber++;
}
return;
}
void move(int rl) {
int oldLocation;
oldLocation = currentPlayer->location;
currentPlayer->location = (currentPlayer->location + rl) % NUMBER_OF_SQUARES;
if (currentPlayer->location < oldLocation && rl > 0) {
currentPlayer->money += 200;
printf("You pass %s and get $200\n", board[0].name);
}
showMove();
}
void showMove() {
Square * square;
square = & board[currentPlayer->location];
printf("That puts you on %s\n", square->name);
switch (square->type) {
case TYPE_SAFE:
printf("That is a safe place\n");
break;
case TYPE_COMMUNITY_CHEST:
pickCommunityChestCard();
break;
case TYPE_CHANCE:
pickChanceCard();
break;
case TYPE_INCOME_TAX:
incomeTax();
break;
case TYPE_GOTO_JAIL:
gotoJail();
break;
case TYPE_LUXURY_TAX:
luxuryTax();
break;
case TYPE_PROPERTY:
case TYPE_RAILROAD:
case TYPE_UTIL:
if (square->owner < 0) {
printf("That would cost $%d\n", square->cost);
if (getYesOrNo("Do you want to buy? ") == 0) {
buy(currentPlayerNumber, square);
currentPlayer->money -= square->cost;
}
else {
if (numberOfPlayers > 2) {
bid();
}
}
}
else {
if (square->owner == currentPlayerNumber) {
printf("You own it.\n");
}
else {
rent(square);
}
}
}
}
public static void saveGame() {
}
public static void restoreGame() {
char * sp;
printf("Which file do you wish to restore from? ");
for (sp = buf;( * sp = getchar()) != '\n';sp++) {
continue;
}
* sp = '\0';
restoreFromFile(buf);
}
int restoreFromFile(char * file) {
return true;
}
| static char[] sccsid = "@(#)execute.c 5.5 (Berkeley) 2/28/91";
public final static int SEGSIZE = 8192;
static char[257] buf;
static String[] yn_only = {
"yes",
"no"}
;
static boolean currentPlayerNumber;
void execute(int answer) {
currentPlayerNumber = false;
Invoker.invoke(functions[answer]) notify1();
fixupPrompt();
if (currentPlayerNumber) {
nextPlayer();
}
else {
if (numberOfDoubles) {
printf("%s rolled doubles. Goes again\n", currentPlayer->name);
}
}
}
public static void doMove() {
int r1;
int r2;
boolean wasInJail;
currentPlayerNumber = wasInJail = false;
printf("roll is %d, %d\n", r1 = roll(1, 6) , r2 = roll(1, 6));
if (currentPlayer->location == JAIL_SQUARE_NUMBER) {
wasInJail++;
if (!checkForDoubles(r1, r2)) {
currentPlayerNumber++;
return;
}
}
else {
if (r1 == r2 &&++numberOfDoubles == 3) {
printf("That's 3 doubles. You go to jail\n");
gotoJail();
currentPlayerNumber++;
return;
}
move(r1 + r2);
}
if (r1 != r2 || wasInJail) {
currentPlayerNumber++;
}
return;
}
void move(int rl) {
int oldLocation;
oldLocation = currentPlayer->location;
currentPlayer->location = (currentPlayer->location + rl) % NUMBER_OF_SQUARES;
if (currentPlayer->location < oldLocation && rl > 0) {
currentPlayer->money += 200;
printf("You pass %s and get $200\n", board[0].name);
}
showMove();
}
void showMove() {
Square * square1;
square1 = & board[currentPlayer->location];
printf("That puts you on %s\n", square1->name);
switch (square1->type) {
case TYPE_SAFE:
printf("That is a safe place\n");
break;
case TYPE_COMMUNITY_CHEST:
pickCommunityChestCard();
break;
case TYPE_CHANCE:
pickChanceCard();
break;
case TYPE_INCOME_TAX:
incomeTax();
break;
case TYPE_GOTO_JAIL:
gotoJail();
break;
case TYPE_LUXURY_TAX:
luxuryTax();
break;
case TYPE_PROPERTY:
case TYPE_RAILROAD:
case TYPE_UTIL:
if (square1->owner < 0) {
printf("That would cost $%d\n", square1->cost);
if (getYesOrNo("Do you want to buy? ") == 0) {
buy(currentPlayerNumber, square1);
currentPlayer->money -= square1->cost;
}
else {
if (numberOfPlayers > 2) {
bid();
}
}
}
else {
if (square1->owner == currentPlayerNumber) {
printf("You own it.\n");
}
else {
rent(square1);
}
}
}
}
public static void saveGame() {
}
public static void restoreGame() {
char * sp;
printf("Which file do you wish to restore from? ");
for (sp = buf;( * sp = getchar()) != '\n';sp++) {
continue;
}
* sp = '\0';
restoreFromFile(buf);
}
int restoreFromFile(char * file) {
return true;
}
| static char[] sccsid = "@(#)execute.c 5.5 (Berkeley) 2/28/91";
public final static int SEGSIZE = 8192;
static char[257] buf;
static String[] yn_only = {
"yes",
"no"}
;
static boolean currentPlayerNumber;
void execute(int answer) {
currentPlayerNumber = false;
Invoker.invoke(Monop.functions[answer]) notify1();
fixupPrompt();
if (currentPlayerNumber) {
nextPlayer();
}
else {
if (Monop.numberOfDoubles) {
printf("%s rolled doubles. Goes again\n", Monop.currentPlayer->name);
}
}
}
public static void doMove() {
int r1;
int r2;
boolean wasInJail;
currentPlayerNumber = wasInJail = false;
printf("roll is %d, %d\n", r1 = roll(1, 6) , r2 = roll(1, 6));
if (Monop.currentPlayer->location == JAIL_SQUARE_NUMBER) {
wasInJail++;
if (!checkForDoubles(r1, r2)) {
currentPlayerNumber++;
return;
}
}
else {
if (r1 == r2 &&++Monop.numberOfDoubles == 3) {
printf("That's 3 doubles. You go to jail\n");
gotoJail();
currentPlayerNumber++;
return;
}
move(r1 + r2);
}
if (r1 != r2 || wasInJail) {
currentPlayerNumber++;
}
return;
}
void move(int rl) {
int oldLocation;
oldLocation = Monop.currentPlayer->location;
Monop.currentPlayer->location = (Monop.currentPlayer->location + rl) % NUMBER_OF_SQUARES;
if (Monop.currentPlayer->location < oldLocation && rl > 0) {
Monop.currentPlayer->money += 200;
printf("You pass %s and get $200\n", Monop.board[0].name);
}
showMove();
}
void showMove() {
Square * square1;
square1 = & Monop.board[Monop.currentPlayer->location];
printf("That puts you on %s\n", square1->name);
switch (square1->type) {
case TYPE_SAFE:
printf("That is a safe place\n");
break;
case TYPE_COMMUNITY_CHEST:
pickCommunityChestCard();
break;
case TYPE_CHANCE:
pickChanceCard();
break;
case TYPE_INCOME_TAX:
incomeTax();
break;
case TYPE_GOTO_JAIL:
gotoJail();
break;
case TYPE_LUXURY_TAX:
luxuryTax();
break;
case TYPE_PROPERTY:
case TYPE_RAILROAD:
case TYPE_UTIL:
if (square1->owner < 0) {
printf("That would cost $%d\n", square1->cost);
if (getYesOrNo("Do you want to buy? ") == 0) {
buy(currentPlayerNumber, square1);
Monop.currentPlayer->money -= square1->cost;
}
else {
if (Monop.numberOfPlayers > 2) {
bid();
}
}
}
else {
if (square1->owner == currentPlayerNumber) {
printf("You own it.\n");
}
else {
rent(square1);
}
}
}
}
public static void saveGame() {
}
public static void restoreGame() {
char * sp;
printf("Which file do you wish to restore from? ");
for (sp = buf;( * sp = getchar()) != '\n';sp++) {
continue;
}
* sp = '\0';
restoreFromFile(buf);
}
int restoreFromFile(char * file) {
return true;
}
| static char[] sccsid = "@(#)execute.c 5.5 (Berkeley) 2/28/91";
public final static int SEGSIZE = 8192;
static char[257] buf;
static String[] yn_only = {
"yes",
"no"}
;
static boolean currentPlayerNumber;
static void execute(int answer) {
currentPlayerNumber = false;
Invoker.invoke(Monop.functions[answer]) Misc.notify1();
Mortgage.fixupPrompt();
if (currentPlayerNumber) {
Misc.nextPlayer();
}
else {
if (Monop.numberOfDoubles) {
printf("%s rolled doubles. Goes again\n", Monop.currentPlayer->name);
}
}
}
public static void doMove() {
int r1;
int r2;
boolean wasInJail;
currentPlayerNumber = wasInJail = false;
printf("roll is %d, %d\n", r1 = Roll.roll(1, 6) , r2 = Roll.roll(1, 6));
if (Monop.currentPlayer->location == JAIL_SQUARE_NUMBER) {
wasInJail++;
if (!Jail.checkForDoubles(r1, r2)) {
currentPlayerNumber++;
return;
}
}
else {
if (r1 == r2 &&++Monop.numberOfDoubles == 3) {
printf("That's 3 doubles. You go to jail\n");
SpecialMoves.gotoJail();
currentPlayerNumber++;
return;
}
move(r1 + r2);
}
if (r1 != r2 || wasInJail) {
currentPlayerNumber++;
}
return;
}
static void move(int rl) {
int oldLocation;
oldLocation = Monop.currentPlayer->location;
Monop.currentPlayer->location = (Monop.currentPlayer->location + rl) % NUMBER_OF_SQUARES;
if (Monop.currentPlayer->location < oldLocation && rl > 0) {
Monop.currentPlayer->money += 200;
printf("You pass %s and get $200\n", Monop.board[0].name);
}
showMove();
}
void showMove() {
Square * square1;
square1 = & Monop.board[Monop.currentPlayer->location];
printf("That puts you on %s\n", square1->name);
switch (square1->type) {
case TYPE_SAFE:
printf("That is a safe place\n");
break;
case TYPE_COMMUNITY_CHEST:
SpecialMoves.pickCommunityChestCard();
break;
case TYPE_CHANCE:
SpecialMoves.pickChanceCard();
break;
case TYPE_INCOME_TAX:
SpecialMoves.incomeTax();
break;
case TYPE_GOTO_JAIL:
SpecialMoves.gotoJail();
break;
case TYPE_LUXURY_TAX:
SpecialMoves.luxuryTax();
break;
case TYPE_PROPERTY:
case TYPE_RAILROAD:
case TYPE_UTIL:
if (square1->owner < 0) {
printf("That would cost $%d\n", square1->cost);
if (Misc.getYesOrNo("Do you want to buy? ") == 0) {
PropertyFunctions.buy(currentPlayerNumber, square1);
Monop.currentPlayer->money -= square1->cost;
}
else {
if (Monop.numberOfPlayers > 2) {
PropertyFunctions.bid();
}
}
}
else {
if (square1->owner == currentPlayerNumber) {
printf("You own it.\n");
}
else {
Rent.rent(square1);
}
}
}
}
public static void saveGame() {
}
public static void restoreGame() {
char * sp;
printf("Which file do you wish to restore from? ");
for (sp = buf;( * sp = getchar()) != '\n';sp++) {
continue;
}
* sp = '\0';
restoreFromFile(buf);
}
static int restoreFromFile(char * file) {
return true;
}
| static char[] sccsid = "@(#)execute.c 5.5 (Berkeley) 2/28/91";
public final static int SEGSIZE = 8192;
static char[257] buf;
static String[] yn_only = {
"yes",
"no"}
;
static boolean currentPlayerNumber;
static void execute(int answer) {
currentPlayerNumber = false;
Invoker.invoke(Monop.functions[answer]) Misc.notify1();
Mortgage.fixupPrompt();
if (currentPlayerNumber) {
Misc.nextPlayer();
}
else {
if (Monop.numberOfDoubles) {
printf("%s rolled doubles. Goes again\n", Monop.currentPlayer->name);
}
}
}
public static void doMove() {
int r1;
int r2;
boolean wasInJail;
wasInJail = false;
currentPlayerNumber = wasInJail;
printf("roll is %d, %d\n", r1 = Roll.roll(1, 6) , r2 = Roll.roll(1, 6));
if (Monop.currentPlayer->location == JAIL_SQUARE_NUMBER) {
wasInJail++;
if (!Jail.checkForDoubles(r1, r2)) {
currentPlayerNumber++;
return;
}
}
else {
if (r1 == r2 &&++Monop.numberOfDoubles == 3) {
printf("That's 3 doubles. You go to jail\n");
SpecialMoves.gotoJail();
currentPlayerNumber++;
return;
}
move(r1 + r2);
}
if (r1 != r2 || wasInJail) {
currentPlayerNumber++;
}
return;
}
static void move(int rl) {
int oldLocation;
oldLocation = Monop.currentPlayer->location;
Monop.currentPlayer->location = (Monop.currentPlayer->location + rl) % NUMBER_OF_SQUARES;
if (Monop.currentPlayer->location < oldLocation && rl > 0) {
Monop.currentPlayer->money += 200;
printf("You pass %s and get $200\n", Monop.board[0].name);
}
showMove();
}
void showMove() {
Square * square1;
square1 = & Monop.board[Monop.currentPlayer->location];
printf("That puts you on %s\n", square1->name);
switch (square1->type) {
case TYPE_SAFE:
printf("That is a safe place\n");
break;
case TYPE_COMMUNITY_CHEST:
SpecialMoves.pickCommunityChestCard();
break;
case TYPE_CHANCE:
SpecialMoves.pickChanceCard();
break;
case TYPE_INCOME_TAX:
SpecialMoves.incomeTax();
break;
case TYPE_GOTO_JAIL:
SpecialMoves.gotoJail();
break;
case TYPE_LUXURY_TAX:
SpecialMoves.luxuryTax();
break;
case TYPE_PROPERTY:
case TYPE_RAILROAD:
case TYPE_UTIL:
if (square1->owner < 0) {
printf("That would cost $%d\n", square1->cost);
if (Misc.getYesOrNo("Do you want to buy? ") == 0) {
PropertyFunctions.buy(currentPlayerNumber, square1);
Monop.currentPlayer->money -= square1->cost;
}
else {
if (Monop.numberOfPlayers > 2) {
PropertyFunctions.bid();
}
}
}
else {
if (square1->owner == currentPlayerNumber) {
printf("You own it.\n");
}
else {
Rent.rent(square1);
}
}
}
}
public static void saveGame() {
}
public static void restoreGame() {
char * sp;
printf("Which file do you wish to restore from? ");
for (sp = buf;( * sp = getchar()) != '\n';sp++) {
continue;
}
* sp = '\0';
restoreFromFile(buf);
}
static int restoreFromFile(char * file) {
return true;
}
| static char[] sccsid = "@(#)execute.c 5.5 (Berkeley) 2/28/91";
public final static int SEGSIZE = 8192;
static char[257] buf;
static String[] yn_only = {
"yes",
"no"}
;
static boolean currentPlayerNumber;
static void execute(int answer) {
currentPlayerNumber = false;
Invoker.invoke(Monop.functions[answer]) Misc.notify1();
Mortgage.fixupPrompt();
if (currentPlayerNumber) {
Misc.nextPlayer();
}
else {
if (Monop.numberOfDoubles) {
printf("%s rolled doubles. Goes again\n", Monop.currentPlayer->name);
}
}
}
public static void doMove() {
int r1;
int r2;
boolean wasInJail;
wasInJail = false;
currentPlayerNumber = wasInJail;
printf("roll is %d, %d\n", r1 = Roll.roll(1, 6) , r2 = Roll.roll(1, 6));
if (Monop.currentPlayer->location == JAIL_SQUARE_NUMBER) {
wasInJail++;
if (!Jail.checkForDoubles(r1, r2)) {
currentPlayerNumber++;
return;
}
}
else {
if (r1 == r2 &&++Monop.numberOfDoubles == 3) {
printf("That's 3 doubles. You go to jail\n");
SpecialMoves.gotoJail();
currentPlayerNumber++;
return;
}
move(r1 + r2);
}
if (r1 != r2 || wasInJail) {
currentPlayerNumber++;
}
return;
}
static void move(int rl) {
int oldLocation;
oldLocation = Monop.currentPlayer->location;
Monop.currentPlayer->location = (Monop.currentPlayer->location + rl) % NUMBER_OF_SQUARES;
if (Monop.currentPlayer->location < oldLocation && rl > 0) {
Monop.currentPlayer->money += 200;
printf("You pass %s and get $200\n", Monop.board[0].name);
}
showMove();
}
void showMove() {
Square * square1;
square1 = & Monop.board[Monop.currentPlayer->location];
printf("That puts you on %s\n", square1->name);
switch (square1->type) {
case TYPE_SAFE:
printf("That is a safe place\n");
break;
case TYPE_COMMUNITY_CHEST:
SpecialMoves.pickCommunityChestCard();
break;
case TYPE_CHANCE:
SpecialMoves.pickChanceCard();
break;
case TYPE_INCOME_TAX:
SpecialMoves.incomeTax();
break;
case TYPE_GOTO_JAIL:
SpecialMoves.gotoJail();
break;
case TYPE_LUXURY_TAX:
SpecialMoves.luxuryTax();
break;
case TYPE_PROPERTY:
case TYPE_RAILROAD:
case TYPE_UTIL:
if (square1->owner < 0) {
printf("That would cost $%d\n", square1->cost);
if (Misc.getYesOrNo("Do you want to buy? ") == 0) {
PropertyFunctions.buy(currentPlayerNumber, square1);
Monop.currentPlayer->money -= square1->cost;
}
else {
if (Monop.numberOfPlayers > 2) {
PropertyFunctions.bid();
}
}
}
else {
if (square1->owner == currentPlayerNumber) {
printf("You own it.\n");
}
else {
Rent.rent(square1);
}
}
}
}
public static void saveGame() {
}
public static void restoreGame() {
char * sp;
printf("Which file do you wish to restore from? ");
buf = stdin.readLine();
* sp = '\0';
restoreFromFile(buf);
}
static int restoreFromFile(char * file) {
return true;
}
| static char[] sccsid = "@(#)execute.c 5.5 (Berkeley) 2/28/91";
public final static int SEGSIZE = 8192;
static char[] buf = new char[257];
static String[] yn_only = {
"yes",
"no"}
;
static boolean currentPlayerNumber;
static void execute(int answer) {
currentPlayerNumber = false;
Invoker.invoke(Monop.functions[answer]) Misc.notify1();
Mortgage.fixupPrompt();
if (currentPlayerNumber) {
Misc.nextPlayer();
}
else {
if (Monop.numberOfDoubles) {
printf("%s rolled doubles. Goes again\n", Monop.currentPlayer->name);
}
}
}
public static void doMove() {
int r1;
int r2;
boolean wasInJail;
wasInJail = false;
currentPlayerNumber = wasInJail;
printf("roll is %d, %d\n", r1 = Roll.roll(1, 6) , r2 = Roll.roll(1, 6));
if (Monop.currentPlayer->location == JAIL_SQUARE_NUMBER) {
wasInJail++;
if (!Jail.checkForDoubles(r1, r2)) {
currentPlayerNumber++;
return;
}
}
else {
if (r1 == r2 &&++Monop.numberOfDoubles == 3) {
printf("That's 3 doubles. You go to jail\n");
SpecialMoves.gotoJail();
currentPlayerNumber++;
return;
}
move(r1 + r2);
}
if (r1 != r2 || wasInJail) {
currentPlayerNumber++;
}
return;
}
static void move(int rl) {
int oldLocation;
oldLocation = Monop.currentPlayer->location;
Monop.currentPlayer->location = (Monop.currentPlayer->location + rl) % NUMBER_OF_SQUARES;
if (Monop.currentPlayer->location < oldLocation && rl > 0) {
Monop.currentPlayer->money += 200;
printf("You pass %s and get $200\n", Monop.board[0].name);
}
showMove();
}
void showMove() {
Square * square1;
square1 = & Monop.board[Monop.currentPlayer->location];
printf("That puts you on %s\n", square1->name);
switch (square1->type) {
case TYPE_SAFE:
printf("That is a safe place\n");
break;
case TYPE_COMMUNITY_CHEST:
SpecialMoves.pickCommunityChestCard();
break;
case TYPE_CHANCE:
SpecialMoves.pickChanceCard();
break;
case TYPE_INCOME_TAX:
SpecialMoves.incomeTax();
break;
case TYPE_GOTO_JAIL:
SpecialMoves.gotoJail();
break;
case TYPE_LUXURY_TAX:
SpecialMoves.luxuryTax();
break;
case TYPE_PROPERTY:
case TYPE_RAILROAD:
case TYPE_UTIL:
if (square1->owner < 0) {
printf("That would cost $%d\n", square1->cost);
if (Misc.getYesOrNo("Do you want to buy? ") == 0) {
PropertyFunctions.buy(currentPlayerNumber, square1);
Monop.currentPlayer->money -= square1->cost;
}
else {
if (Monop.numberOfPlayers > 2) {
PropertyFunctions.bid();
}
}
}
else {
if (square1->owner == currentPlayerNumber) {
printf("You own it.\n");
}
else {
Rent.rent(square1);
}
}
}
}
public static void saveGame() {
}
public static void restoreGame() {
char * sp;
printf("Which file do you wish to restore from? ");
buf = stdin.readLine();
* sp = '\0';
restoreFromFile(buf);
}
static int restoreFromFile(char * file) {
return true;
}
| static String sccsid = "@(#)execute.c 5.5 (Berkeley) 2/28/91";
public final static int SEGSIZE = 8192;
static String buf = new String();
static String[] yn_only = "";
static boolean currentPlayerNumber;
static void execute(int answer) {
currentPlayerNumber = false;
Invoker.invoke(Monop.functions[answer]) Misc.notify1();
Mortgage.fixupPrompt();
if (currentPlayerNumber) {
Misc.nextPlayer();
}
else {
if (Monop.numberOfDoubles) {
printf("%s rolled doubles. Goes again\n", Monop.currentPlayer->name);
}
}
}
public static void doMove() {
int r1;
int r2;
boolean wasInJail;
wasInJail = false;
currentPlayerNumber = wasInJail;
printf("roll is %d, %d\n", r1 = Roll.roll(1, 6) , r2 = Roll.roll(1, 6));
if (Monop.currentPlayer->location == JAIL_SQUARE_NUMBER) {
wasInJail++;
if (!Jail.checkForDoubles(r1, r2)) {
currentPlayerNumber++;
return;
}
}
else {
if (r1 == r2 &&++Monop.numberOfDoubles == 3) {
printf("That's 3 doubles. You go to jail\n");
SpecialMoves.gotoJail();
currentPlayerNumber++;
return;
}
move(r1 + r2);
}
if (r1 != r2 || wasInJail) {
currentPlayerNumber++;
}
return;
}
static void move(int rl) {
int oldLocation;
oldLocation = Monop.currentPlayer->location;
Monop.currentPlayer->location = (Monop.currentPlayer->location + rl) % NUMBER_OF_SQUARES;
if (Monop.currentPlayer->location < oldLocation && rl > 0) {
Monop.currentPlayer->money += 200;
printf("You pass %s and get $200\n", Monop.board[0].name);
}
showMove();
}
void showMove() {
Square * square1;
square1 = & Monop.board[Monop.currentPlayer->location];
printf("That puts you on %s\n", square1->name);
switch (square1->type) {
case TYPE_SAFE:
printf("That is a safe place\n");
break;
case TYPE_COMMUNITY_CHEST:
SpecialMoves.pickCommunityChestCard();
break;
case TYPE_CHANCE:
SpecialMoves.pickChanceCard();
break;
case TYPE_INCOME_TAX:
SpecialMoves.incomeTax();
break;
case TYPE_GOTO_JAIL:
SpecialMoves.gotoJail();
break;
case TYPE_LUXURY_TAX:
SpecialMoves.luxuryTax();
break;
case TYPE_PROPERTY:
case TYPE_RAILROAD:
case TYPE_UTIL:
if (square1->owner < 0) {
printf("That would cost $%d\n", square1->cost);
if (Misc.getYesOrNo("Do you want to buy? ") == 0) {
PropertyFunctions.buy(currentPlayerNumber, square1);
Monop.currentPlayer->money -= square1->cost;
}
else {
if (Monop.numberOfPlayers > 2) {
PropertyFunctions.bid();
}
}
}
else {
if (square1->owner == currentPlayerNumber) {
printf("You own it.\n");
}
else {
Rent.rent(square1);
}
}
}
}
public static void saveGame() {
}
public static void restoreGame() {
String sp;
printf("Which file do you wish to restore from? ");
buf = stdin.readLine();
sp = "";
restoreFromFile(buf);
}
static int restoreFromFile(String file) {
return true;
}
| static String sccsid;
sccsid = "@(#)execute.c 5.5 (Berkeley) 2/28/91";
public final static int SEGSIZE;
SEGSIZE = 8192;
static String buf;
buf = new String();
static String[] yn_only;
yn_only = "";
static boolean currentPlayerNumber;
static void execute(int answer) {
currentPlayerNumber = false;
Invoker.invoke(Monop.functions[answer]) Misc.notify1();
Mortgage.fixupPrompt();
if (currentPlayerNumber) {
Misc.nextPlayer();
}
else {
if (Monop.numberOfDoubles) {
printf("%s rolled doubles. Goes again\n", Monop.currentPlayer->name);
}
}
}
public static void doMove() {
int r1;
int r2;
boolean wasInJail;
wasInJail = false;
currentPlayerNumber = wasInJail;
printf("roll is %d, %d\n", r1 = Roll.roll(1, 6) , r2 = Roll.roll(1, 6));
if (Monop.currentPlayer->location == JAIL_SQUARE_NUMBER) {
wasInJail++;
if (!Jail.checkForDoubles(r1, r2)) {
currentPlayerNumber++;
return;
}
}
else {
if (r1 == r2 &&++Monop.numberOfDoubles == 3) {
printf("That's 3 doubles. You go to jail\n");
SpecialMoves.gotoJail();
currentPlayerNumber++;
return;
}
move(r1 + r2);
}
if (r1 != r2 || wasInJail) {
currentPlayerNumber++;
}
return;
}
static void move(int rl) {
int oldLocation;
oldLocation = Monop.currentPlayer->location;
Monop.currentPlayer->location = (Monop.currentPlayer->location + rl) % NUMBER_OF_SQUARES;
if (Monop.currentPlayer->location < oldLocation && rl > 0) {
Monop.currentPlayer->money += 200;
printf("You pass %s and get $200\n", Monop.board[0].name);
}
showMove();
}
void showMove() {
Square * square1;
square1 = & Monop.board[Monop.currentPlayer->location];
printf("That puts you on %s\n", square1->name);
switch (square1->type) {
case TYPE_SAFE:
printf("That is a safe place\n");
break;
case TYPE_COMMUNITY_CHEST:
SpecialMoves.pickCommunityChestCard();
break;
case TYPE_CHANCE:
SpecialMoves.pickChanceCard();
break;
case TYPE_INCOME_TAX:
SpecialMoves.incomeTax();
break;
case TYPE_GOTO_JAIL:
SpecialMoves.gotoJail();
break;
case TYPE_LUXURY_TAX:
SpecialMoves.luxuryTax();
break;
case TYPE_PROPERTY:
case TYPE_RAILROAD:
case TYPE_UTIL:
if (square1->owner < 0) {
printf("That would cost $%d\n", square1->cost);
if (Misc.getYesOrNo("Do you want to buy? ") == 0) {
PropertyFunctions.buy(currentPlayerNumber, square1);
Monop.currentPlayer->money -= square1->cost;
}
else {
if (Monop.numberOfPlayers > 2) {
PropertyFunctions.bid();
}
}
}
else {
if (square1->owner == currentPlayerNumber) {
printf("You own it.\n");
}
else {
Rent.rent(square1);
}
}
}
}
public static void saveGame() {
}
public static void restoreGame() {
String sp;
printf("Which file do you wish to restore from? ");
buf = stdin.readLine();
sp = "";
restoreFromFile(buf);
}
static int restoreFromFile(String file) {
return true;
}
| static String sccsid;
sccsid = "@(#)execute.c 5.5 (Berkeley) 2/28/91";
public final static int SEGSIZE;
SEGSIZE = 8192;
static String buf;
buf = new String();
static String yn_only;
yn_only = "";
static boolean currentPlayerNumber;
static void execute(int answer) {
currentPlayerNumber = false;
Invoker.invoke(Monop.functions[answer]) Misc.notify1();
Mortgage.fixupPrompt();
if (currentPlayerNumber) {
Misc.nextPlayer();
}
else {
if (Monop.numberOfDoubles) {
printf("%s rolled doubles. Goes again\n", Monop.currentPlayer.name);
}
}
}
public static void doMove() {
int r1;
int r2;
boolean wasInJail;
wasInJail = false;
currentPlayerNumber = wasInJail;
printf("roll is %d, %d\n", r1 = Roll.roll(1, 6) , r2 = Roll.roll(1, 6));
if (Monop.currentPlayer.location == JAIL_SQUARE_NUMBER) {
wasInJail++;
if (!Jail.checkForDoubles(r1, r2)) {
currentPlayerNumber++;
return;
}
}
else {
if (r1 == r2 &&++Monop.numberOfDoubles == 3) {
printf("That's 3 doubles. You go to jail\n");
SpecialMoves.gotoJail();
currentPlayerNumber++;
return;
}
move(r1 + r2);
}
if (r1 != r2 || wasInJail) {
currentPlayerNumber++;
}
return;
}
static void move(int rl) {
int oldLocation;
oldLocation = Monop.currentPlayer.location;
Monop.currentPlayer.location = (Monop.currentPlayer.location + rl) % NUMBER_OF_SQUARES;
if (Monop.currentPlayer.location < oldLocation && rl > 0) {
Monop.currentPlayer.money += 200;
printf("You pass %s and get $200\n", Monop.board[0].name);
}
showMove();
}
void showMove() {
Square square1;
square1 = Monop.board[Monop.currentPlayer.location];
printf("That puts you on %s\n", square1.name);
switch (square1.type) {
case TYPE_SAFE:
printf("That is a safe place\n");
break;
case TYPE_COMMUNITY_CHEST:
SpecialMoves.pickCommunityChestCard();
break;
case TYPE_CHANCE:
SpecialMoves.pickChanceCard();
break;
case TYPE_INCOME_TAX:
SpecialMoves.incomeTax();
break;
case TYPE_GOTO_JAIL:
SpecialMoves.gotoJail();
break;
case TYPE_LUXURY_TAX:
SpecialMoves.luxuryTax();
break;
case TYPE_PROPERTY:
case TYPE_RAILROAD:
case TYPE_UTIL:
if (square1.owner < 0) {
printf("That would cost $%d\n", square1.cost);
if (Misc.getYesOrNo("Do you want to buy? ") == 0) {
PropertyFunctions.buy(currentPlayerNumber, square1);
Monop.currentPlayer.money -= square1.cost;
}
else {
if (Monop.numberOfPlayers > 2) {
PropertyFunctions.bid();
}
}
}
else {
if (square1.owner == currentPlayerNumber) {
printf("You own it.\n");
}
else {
Rent.rent(square1);
}
}
}
}
public static void saveGame() {
}
public static void restoreGame() {
String sp;
printf("Which file do you wish to restore from? ");
buf = stdin.readLine();
sp = "";
restoreFromFile(buf);
}
static int restoreFromFile(String file) {
return true;
}
| static String sccsid;
sccsid = "@(#)execute.c 5.5 (Berkeley) 2/28/91";
public final static int SEGSIZE;
SEGSIZE = 8192;
static String buf;
buf = new String();
static String yn_only;
yn_only = "";
static boolean currentPlayerNumber;
static void execute(int answer) {
currentPlayerNumber = false;
Invoker.invoke(Monop.functions[answer]) Misc.notify1();
Mortgage.fixupPrompt();
if (currentPlayerNumber) {
Misc.nextPlayer();
}
else {
if (Monop.numberOfDoubles) {
printf("%s rolled doubles. Goes again\n", Monop.currentPlayer.name);
}
}
}
public static void doMove() {
int r1;
int r2;
boolean wasInJail;
wasInJail = false;
currentPlayerNumber = wasInJail;
printf("roll is %d, %d\n", r1 = Roll.roll(1, 6) , r2 = Roll.roll(1, 6));
if (Monop.currentPlayer.location == JAIL_SQUARE_NUMBER) {
wasInJail++;
if (!Jail.checkForDoubles(r1, r2)) {
currentPlayerNumber++;
return;
}
}
else {
if (r1 == r2 &&++Monop.numberOfDoubles == 3) {
printf("That's 3 doubles. You go to jail\n");
SpecialMoves.gotoJail();
currentPlayerNumber++;
return;
}
move(r1 + r2);
}
if (r1 != r2 || wasInJail) {
currentPlayerNumber++;
}
return;
}
static void move(int rl) {
int oldLocation;
oldLocation = Monop.currentPlayer.location;
Monop.currentPlayer.location = (Monop.currentPlayer.location + rl) % NUMBER_OF_SQUARES;
if (Monop.currentPlayer.location < oldLocation && rl > 0) {
Monop.currentPlayer.money += 200;
printf("You pass %s and get $200\n", Monop.board[0].name);
}
showMove();
}
void showMove() {
Square square1;
square1 = Monop.board[Monop.currentPlayer.location];
printf("That puts you on %s\n", square1.name);
switch (square1.type) {
case TYPE_SAFE:
printf("That is a safe place\n");
break;
case TYPE_COMMUNITY_CHEST:
SpecialMoves.pickCommunityChestCard();
break;
case TYPE_CHANCE:
SpecialMoves.pickChanceCard();
break;
case TYPE_INCOME_TAX:
SpecialMoves.incomeTax();
break;
case TYPE_GOTO_JAIL:
SpecialMoves.gotoJail();
break;
case TYPE_LUXURY_TAX:
SpecialMoves.luxuryTax();
break;
case TYPE_PROPERTY:
case TYPE_RAILROAD:
case TYPE_UTIL:
if (square1.owner < 0) {
printf("That would cost $%d\n", square1.cost);
if (Misc.getYesOrNo("Do you want to buy? ") == 0) {
PropertyFunctions.buy(currentPlayerNumber, square1);
Monop.currentPlayer.money -= square1.cost;
}
else {
if (Monop.numberOfPlayers > 2) {
PropertyFunctions.bid();
}
}
}
else {
if (square1.owner == currentPlayerNumber) {
printf("You own it.\n");
}
else {
Rent.rent(square1);
}
}
}
}
public static void saveGame() {
}
public static void restoreGame() {
String sp;
printf("Which file do you wish to restore from? ");
buf = stdin.readLine();
sp = "";
restoreFromFile(buf);
}
static boolean restoreFromFile(String file) {
return true;
}
| static String sccsid;
sccsid = "@(#)execute.c 5.5 (Berkeley) 2/28/91";
public final static int SEGSIZE;
SEGSIZE = 8192;
static String buf;
buf = new String();
static String yn_only;
yn_only = "";
static boolean currentPlayerNumber;
static void execute(int answer) {
currentPlayerNumber = false;
Invoker.invoke(Monop.functions[answer]) Misc.notify1();
Mortgage.fixupPrompt();
if (currentPlayerNumber) {
Misc.nextPlayer();
}
else {
if (Monop.numberOfDoubles) {
printf("%s rolled doubles. Goes again\n", Monop.currentPlayer.name);
}
}
}
public static void doMove() {
int r1;
int r2;
boolean wasInJail;
wasInJail = false;
currentPlayerNumber = wasInJail;
printf("roll is %d, %d\n", r1 = Roll.roll(1, 6) , r2 = Roll.roll(1, 6));
if (Monop.currentPlayer.location == JAIL_SQUARE_NUMBER) {
wasInJail = true;
if (!Jail.checkForDoubles(r1, r2)) {
currentPlayerNumber++;
return;
}
}
else {
if (r1 == r2 &&++Monop.numberOfDoubles == 3) {
printf("That's 3 doubles. You go to jail\n");
SpecialMoves.gotoJail();
currentPlayerNumber++;
return;
}
move(r1 + r2);
}
if (r1 != r2 || wasInJail) {
currentPlayerNumber++;
}
return;
}
static void move(int rl) {
int oldLocation;
oldLocation = Monop.currentPlayer.location;
Monop.currentPlayer.location = (Monop.currentPlayer.location + rl) % NUMBER_OF_SQUARES;
if (Monop.currentPlayer.location < oldLocation && rl > 0) {
Monop.currentPlayer.money += 200;
printf("You pass %s and get $200\n", Monop.board[0].name);
}
showMove();
}
void showMove() {
Square square1;
square1 = Monop.board[Monop.currentPlayer.location];
printf("That puts you on %s\n", square1.name);
switch (square1.type) {
case TYPE_SAFE:
printf("That is a safe place\n");
break;
case TYPE_COMMUNITY_CHEST:
SpecialMoves.pickCommunityChestCard();
break;
case TYPE_CHANCE:
SpecialMoves.pickChanceCard();
break;
case TYPE_INCOME_TAX:
SpecialMoves.incomeTax();
break;
case TYPE_GOTO_JAIL:
SpecialMoves.gotoJail();
break;
case TYPE_LUXURY_TAX:
SpecialMoves.luxuryTax();
break;
case TYPE_PROPERTY:
case TYPE_RAILROAD:
case TYPE_UTIL:
if (square1.owner < 0) {
printf("That would cost $%d\n", square1.cost);
if (Misc.getYesOrNo("Do you want to buy? ") == 0) {
PropertyFunctions.buy(currentPlayerNumber, square1);
Monop.currentPlayer.money -= square1.cost;
}
else {
if (Monop.numberOfPlayers > 2) {
PropertyFunctions.bid();
}
}
}
else {
if (square1.owner == currentPlayerNumber) {
printf("You own it.\n");
}
else {
Rent.rent(square1);
}
}
}
}
public static void saveGame() {
}
public static void restoreGame() {
String sp;
printf("Which file do you wish to restore from? ");
buf = stdin.readLine();
sp = "";
restoreFromFile(buf);
}
static boolean restoreFromFile(String file) {
return true;
}
| static String sccsid;
sccsid = "@(#)execute.c 5.5 (Berkeley) 2/28/91";
public final static int SEGSIZE;
SEGSIZE = 8192;
static String buf;
buf = new String();
static String yn_only;
yn_only = "";
static boolean currentPlayerNumber;
static void execute(int answer) {
currentPlayerNumber = false;
Invoker.invoke(Monop.functions[answer]) Misc.notify1();
Mortgage.fixupPrompt();
if (currentPlayerNumber != 0) {
Misc.nextPlayer();
}
else {
if (Monop.numberOfDoubles != 0) {
printf("%s rolled doubles. Goes again\n", Monop.currentPlayer.name);
}
}
}
public static void doMove() {
int r1;
int r2;
boolean wasInJail;
wasInJail = false;
currentPlayerNumber = wasInJail;
printf("roll is %d, %d\n", r1 = Roll.roll(1, 6) , r2 = Roll.roll(1, 6));
if (Monop.currentPlayer.location == JAIL_SQUARE_NUMBER) {
wasInJail = true;
if (!Jail.checkForDoubles(r1, r2)) {
currentPlayerNumber++;
return;
}
}
else {
if (r1 == r2 &&++Monop.numberOfDoubles == 3) {
printf("That's 3 doubles. You go to jail\n");
SpecialMoves.gotoJail();
currentPlayerNumber++;
return;
}
move(r1 + r2);
}
if (r1 != r2 || wasInJail) {
currentPlayerNumber++;
}
return;
}
static void move(int rl) {
int oldLocation;
oldLocation = Monop.currentPlayer.location;
Monop.currentPlayer.location = (Monop.currentPlayer.location + rl) % NUMBER_OF_SQUARES;
if (Monop.currentPlayer.location < oldLocation && rl > 0) {
Monop.currentPlayer.money += 200;
printf("You pass %s and get $200\n", Monop.board[0].name);
}
showMove();
}
void showMove() {
Square square1;
square1 = Monop.board[Monop.currentPlayer.location];
printf("That puts you on %s\n", square1.name);
switch (square1.type) {
case TYPE_SAFE:
printf("That is a safe place\n");
break;
case TYPE_COMMUNITY_CHEST:
SpecialMoves.pickCommunityChestCard();
break;
case TYPE_CHANCE:
SpecialMoves.pickChanceCard();
break;
case TYPE_INCOME_TAX:
SpecialMoves.incomeTax();
break;
case TYPE_GOTO_JAIL:
SpecialMoves.gotoJail();
break;
case TYPE_LUXURY_TAX:
SpecialMoves.luxuryTax();
break;
case TYPE_PROPERTY:
case TYPE_RAILROAD:
case TYPE_UTIL:
if (square1.owner < 0) {
printf("That would cost $%d\n", square1.cost);
if (Misc.getYesOrNo("Do you want to buy? ") == 0) {
PropertyFunctions.buy(currentPlayerNumber, square1);
Monop.currentPlayer.money -= square1.cost;
}
else {
if (Monop.numberOfPlayers > 2) {
PropertyFunctions.bid();
}
}
}
else {
if (square1.owner == currentPlayerNumber) {
printf("You own it.\n");
}
else {
Rent.rent(square1);
}
}
}
}
public static void saveGame() {
}
public static void restoreGame() {
String sp;
printf("Which file do you wish to restore from? ");
buf = stdin.readLine();
sp = "";
restoreFromFile(buf);
}
static boolean restoreFromFile(String file) {
return true;
}
| static String sccsid;
sccsid = "@(#)execute.c 5.5 (Berkeley) 2/28/91";
public final static int SEGSIZE;
SEGSIZE = 8192;
static String buf;
buf = new String();
static String yn_only;
yn_only = "";
static boolean currentPlayerNumber;
static void execute(int answer) {
currentPlayerNumber = 0;
Invoker.invoke(Monop.functions[answer]) Misc.notify1();
Mortgage.fixupPrompt();
if (currentPlayerNumber != 0) {
Misc.nextPlayer();
}
else {
if (Monop.numberOfDoubles != 0) {
printf("%s rolled doubles. Goes again\n", Monop.currentPlayer.name);
}
}
}
public static void doMove() {
int r1;
int r2;
boolean wasInJail;
wasInJail = false;
currentPlayerNumber = wasInJail;
printf("roll is %d, %d\n", r1 = Roll.roll(1, 6) , r2 = Roll.roll(1, 6));
if (Monop.currentPlayer.location == JAIL_SQUARE_NUMBER) {
wasInJail = true;
if (!Jail.checkForDoubles(r1, r2)) {
currentPlayerNumber++;
return;
}
}
else {
if (r1 == r2 &&++Monop.numberOfDoubles == 3) {
printf("That's 3 doubles. You go to jail\n");
SpecialMoves.gotoJail();
currentPlayerNumber++;
return;
}
move(r1 + r2);
}
if (r1 != r2 || wasInJail) {
currentPlayerNumber++;
}
return;
}
static void move(int rl) {
int oldLocation;
oldLocation = Monop.currentPlayer.location;
Monop.currentPlayer.location = (Monop.currentPlayer.location + rl) % NUMBER_OF_SQUARES;
if (Monop.currentPlayer.location < oldLocation && rl > 0) {
Monop.currentPlayer.money += 200;
printf("You pass %s and get $200\n", Monop.board[0].name);
}
showMove();
}
void showMove() {
Square square1;
square1 = Monop.board[Monop.currentPlayer.location];
printf("That puts you on %s\n", square1.name);
switch (square1.type) {
case TYPE_SAFE:
printf("That is a safe place\n");
break;
case TYPE_COMMUNITY_CHEST:
SpecialMoves.pickCommunityChestCard();
break;
case TYPE_CHANCE:
SpecialMoves.pickChanceCard();
break;
case TYPE_INCOME_TAX:
SpecialMoves.incomeTax();
break;
case TYPE_GOTO_JAIL:
SpecialMoves.gotoJail();
break;
case TYPE_LUXURY_TAX:
SpecialMoves.luxuryTax();
break;
case TYPE_PROPERTY:
case TYPE_RAILROAD:
case TYPE_UTIL:
if (square1.owner < 0) {
printf("That would cost $%d\n", square1.cost);
if (Misc.getYesOrNo("Do you want to buy? ") == 0) {
PropertyFunctions.buy(currentPlayerNumber, square1);
Monop.currentPlayer.money -= square1.cost;
}
else {
if (Monop.numberOfPlayers > 2) {
PropertyFunctions.bid();
}
}
}
else {
if (square1.owner == currentPlayerNumber) {
printf("You own it.\n");
}
else {
Rent.rent(square1);
}
}
}
}
public static void saveGame() {
}
public static void restoreGame() {
String sp;
printf("Which file do you wish to restore from? ");
buf = stdin.readLine();
sp = "";
restoreFromFile(buf);
}
static boolean restoreFromFile(String file) {
return true;
}
| static String sccsid;
sccsid = "@(#)execute.c 5.5 (Berkeley) 2/28/91";
public final static int SEGSIZE;
SEGSIZE = 8192;
static String buf;
buf = new String();
static String yn_only;
yn_only = "";
static boolean currentPlayerNumber;
static void execute(int answer) {
currentPlayerNumber = 0;
Invoker.invoke(Monop.functions[answer]) Misc.notify1();
Mortgage.fixupPrompt();
if (currentPlayerNumber != 0) {
Misc.nextPlayer();
}
else {
if (Monop.numberOfDoubles != 0) {
fprintf(stdout, "%s rolled doubles. Goes again\n", Monop.currentPlayer.name);
}
}
}
public static void doMove() {
int r1;
int r2;
boolean wasInJail;
wasInJail = false;
currentPlayerNumber = wasInJail;
fprintf(stdout, "roll is %d, %d\n", r1 = Roll.roll(1, 6) , r2 = Roll.roll(1, 6));
if (Monop.currentPlayer.location == JAIL_SQUARE_NUMBER) {
wasInJail = true;
if (!Jail.checkForDoubles(r1, r2)) {
currentPlayerNumber++;
return;
}
}
else {
if (r1 == r2 &&++Monop.numberOfDoubles == 3) {
fprintf(stdout, "That's 3 doubles. You go to jail\n");
SpecialMoves.gotoJail();
currentPlayerNumber++;
return;
}
move(r1 + r2);
}
if (r1 != r2 || wasInJail) {
currentPlayerNumber++;
}
return;
}
static void move(int rl) {
int oldLocation;
oldLocation = Monop.currentPlayer.location;
Monop.currentPlayer.location = (Monop.currentPlayer.location + rl) % NUMBER_OF_SQUARES;
if (Monop.currentPlayer.location < oldLocation && rl > 0) {
Monop.currentPlayer.money += 200;
fprintf(stdout, "You pass %s and get $200\n", Monop.board[0].name);
}
showMove();
}
void showMove() {
Square square1;
square1 = Monop.board[Monop.currentPlayer.location];
fprintf(stdout, "That puts you on %s\n", square1.name);
switch (square1.type) {
case TYPE_SAFE:
fprintf(stdout, "That is a safe place\n");
break;
case TYPE_COMMUNITY_CHEST:
SpecialMoves.pickCommunityChestCard();
break;
case TYPE_CHANCE:
SpecialMoves.pickChanceCard();
break;
case TYPE_INCOME_TAX:
SpecialMoves.incomeTax();
break;
case TYPE_GOTO_JAIL:
SpecialMoves.gotoJail();
break;
case TYPE_LUXURY_TAX:
SpecialMoves.luxuryTax();
break;
case TYPE_PROPERTY:
case TYPE_RAILROAD:
case TYPE_UTIL:
if (square1.owner < 0) {
fprintf(stdout, "That would cost $%d\n", square1.cost);
if (Misc.getYesOrNo("Do you want to buy? ") == 0) {
PropertyFunctions.buy(currentPlayerNumber, square1);
Monop.currentPlayer.money -= square1.cost;
}
else {
if (Monop.numberOfPlayers > 2) {
PropertyFunctions.bid();
}
}
}
else {
if (square1.owner == currentPlayerNumber) {
fprintf(stdout, "You own it.\n");
}
else {
Rent.rent(square1);
}
}
}
}
public static void saveGame() {
}
public static void restoreGame() {
String sp;
fprintf(stdout, "Which file do you wish to restore from? ");
buf = stdin.readLine();
sp = "";
restoreFromFile(buf);
}
static boolean restoreFromFile(String file) {
return true;
}
| static String sccsid = "@(#)execute.c 5.5 (Berkeley) 2/28/91";
public final static int SEGSIZE = 8192;
static String buf = new String();
static String yn_only = "";
static boolean currentPlayerNumber;
static void execute(int answer) {
currentPlayerNumber = 0;
Invoker.invoke(Monop.functions[answer]) Misc.notify1();
Mortgage.fixupPrompt();
if (currentPlayerNumber != 0) {
Misc.nextPlayer();
}
else {
if (Monop.numberOfDoubles != 0) {
fprintf(stdout, "%s rolled doubles. Goes again\n", Monop.currentPlayer.name);
}
}
}
public static void doMove() {
int r1;
int r2;
boolean wasInJail = false;
currentPlayerNumber = wasInJail;
fprintf(stdout, "roll is %d, %d\n", r1 = Roll.roll(1, 6) , r2 = Roll.roll(1, 6));
if (Monop.currentPlayer.location == JAIL_SQUARE_NUMBER) {
wasInJail = true;
if (!Jail.checkForDoubles(r1, r2)) {
currentPlayerNumber++;
return;
}
}
else {
if (r1 == r2 &&++Monop.numberOfDoubles == 3) {
fprintf(stdout, "That's 3 doubles. You go to jail\n");
SpecialMoves.gotoJail();
currentPlayerNumber++;
return;
}
move(r1 + r2);
}
if (r1 != r2 || wasInJail) {
currentPlayerNumber++;
}
return;
}
static void move(int rl) {
int oldLocation = Monop.currentPlayer.location;
Monop.currentPlayer.location = (Monop.currentPlayer.location + rl) % NUMBER_OF_SQUARES;
if (Monop.currentPlayer.location < oldLocation && rl > 0) {
Monop.currentPlayer.money += 200;
fprintf(stdout, "You pass %s and get $200\n", Monop.board[0].name);
}
showMove();
}
void showMove() {
Square square1 = Monop.board[Monop.currentPlayer.location];
fprintf(stdout, "That puts you on %s\n", square1.name);
switch (square1.type) {
case TYPE_SAFE:
fprintf(stdout, "That is a safe place\n");
break;
case TYPE_COMMUNITY_CHEST:
SpecialMoves.pickCommunityChestCard();
break;
case TYPE_CHANCE:
SpecialMoves.pickChanceCard();
break;
case TYPE_INCOME_TAX:
SpecialMoves.incomeTax();
break;
case TYPE_GOTO_JAIL:
SpecialMoves.gotoJail();
break;
case TYPE_LUXURY_TAX:
SpecialMoves.luxuryTax();
break;
case TYPE_PROPERTY:
case TYPE_RAILROAD:
case TYPE_UTIL:
if (square1.owner < 0) {
fprintf(stdout, "That would cost $%d\n", square1.cost);
if (Misc.getYesOrNo("Do you want to buy? ") == 0) {
PropertyFunctions.buy(currentPlayerNumber, square1);
Monop.currentPlayer.money -= square1.cost;
}
else {
if (Monop.numberOfPlayers > 2) {
PropertyFunctions.bid();
}
}
}
else {
if (square1.owner == currentPlayerNumber) {
fprintf(stdout, "You own it.\n");
}
else {
Rent.rent(square1);
}
}
}
}
public static void saveGame() {
}
public static void restoreGame() {
String sp;
fprintf(stdout, "Which file do you wish to restore from? ");
buf = stdin.readLine();
sp = "";
restoreFromFile(buf);
}
static boolean restoreFromFile(String file) {
return true;
}
| static String sccsid = "@(#)execute.c 5.5 (Berkeley) 2/28/91";
public final static int SEGSIZE = 8192;
static String buf = new String();
static String yn_only = "";
static boolean currentPlayerNumber;
static void execute(int answer) {
currentPlayerNumber = 0;
Invoker.invoke(Monop.functions[answer]) Misc.notify1();
Mortgage.fixupPrompt();
if (currentPlayerNumber != 0) {
Misc.nextPlayer();
}
else if (Monop.numberOfDoubles != 0) {
fprintf(stdout, "%s rolled doubles. Goes again\n", Monop.currentPlayer.name);
}
}
public static void doMove() {
int r1;
int r2;
boolean wasInJail = false;
currentPlayerNumber = wasInJail;
fprintf(stdout, "roll is %d, %d\n", r1 = Roll.roll(1, 6) , r2 = Roll.roll(1, 6));
if (Monop.currentPlayer.location == JAIL_SQUARE_NUMBER) {
wasInJail = true;
if (!Jail.checkForDoubles(r1, r2)) {
currentPlayerNumber++;
return;
}
}
else {
if (r1 == r2 &&++Monop.numberOfDoubles == 3) {
fprintf(stdout, "That's 3 doubles. You go to jail\n");
SpecialMoves.gotoJail();
currentPlayerNumber++;
return;
}
move(r1 + r2);
}
if (r1 != r2 || wasInJail) {
currentPlayerNumber++;
}
return;
}
static void move(int rl) {
int oldLocation = Monop.currentPlayer.location;
Monop.currentPlayer.location = (Monop.currentPlayer.location + rl) % NUMBER_OF_SQUARES;
if (Monop.currentPlayer.location < oldLocation && rl > 0) {
Monop.currentPlayer.money += 200;
fprintf(stdout, "You pass %s and get $200\n", Monop.board[0].name);
}
showMove();
}
void showMove() {
Square square1 = Monop.board[Monop.currentPlayer.location];
fprintf(stdout, "That puts you on %s\n", square1.name);
switch (square1.type) {
case TYPE_SAFE:
fprintf(stdout, "That is a safe place\n");
break;
case TYPE_COMMUNITY_CHEST:
SpecialMoves.pickCommunityChestCard();
break;
case TYPE_CHANCE:
SpecialMoves.pickChanceCard();
break;
case TYPE_INCOME_TAX:
SpecialMoves.incomeTax();
break;
case TYPE_GOTO_JAIL:
SpecialMoves.gotoJail();
break;
case TYPE_LUXURY_TAX:
SpecialMoves.luxuryTax();
break;
case TYPE_PROPERTY:
case TYPE_RAILROAD:
case TYPE_UTIL:
if (square1.owner < 0) {
fprintf(stdout, "That would cost $%d\n", square1.cost);
if (Misc.getYesOrNo("Do you want to buy? ") == 0) {
PropertyFunctions.buy(currentPlayerNumber, square1);
Monop.currentPlayer.money -= square1.cost;
}
else if (Monop.numberOfPlayers > 2) {
PropertyFunctions.bid();
}
}
else if (square1.owner == currentPlayerNumber) {
fprintf(stdout, "You own it.\n");
}
else {
Rent.rent(square1);
}
}
}
public static void saveGame() {
}
public static void restoreGame() {
String sp;
fprintf(stdout, "Which file do you wish to restore from? ");
buf = stdin.readLine();
sp = "";
restoreFromFile(buf);
}
static boolean restoreFromFile(String file) {
return true;
}
| static String sccsid = "@(#)execute.c 5.5 (Berkeley) 2/28/91";
public final static int SEGSIZE = 8192;
static String buf = new String();
static String yn_only = "";
static boolean currentPlayerNumber;
static void execute(int answer) {
currentPlayerNumber = 0;
Invoker.invoke(Monop.functions[answer]) Misc.notify1();
Mortgage.fixupPrompt();
if (currentPlayerNumber != 0) {
Misc.nextPlayer();
}
else if (Monop.numberOfDoubles != 0) {
System.out.println(Monop.currentPlayer.name + " rolled doubles. Goes again");
}
}
public static void doMove() {
int r1;
int r2;
boolean wasInJail = false;
currentPlayerNumber = wasInJail;
System.out.println("roll is " + (r1 = Roll.roll(1, 6)) + ", " + (r2 = Roll.roll(1, 6)));
if (Monop.currentPlayer.location == JAIL_SQUARE_NUMBER) {
wasInJail = true;
if (!Jail.checkForDoubles(r1, r2)) {
currentPlayerNumber++;
return;
}
}
else {
if (r1 == r2 &&++Monop.numberOfDoubles == 3) {
System.out.println("That's 3 doubles. You go to jail");
SpecialMoves.gotoJail();
currentPlayerNumber++;
return;
}
move(r1 + r2);
}
if (r1 != r2 || wasInJail) {
currentPlayerNumber++;
}
return;
}
static void move(int rl) {
int oldLocation = Monop.currentPlayer.location;
Monop.currentPlayer.location = (Monop.currentPlayer.location + rl) % NUMBER_OF_SQUARES;
if (Monop.currentPlayer.location < oldLocation && rl > 0) {
Monop.currentPlayer.money += 200;
System.out.println("You pass " + (Monop.board[0].name) + " and get $200");
}
showMove();
}
void showMove() {
Square square1 = Monop.board[Monop.currentPlayer.location];
System.out.println("That puts you on " + square1.name);
switch (square1.type) {
case TYPE_SAFE:
System.out.println("That is a safe place");
break;
case TYPE_COMMUNITY_CHEST:
SpecialMoves.pickCommunityChestCard();
break;
case TYPE_CHANCE:
SpecialMoves.pickChanceCard();
break;
case TYPE_INCOME_TAX:
SpecialMoves.incomeTax();
break;
case TYPE_GOTO_JAIL:
SpecialMoves.gotoJail();
break;
case TYPE_LUXURY_TAX:
SpecialMoves.luxuryTax();
break;
case TYPE_PROPERTY:
case TYPE_RAILROAD:
case TYPE_UTIL:
if (square1.owner < 0) {
System.out.println("That would cost $" + square1.cost);
if (Misc.getYesOrNo("Do you want to buy? ") == 0) {
PropertyFunctions.buy(currentPlayerNumber, square1);
Monop.currentPlayer.money -= square1.cost;
}
else if (Monop.numberOfPlayers > 2) {
PropertyFunctions.bid();
}
}
else if (square1.owner == currentPlayerNumber) {
System.out.println("You own it.");
}
else {
Rent.rent(square1);
}
}
}
public static void saveGame() {
}
public static void restoreGame() {
String sp;
System.out.print("Which file do you wish to restore from? ");
buf = stdin.readLine();
sp = "";
restoreFromFile(buf);
}
static boolean restoreFromFile(String file) {
return true;
}
| static String sccsid = "@(#)execute.c 5.5 (Berkeley) 2/28/91";
public final static int SEGSIZE = 8192;
static String buf = new String();
static String yn_only = "";
static boolean currentPlayerNumber;
static void execute(int answer) {
currentPlayerNumber = 0;
Invoker.invoke(Monop.functions[answer]) Misc.notify1();
Mortgage.fixupPrompt();
if (currentPlayerNumber != 0) {
Misc.nextPlayer();
}
else if (Monop.numberOfDoubles != 0) {
System.out.println(Monop.currentPlayer.name + " rolled doubles. Goes again");
}
}
public static void doMove() {
int r1;
int r2;
boolean wasInJail = false;
currentPlayerNumber = wasInJail;
System.out.println("roll is " + (r1 = Roll.roll(1, 6)) + ", " + (r2 = Roll.roll(1, 6)));
if (Monop.currentPlayer.location == JAIL_SQUARE_NUMBER) {
wasInJail = true;
if (!Jail.checkForDoubles(r1, r2)) {
currentPlayerNumber++;
return;
}
}
else {
if (r1 == r2 &&++Monop.numberOfDoubles == 3) {
System.out.println("That's 3 doubles. You go to jail");
SpecialMoves.gotoJail();
currentPlayerNumber++;
return;
}
move(r1 + r2);
}
if (r1 != r2 || wasInJail) {
currentPlayerNumber++;
}
return;
}
static void move(int rl) {
int oldLocation = Monop.currentPlayer.location;
Monop.currentPlayer.location = (Monop.currentPlayer.location + rl) % NUMBER_OF_SQUARES;
if (Monop.currentPlayer.location < oldLocation && rl > 0) {
Monop.currentPlayer.money += 200;
System.out.println("You pass " + (Monop.board[0].name) + " and get $200");
}
showMove();
}
void showMove() {
Square square1 = Monop.board[Monop.currentPlayer.location];
System.out.println("That puts you on " + square1.name);
switch (square1.type) {
case TYPE_SAFE:
System.out.println("That is a safe place");
break;
case TYPE_COMMUNITY_CHEST:
SpecialMoves.pickCommunityChestCard();
break;
case TYPE_CHANCE:
SpecialMoves.pickChanceCard();
break;
case TYPE_INCOME_TAX:
SpecialMoves.incomeTax();
break;
case TYPE_GOTO_JAIL:
SpecialMoves.gotoJail();
break;
case TYPE_LUXURY_TAX:
SpecialMoves.luxuryTax();
break;
case TYPE_PROPERTY:
case TYPE_RAILROAD:
case TYPE_UTIL:
if (square1.owner < 0) {
System.out.println("That would cost $" + square1.cost);
if (Misc.getYesOrNo("Do you want to buy? ") == 0) {
PropertyFunctions.buy(currentPlayerNumber, square1);
Monop.currentPlayer.money -= square1.cost;
}
else if (Monop.numberOfPlayers > 2) {
PropertyFunctions.bid();
}
}
else if (square1.owner == currentPlayerNumber) {
System.out.println("You own it.");
}
else {
Rent.rent(square1);
}
}
}
public static void saveGame() {
}
public static void restoreGame() {
String sp;
System.out.print("Which file do you wish to restore from? ");
buf = CIOUtils.stdin.readLine();
sp = "";
restoreFromFile(buf);
}
static boolean restoreFromFile(String file) {
return true;
}
| static String sccsid = "@(#)execute.c 5.5 (Berkeley) 2/28/91";
public final static int SEGSIZE = 8192;
static String buf = new String();
static String yn_only = "";
static boolean currentPlayerNumber;
static void execute(int answer) {
currentPlayerNumber = 0;
Invoker.invoke(Monop.functions[answer]) Misc.notify1();
Mortgage.fixupPrompt();
if (currentPlayerNumber != 0) {
Misc.nextPlayer();
}
else if (Monop.numberOfDoubles != 0) {
System.out.println(Monop.currentPlayer.name + " rolled doubles. Goes again");
}
}
public static void doMove() {
int r1;
int r2;
boolean wasInJail = false;
currentPlayerNumber = wasInJail;
System.out.println("roll is " + (r1 = Roll.roll(1, 6)) + ", " + (r2 = Roll.roll(1, 6)));
if (Monop.currentPlayer.location == JAIL_SQUARE_NUMBER) {
wasInJail = true;
if (!Jail.checkForDoubles(r1, r2)) {
currentPlayerNumber++;
return;
}
}
else {
if (r1 == r2 &&++Monop.numberOfDoubles == 3) {
System.out.println("That's 3 doubles. You go to jail");
SpecialMoves.gotoJail();
currentPlayerNumber++;
return;
}
move(r1 + r2);
}
if (r1 != r2 || wasInJail) {
currentPlayerNumber++;
}
return;
}
static void move(int rl) {
int oldLocation = Monop.currentPlayer.location;
Monop.currentPlayer.location = (Monop.currentPlayer.location + rl) % NUMBER_OF_SQUARES;
if (Monop.currentPlayer.location < oldLocation && rl > 0) {
Monop.currentPlayer.money += 200;
System.out.println("You pass " + (Monop.board[0].name) + " and get $200");
}
showMove();
}
void showMove() {
Square square1 = Monop.board[Monop.currentPlayer.location];
System.out.println("That puts you on " + square1.name);
switch (square1.type) {
case TYPE_SAFE:
System.out.println("That is a safe place");
break;
case TYPE_COMMUNITY_CHEST:
SpecialMoves.pickCommunityChestCard();
break;
case TYPE_CHANCE:
SpecialMoves.pickChanceCard();
break;
case TYPE_INCOME_TAX:
SpecialMoves.incomeTax();
break;
case TYPE_GOTO_JAIL:
SpecialMoves.gotoJail();
break;
case TYPE_LUXURY_TAX:
SpecialMoves.luxuryTax();
break;
case TYPE_PROPERTY:
case TYPE_RAILROAD:
case TYPE_UTIL:
if (square1.owner < 0) {
System.out.println("That would cost $" + square1.cost);
if (Misc.getYesOrNo("Do you want to buy? ") == 0) {
PropertyFunctions.buy(currentPlayerNumber, square1);
Monop.currentPlayer.money -= square1.cost;
}
else if (Monop.numberOfPlayers > 2) {
PropertyFunctions.bid();
}
}
else if (square1.owner == currentPlayerNumber) {
System.out.println("You own it.");
}
else {
Rent.rent(square1);
}
}
}
public static void saveGame() {
}
public static void restoreGame() {
String sp;
System.out.print("Which file do you wish to restore from? ");
try {
buf = CIOUtils.stdin.readLine();
}
catch (IOException e) {
System.err.println("IO Exception:" + e);
}
sp = "";
restoreFromFile(buf);
}
static boolean restoreFromFile(String file) {
return true;
}
| static String sccsid = "@(#)execute.c 5.5 (Berkeley) 2/28/91";
public final static int SEGSIZE = 8192;
static String buf = new String();
static String yn_only = "";
static boolean currentPlayerNumber;
static void execute(int answer) {
currentPlayerNumber = 0;
Invoker.invoke(Monop.functions[answer]) Misc.notify1();
Mortgage.fixupPrompt();
if (currentPlayerNumber != 0) {
Misc.nextPlayer();
}
else if (Monop.numberOfDoubles != 0) {
System.out.println(Monop.currentPlayer.name + " rolled doubles. Goes again");
}
}
public static void doMove() {
int r1 = 0;
int r2 = 0;
boolean wasInJail = false;
currentPlayerNumber = wasInJail;
System.out.println("roll is " + (r1 = Roll.roll(1, 6)) + ", " + (r2 = Roll.roll(1, 6)));
if (Monop.currentPlayer.location == JAIL_SQUARE_NUMBER) {
wasInJail = true;
if (!Jail.checkForDoubles(r1, r2)) {
currentPlayerNumber++;
return;
}
}
else {
if (r1 == r2 &&++Monop.numberOfDoubles == 3) {
System.out.println("That's 3 doubles. You go to jail");
SpecialMoves.gotoJail();
currentPlayerNumber++;
return;
}
move(r1 + r2);
}
if (r1 != r2 || wasInJail) {
currentPlayerNumber++;
}
return;
}
static void move(int rl) {
int oldLocation = Monop.currentPlayer.location;
Monop.currentPlayer.location = (Monop.currentPlayer.location + rl) % NUMBER_OF_SQUARES;
if (Monop.currentPlayer.location < oldLocation && rl > 0) {
Monop.currentPlayer.money += 200;
System.out.println("You pass " + (Monop.board[0].name) + " and get $200");
}
showMove();
}
void showMove() {
Square square1 = Monop.board[Monop.currentPlayer.location];
System.out.println("That puts you on " + square1.name);
switch (square1.type) {
case TYPE_SAFE:
System.out.println("That is a safe place");
break;
case TYPE_COMMUNITY_CHEST:
SpecialMoves.pickCommunityChestCard();
break;
case TYPE_CHANCE:
SpecialMoves.pickChanceCard();
break;
case TYPE_INCOME_TAX:
SpecialMoves.incomeTax();
break;
case TYPE_GOTO_JAIL:
SpecialMoves.gotoJail();
break;
case TYPE_LUXURY_TAX:
SpecialMoves.luxuryTax();
break;
case TYPE_PROPERTY:
case TYPE_RAILROAD:
case TYPE_UTIL:
if (square1.owner < 0) {
System.out.println("That would cost $" + square1.cost);
if (Misc.getYesOrNo("Do you want to buy? ") == 0) {
PropertyFunctions.buy(currentPlayerNumber, square1);
Monop.currentPlayer.money -= square1.cost;
}
else if (Monop.numberOfPlayers > 2) {
PropertyFunctions.bid();
}
}
else if (square1.owner == currentPlayerNumber) {
System.out.println("You own it.");
}
else {
Rent.rent(square1);
}
}
}
public static void saveGame() {
}
public static void restoreGame() {
String sp = null;
System.out.print("Which file do you wish to restore from? ");
try {
buf = CIOUtils.stdin.readLine();
}
catch (IOException e) {
System.err.println("IO Exception:" + e);
}
sp = "";
restoreFromFile(buf);
}
static boolean restoreFromFile(String file) {
return true;
}
| public class Execute {
static String sccsid = "@(#)execute.c 5.5 (Berkeley) 2/28/91";
public final static int SEGSIZE = 8192;
static String buf = new String();
static String yn_only = "";
static boolean currentPlayerNumber;
static void execute(int answer) {
currentPlayerNumber = 0;
Invoker.invoke(Monop.functions[answer]) Misc.notify1();
Mortgage.fixupPrompt();
if (currentPlayerNumber != 0) {
Misc.nextPlayer();
}
else if (Monop.numberOfDoubles != 0) {
System.out.println(Monop.currentPlayer.name + " rolled doubles. Goes again");
}
}
public static void doMove() {
int r1 = 0;
|