public class Print { static String header = "Name Own Price Mg # Rent"; public static void printboard() { int i = 0; System.out.println(header + "\t" + header); for (i = 0;i < Monop.N_SQRS / 2;i++) { printsq(i, false); System.out.print('\t'); printsq(i + Monop.N_SQRS / 2, true); } } public static void where() { int i = 0; String bsp = null; System.out.println(header + " Player"); for (i = 0;i < Monop.num_play;i++) { printsq(Monop.play[i].loc, false); System.out.print(" " + (Monop.play[i].name) + " (" + (i + 1) + ")"); if (Monop.cur_p == Monop.play[i]) { System.out.print(" *"); } System.out.println(); } } static void printsq(int sqn, boolean eoln) { int rnt = 0; Prp_st pp = null; Sqr_st sqp = null; sqp = Monop.board[sqn]; System.out.print(sqp.name); switch (sqp.type) { case Monop.SAFE: case Monop.CC: case Monop.CHANCE: case Monop.INC_TAX: case Monop.GOTO_J: case Monop.LUX_TAX: case Monop.IN_JAIL: if ( ! eoln) { System.out.print(" "); } break; case Monop.PRPTY: pp = sqp.desc; if (sqp.owner < 0) { System.out.print(" - " + pp.mon_desc.name + " " + sqp.cost); if ( ! eoln) { System.out.print(" "); } break; } System.out.print(" " + (sqp.owner + 1) + " " + pp.mon_desc.name + " " + sqp.cost); printmorg(sqp); if (pp.monop) { if (pp.houses < 5) { if (pp.houses > 0) { System.out.print(pp.houses + " " + (pp.rent[pp.houses])); } else { System.out.print("0 " + (pp.rent[0] * 2)); } } else { System.out.print("H " + (pp.rent[5])); } } else { System.out.print(" " + (pp.rent[0])); } break; case Monop.UTIL: if (sqp.owner < 0) { System.out.print(" - 150"); if ( ! eoln) { System.out.print(" "); } break; } System.out.print(" " + (sqp.owner + 1) + " 150"); printmorg(sqp); System.out.print((Monop.play[sqp.owner].num_util)); if ( ! eoln) { System.out.print(" "); } break; case Monop.RR: if (sqp.owner < 0) { System.out.print(" - Railroad 200"); if ( ! eoln) { System.out.print(" "); } break; } System.out.print(" " + (sqp.owner + 1) + " Railroad 200"); printmorg(sqp); rnt = 25; rnt <<= Monop.play[sqp.owner].num_rr - 1; System.out.print((Monop.play[sqp.owner].num_rr) + " " + (25 << (Monop.play[sqp.owner].num_rr - 1))); break; } if (eoln) { System.out.println(); } } static void printmorg(Sqr_st sqp) { if (sqp.desc.morg) { System.out.print(" * "); } else { System.out.print(" "); } } static void printhold(int pl) { Own_st op = null; Plr_st pp = null; String bsp = null; pp = Monop.play[pl]; System.out.println((Monop.name_list[pl]) + "'s (" + (pl + 1) + ") holdings (Total worth: $" + (pp.money + PropertyFunctions.prop_worth(pp)) + "):"); System.out.print("\t$" + pp.money); if (pp.num_gojf != 0) { System.out.print(", " + pp.num_gojf + " get-out-of-jail-free card"); if (pp.num_gojf > 1) { System.out.print('s'); } } System.out.println(); if (pp.own_list != null) { System.out.println("\t" + header); for (op = pp.own_list;op != null;op = op.next) { System.out.print('\t'); printsq(Monop.sqnum(op.sqr) , true); } } } }