Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Name: xxxxxxxxxxxxxx
- #Date: 11/15/2017
- #Class: CSCI I
- #Assignment: Semester I Final Project
- #Algorithm: Program plays Monopoly
- ############################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################
- #Imports RNG
- import turtle
- import random
- import winsound
- #Defines variables
- space = ["Go", "Mediterranean Avenue", "Community Chest 1", "Baltic Avenue", "Income Tax", "Reading Railroad", "Oriental Avenue", "Chance 1", "Vermont Avenue", "Connecticut Avenue", "Jail (Visiting)", "St. Charles Place", "Electric Company", "States Avenue", "Virginia Avenue", "Pennsylvania Railroad", "St. James Place", "Community Chest 2", "Tennessee Avenue", "New York Avenue", "Free Parking", "Kentucky Avenue", "Chance 2", "Indiana Avenue", "Illinois Avenue", "B & O Railroad", "Atlantic Avenue", "Ventnor Avenue", "Water Works", "Marvin Gardens", "Jail", "Pacific Avenue", "North Carolina Avenue", "Community Chest 3", "Pennsylvania Avenue", "Short Line", "Chance 3", "Park Place", "Luxury Tax", "Boardwalk"]
- game = 1
- turn = random.randint(1, 2)
- p1s = 0
- p2s = 0
- p1m = 2000
- p2m = 2000
- p1rr = 0
- p2rr = 0
- p1u = 0
- p2u = 0
- buy = "x"
- #Medeterranean Avenue variables
- br1 = 0
- br1m = 0
- br1h = 0
- #Baltic Avenue variables
- br2 = 0
- br2m = 0
- br2h = 0
- #Oriental Avenue variables
- cy1 = 0
- cy1m = 0
- cy1h = 0
- #Vermont Avenue variables
- cy2 = 0
- cy2m = 0
- cy2h = 0
- #Connecticut Avenue variables
- cy3 = 0
- cy3m = 0
- cy3h = 0
- #St. Charles Place variables
- vi1 = 0
- vi1m = 0
- vi1h = 0
- #States Avenue variables
- vi2 = 0
- vi2m = 0
- vi2h = 0
- #Virginia Avenue variables
- vi3 = 0
- vi3m = 0
- vi3h = 0
- #St. James Place variables
- or1 = 0
- or1m = 0
- or1h = 0
- #Tennessee Avenue variables
- or2 = 0
- or2m = 0
- or2h = 0
- #New York variables
- or3 = 0
- or3m = 0
- or3h = 0
- #Kentucky Avenue variables
- red1 = 0
- red1m = 0
- red1h = 0
- #Indiana Avenue variables
- red2 = 0
- red2m = 0
- red2h = 0
- #Illinois Avenue variables
- red3 = 0
- red3m = 0
- red3h = 0
- #Atlantic Avenue variables
- ye1 = 0
- ye1m = 0
- ye1h = 0
- #Ventnor Avenue variables
- ye2 = 0
- ye2m = 0
- ye2h = 0
- #Marvin Gardens variables
- ye3 = 0
- ye3m = 0
- ye3h = 0
- #Pacific Avenue variables
- gr1 = 0
- gr1m = 0
- gr1h = 0
- #North Carolina Avenue variables
- gr2 = 0
- gr2m = 0
- gr2h = 0
- #Pennsylvania Avenue variables
- gr3 = 0
- gr3m = 0
- gr3h = 0
- #Park Place variables
- bl1 = 0
- bl1m = 0
- bl1h = 0
- #Boardwalk variables
- bl2 = 0
- bl2m = 0
- bl2h = 0
- #Reading Railroad variables
- rrr = 0
- rrrm = 0
- #Pennsylvania Railroad variables
- prr = 0
- prrm = 0
- #B & O Railroad variables
- brr = 0
- brrm = 0
- #Short Line Railroad variables
- srr = 0
- srrm = 0
- #Electric Company variables
- ec = 0
- ecm = 0
- #Water Works variables
- ww = 0
- wwm = 0
- #Free Parking variables
- fp = 200
- #Jail variables
- p1j = 0
- p1jt = 0
- p2j = 0
- p1jt = 0
- #Plays background music
- #winsound.PlaySound('night.wav', winsound.SND_LOOP + winsound.SND_ASYNC)
- #Sets up game board
- wn = turtle.Screen()
- wn.title("Monopoly")
- wn.setup(780, 780)
- wn.bgpic("monopoly.png")
- #Sets up mortgage symbols
- mortgage = "mortgaged.gif"
- wn.addshape(mortgage)
- m1 = turtle.Turtle()
- m1.shape(mortgage)
- m1.pu()
- m1.speed(0)
- m1.ht()
- m2 = m1.clone()
- m3 = m1.clone()
- m4 = m1.clone()
- m5 = m1.clone()
- m6 = m1.clone()
- m7 = m1.clone()
- m8 = m1.clone()
- m9 = m1.clone()
- m10 = m1.clone()
- m11 = m1.clone()
- m12 = m1.clone()
- m13 = m1.clone()
- m14 = m1.clone()
- m15 = m1.clone()
- m16 = m1.clone()
- m17 = m1.clone()
- m18 = m1.clone()
- m19 = m1.clone()
- m20 = m1.clone()
- m21 = m1.clone()
- m22 = m1.clone()
- m23 = m1.clone()
- m24 = m1.clone()
- m25 = m1.clone()
- m26 = m1.clone()
- m27 = m1.clone()
- m28 = m1.clone()
- m1.setpos(335 - 82 - 63 * 0, -335) #Mediterranean Avenue
- m2.setpos(335 - 82 - 63 * 2, -335) #Baltic Avenue
- m3.setpos(335 - 82 - 63 * 4, -335) #Reading Railroad
- m4.setpos(335 - 82 - 63 * 5, -335) #Oriental Avenue
- m5.setpos(335 - 82 - 63 * 7, -335) #Vermont Avenue
- m6.setpos(335 - 82 - 63 * 8, -335) #Connecticut Avenue
- m7.setpos(-333, -335 + 82 + 63 * 0) #St. Charles Place
- m8.setpos(-333, -335 + 82 + 63 * 1) #Electric Company
- m9.setpos(-333, -335 + 82 + 63 * 2) #States Avenue
- m10.setpos(-333, -335 + 82 + 63 * 3) #Virginia Avenue
- m11.setpos(-333, -335 + 82 + 63 * 4) #Pennsylvania Railroad
- m12.setpos(-333, -335 + 82 + 63 * 5) #St. James Place
- m13.setpos(-333, -335 + 82 + 63 * 7) #Tennessee Avenue
- m14.setpos(-333, -335 + 82 + 63 * 8) #New York Avenue
- m15.setpos(-333 + 82 + 63 * 0, 333) #Kentucky Avenue
- m16.setpos(-333 + 82 + 63 * 2, 333) #Indiana Avenue
- m17.setpos(-333 + 82 + 63 * 3, 333) #Illinois Avenue
- m18.setpos(-333 + 82 + 63 * 4, 333) #B & O Railroad
- m19.setpos(-333 + 82 + 63 * 5, 333) #Atlantic Avenue
- m20.setpos(-333 + 82 + 63 * 6, 333) #Ventnor Avenue
- m21.setpos(-333 + 82 + 63 * 7, 333) #Water Works
- m22.setpos(-333 + 82 + 63 * 8, 333) #Marvin Gardens
- m23.setpos(335, 333 - 82 - 63 * 0) #Pacific Avenue
- m24.setpos(335, 333 - 82 - 63 * 1) #North Carolina Avenue
- m25.setpos(335, 333 - 82 - 63 * 3) #Pennsylvania Avenue
- m26.setpos(335, 333 - 82 - 63 * 4) #Short Line
- m27.setpos(335, 333 - 82 - 63 * 6) #Park Place
- m28.setpos(335, 333 - 82 - 63 * 8) #Boardwalk
- #Sets up houses and hotels
- house = "house.gif"
- house2 = "house2.gif"
- house3 = "house3.gif"
- house4 = "house4.gif"
- hotel = "hotel.gif"
- wn.addshape(house)
- wn.addshape(house2)
- wn.addshape(house3)
- wn.addshape(house4)
- wn.addshape(hotel)
- h1 = turtle.Turtle()
- h1.shape(house)
- h1.pu()
- h1.speed(0)
- #h1.ht()
- h2 = h1.clone()
- h3 = h1.clone()
- h4 = h1.clone()
- h5 = h1.clone()
- h6 = h1.clone()
- h7 = h1.clone()
- h8 = h1.clone()
- h9 = h1.clone()
- h10 = h1.clone()
- h11 = h1.clone()
- h12 = h1.clone()
- h13 = h1.clone()
- h14 = h1.clone()
- h15 = h1.clone()
- h16 = h1.clone()
- h17 = h1.clone()
- h18 = h1.clone()
- h19 = h1.clone()
- h20 = h1.clone()
- h21 = h1.clone()
- h22 = h1.clone()
- h1.setpos(335 - 82 - 63 * 0, -295) #Mediterranean Avenue
- h2.setpos(335 - 82 - 63 * 2, -295) #Baltic Avenue
- h3.setpos(335 - 82 - 63 * 5, -295) #Oriental Avenue
- h4.setpos(335 - 82 - 63 * 7, -295) #Vermont Avenue
- h5.setpos(335 - 82 - 63 * 8, -295) #Connecticut Avenue
- h6.setpos(-295, -335 + 82 + 63 * 0) #St. Charles Place
- h7.setpos(-295, -335 + 82 + 63 * 2) #States Avenue
- h8.setpos(-295, -335 + 82 + 63 * 3) #Virginia Avenue
- h9.setpos(-295, -335 + 82 + 63 * 5) #St. James Place
- h10.setpos(-295, -335 + 82 + 63 * 7) #Tennessee Avenue
- h11.setpos(-295, -335 + 82 + 63 * 8) #New York Avenue
- h12.setpos(-335 + 82 + 63 * 0, 295) #Kentucky Avenue
- h13.setpos(-335 + 82 + 63 * 2, 295) #Indiana Avenue
- h14.setpos(-335 + 82 + 63 * 3, 295) #Illinois Avenue
- h15.setpos(-335 + 82 + 63 * 5, 295) #Atlantic Avenue
- h16.setpos(-335 + 82 + 63 * 6, 295) #Ventnor Avenue
- h17.setpos(-335 + 82 + 63 * 8, 295) #Marvin Gardens
- h18.setpos(295, 335 - 82 - 63 * 0) #Pacific Avenue
- h19.setpos(295, 335 - 82 - 63 * 1) #North Carolina Avenue
- h20.setpos(295, 335 - 82 - 63 * 3) #Pennsylvania Avenue
- h21.setpos(295, 335 - 82 - 63 * 6) #Park Place
- h22.setpos(295, 335 - 82 - 63 * 8) #Boardwalk
- #Sets up characters
- char1 = "cat.gif"
- char2 = "stick.gif"
- wn.addshape(char1)
- wn.addshape(char2)
- player2 = turtle.Turtle()
- player1 = turtle.Turtle()
- player1.ht()
- player2.ht()
- player1.pu()
- player2.pu()
- player1.speed(0)
- player2.speed(0)
- p1x = 335
- p1y = -335
- p2x = 335
- p2y = -335
- player1.setpos(p1x, p1y)
- player2.setpos(p2x, p2y)
- player1.speed(2)
- player2.speed(2)
- #Intro text
- print("---------------------------------------------------------")
- print("Welcome to Monopoly!")
- input()
- #Defines names
- p1 = input("Give us your name, Player One! ")
- p2 = input("Don't be shy, introduce yourself, Player Two! ")
- print()
- #Allows players to select characters
- print("Select your character,", p1 + "!")
- #Sets players to their selected characters
- player1.shape(char1)
- player2.shape(char2)
- player1.st()
- player2.st()
- #Determines who goes first
- if turn == 1:
- print(p1, "goes first!")
- input()
- if turn == 2:
- print(p2, "goes first!")
- input()
- #While game is on...
- while game == 1:
- ####While it is Player One's turn...
- while turn == 1:
- #Displays player stats
- print("***************")
- print(p1 + ":\t$" + str(p1m))
- print(p2 + ":\t$" + str(p2m) + "\n***************\n")
- #If player is in Jail...
- if p1j == 1:
- p1jc = "x"
- p1jt = p1jt + 1
- #Player has these Jail options...
- while p1jc != "p" and p1jc != "r":
- if p1jt < 4:
- print("You are in Jail.")
- print("I. Pay $50 to be released (p)")
- print("II. Attempt to roll doubles (r)")
- p1jc = input()
- #If player pays to leave Jail...
- if p1jc == "p":
- if p1m >= 50:
- print(p1, "paid and left Jail.")
- p1j = 0
- p1jt = 0
- p1m = p1m - 50
- else:
- print("Insufficient funds. Too bad.\n")
- p1jc = "x"
- #If player rolls to leave Jail...
- elif p1jc == "r":
- die1 = random.randint(1, 6)
- die2 = random.randint(1, 6)
- input("Here's hoping to some good luck...\n")
- print(p1, "rolled a", str(die1), "and a", str(die2) + "!\n")
- if die1 == die2:
- print("Success! You walked free.")
- p1j = 0
- p1jt = 0
- else:
- print("Ah, you tried.")
- #turn = 2
- else:
- print("Invalid response.")
- else:
- print("You served your time,", p1 + ".")
- input()
- p1j = 0
- p1jt = 0
- p1jc = "r"
- if turn == 1:
- p1c = "x"
- #Player menu
- while p1c != "r" and p1c != "m" and p1c != "b" and p1c != "t" and p1c != "u" and p1c != "s" and p1c != "d":
- print("What will you do?")
- print("I. Roll the dice (r)")
- print("II. Mortgage properties (m)")
- print("III. Unmortgage properties (u)")
- print("III. Build houses (b)")
- print("IV. Sell houses (s)")
- print("V. Make a trade (t)")
- print("VI. Declare bankruptcy (d)")
- p1c = input()
- #If player chooses to roll...
- if p1c == "r":
- print("\nRoll the dice,", p1 + "!")
- input()
- #If player chooses to mortgage...
- elif p1c == "m":
- p1mc = "x"
- #Huge friggin' mortgaging while loop
- while p1mc != "Mediterranean Avenue" and p1mc != "Baltic Avenue" and p1mc != "Reading Railroad" and p1mc != "Oriental Avenue" and p1mc != "Vermont Avenue" and p1mc != "Connecticut Avenue" and p1mc != "St. Charles Place" and p1mc != "Electric Company" and p1mc != "States Avenue" and p1mc != "Virginia Avenue" and p1mc != "Pennsylvania Railroad" and p1mc != "St. James Place" and p1mc != "Tennessee Avenue" and p1mc != "New York Avenue" and p1mc != "Kentucky Avenue" and p1mc != "Indiana Avenue" and p1mc != "Illinois Avenue" and p1mc != "B & O Railroad" and p1mc != "Atlantic Avenue" and p1mc != "Ventnor Avenue" and p1mc != "Water Works" and p1mc != "Marvin Gardens" and p1mc != "Pacific Avenue" and p1mc != "North Carolina Avenue" and p1mc != "Pennsylvania Avenue" and p1mc != "Short Line" and p1mc != "Park Place" and p1mc != "Boardwalk" and p1mc != "Done":
- print("Mortgage which properties?")
- print("``````````````````````````")
- if br1 == 1 and br1m == 0 and br1h == 0 and br2h == 0:
- print("Mediterranean Avenue ($30)")
- if br2 == 1 and br2m == 0 and br1h == 0 and br2h == 0:
- print("Baltic Avenue ($30)")
- if cy1 == 1 and cy1m == 0 and cy1h == 0 and cy2h == 0 and cy3h == 0:
- print("Oriental Avenue ($50)")
- if cy2 == 1 and cy2m == 0 and cy1h == 0 and cy2h == 0 and cy3h == 0:
- print("Vermont Avenue ($50)")
- if cy3 == 1 and cy3m == 0 and cy1h == 0 and cy2h == 0 and cy3h == 0:
- print("Connecticut Avenue ($60)")
- if vi1 == 1 and vi1m == 0 and vi1h == 0 and vi2h == 0 and vi3h == 0:
- print("St. Charles Place ($70)")
- if vi2 == 1 and vi2m == 0 and vi1h == 0 and vi2h == 0 and vi3h == 0:
- print("States Avenue ($70)")
- if vi3 == 1 and vi3m == 0 and vi1h == 0 and vi2h == 0 and vi3h == 0:
- print("Virginia Avenue ($80)")
- if or1 == 1 and or1m == 0 and or1h == 0 and or2h == 0 and or3h == 0:
- print("St. James Place ($90)")
- if or2 == 1 and or2m == 0 and or1h == 0 and or2h == 0 and or3h == 0:
- print("Tennessee Avenue ($90)")
- if or3 == 1 and or3m == 0 and or1h == 0 and or2h == 0 and or3h == 0:
- print("New York Avenue ($100)")
- if red1 == 1 and red1m == 0 and red1h == 0 and red2h == 0 and red3h == 0:
- print("Kentucky Avenue ($110)")
- if red2 == 1 and red2m == 0 and red1h == 0 and red2h == 0 and red3h == 0:
- print("Indiana Avenue ($110)")
- if red3 == 1 and red3m == 0 and red1h == 0 and red2h == 0 and red3h == 0:
- print("Illinois Avenue ($120)")
- if ye1 == 1 and ye1m == 0 and ye1h == 0 and ye2h == 0 and ye3h == 0:
- print("Atlantic Avenue ($130)")
- if ye2 == 1 and ye2m == 0 and ye1h == 0 and ye2h == 0 and ye3h == 0:
- print("Ventnor Avenue ($130)")
- if ye3 == 1 and ye3m == 0 and ye1h == 0 and ye2h == 0 and ye3h == 0:
- print("Marvin Gardens ($140)")
- if gr1 == 1 and gr1m == 0 and gr1h == 0 and gr2h == 0 and gr3h == 0:
- print("Pacific Avenue ($150)")
- if gr2 == 1 and gr2m == 0 and gr1h == 0 and gr2h == 0 and gr3h == 0:
- print("North Carolina Avenue ($150)")
- if gr3 == 1 and gr3m == 0 and gr1h == 0 and gr2h == 0 and gr3h == 0:
- print("Pennsylvania Avenue ($160)")
- if bl1 == 1 and bl1m == 0 and bl1h == 0 and bl2h == 0:
- print("Park Place ($175)")
- if bl2 == 1 and bl2m == 0 and bl1h == 0 and bl2h == 0:
- print("Boardwalk ($200)")
- if rrr == 1 and rrrm == 0:
- print("Reading Railroad ($100)")
- if prr == 1 and prrm == 0:
- print("Pennsylvania Railroad ($100)")
- if brr == 1 and brrm == 0:
- print("B & O Railroad ($100)")
- if srr == 1 and srrm == 0:
- print("Short Line ($100)")
- if ec == 1 and ecm == 0:
- print("Electric Company ($75)")
- if ww == 1 and wwm == 0:
- print("Water Works ($75)")
- print("``````````````````````````")
- print("(Type 'Done' to finish)")
- p1mc = input()
- print()
- #If player tries to mortgage Mediterranean Avenue...
- if p1mc == "Mediterranean Avenue":
- if br1 == 1 and br1m == 0 and br1h == 0 and br2h == 0:
- print(p1, "mortgaged Mediterranean Avenue for $30.")
- br1m = 1
- p1m = p1m + 30
- m1.st()
- else:
- print("Unable to mortgage that property.")
- p1mc = "x"
- #If player tries to mortgage Baltic Avenue...
- elif p1mc == "Baltic Avenue":
- if br2 == 1 and br2m == 0 and br1h == 0 and br2h == 0:
- print(p1, "mortgaged Baltic Avenue for $30.")
- br2m = 1
- p1m = p1m + 30
- m2.st()
- else:
- print("Unable to mortgage that property.")
- p1mc = "x"
- #If player tries to mortgage Oriental Avenue...
- elif p1mc == "Oriental Avenue":
- if cy1 == 1 and cy1m == 0 and cy1h == 0 and cy2h == 0 and cy3h == 0:
- print(p1, "mortgaged Oriental Avenue for $50.")
- cy1m = 1
- p1m = p1m + 50
- m4.st()
- else:
- print("Unable to mortgage that property.")
- p1mc = "x"
- #If player tries to mortgage Vermont Avenue...
- elif p1mc == "Vermont Avenue":
- if cy2 == 1 and cy2m == 0 and cy1h == 0 and cy2h == 0 and cy3h == 0:
- print(p1, "mortgaged Vermont Avenue for $50.")
- cy2m = 1
- p1m = p1m + 50
- m5.st()
- else:
- print("Unable to mortgage that property.")
- p1mc = "x"
- #If player tries to mortgage Connecticut Avenue...
- elif p1mc == "Connecticut Avenue":
- if cy3 == 1 and cy3m == 0 and cy1h == 0 and cy2h == 0 and cy3h == 0:
- print(p1, "mortgaged Connecticut Avenue for $60.")
- cy3m = 1
- p1m = p1m + 60
- m6.st()
- else:
- print("Unable to mortgage that property.")
- p1mc = "x"
- #If player tries to mortgage St. Charles Place...
- elif p1mc == "St. Charles Place":
- if vi1 == 1 and vi1m == 0 and vi1h == 0 and vi2h == 0 and vi3h == 0:
- print(p1, "mortgaged St. Charles Place for $70.")
- vi1m = 1
- p1m = p1m + 70
- m7.st()
- else:
- print("Unable to mortgage that property.")
- p1mc = "x"
- #If player tries to mortgage States Avenue...
- elif p1mc == "States Avenue":
- if vi2 == 1 and vi2m == 0 and vi1h == 0 and vi2h == 0 and vi3h == 0:
- print(p1, "mortgaged States Avenue for $70.")
- vi2m = 1
- p1m = p1m + 70
- m9.st()
- else:
- print("Unable to mortgage that property.")
- p1mc = "x"
- #If player tries to mortgage Virginia Avenue...
- elif p1mc == "Virginia Avenue":
- if vi3 == 1 and vi3m == 0 and vi1h == 0 and vi2h == 0 and vi3h == 0:
- print(p1, "mortgaged Virginia Avenue for $80.")
- vi3m = 1
- p1m = p1m + 80
- m10.st()
- else:
- print("Unable to mortgage that property.")
- p1mc = "x"
- #If player tries to mortgage St. James Place...
- elif p1mc == "St. James Place":
- if or1 == 1 and or1m == 0 and or1h == 0 and or2h == 0 and or3h == 0:
- print(p1, "mortgaged St. James Place for $90.")
- or1m = 1
- p1m = p1m + 90
- m12.st()
- else:
- print("Unable to mortgage that property.")
- p1mc = "x"
- #If player tries to mortgage Tennessee Avenue...
- elif p1mc == "Tennessee Avenue":
- if or2 == 1 and or2m == 0 and or1h == 0 and or2h == 0 and or3h == 0:
- print(p1, "mortgaged Tennessee Avenue for $90.")
- or2m = 1
- p1m = p1m + 90
- m13.st()
- else:
- print("Unable to mortgage that property.")
- p1mc = "x"
- #If player tries to mortgage New York Avenue...
- elif p1mc == "New York Avenue":
- if or3 == 1 and or3m == 0 and or1h == 0 and or2h == 0 and or3h == 0:
- print(p1, "mortgaged New York Avenue for $100.")
- or3m = 1
- p1m = p1m + 100
- m14.st()
- else:
- print("Unable to mortgage that property.")
- p1mc = "x"
- #If player tries to mortgage Kentucky Avenue...
- elif p1mc == "Kentucky Avenue":
- if red1 == 1 and red1m == 0 and red1h == 0 and red2h == 0 and red3h == 0:
- print(p1, "mortgaged Kentucky Avenue for $110.")
- red1m = 1
- p1m = p1m + 110
- m15.st()
- else:
- print("Unable to mortgage that property.")
- p1mc = "x"
- #If player tries to mortgage Indiana Avenue...
- elif p1mc == "Indiana Avenue":
- if red2 == 1 and red2m == 0 and red1h == 0 and red2h == 0 and red3h == 0:
- print(p1, "mortgaged Indiana Avenue for $110.")
- red2m = 1
- p1m = p1m + 110
- m16.st()
- else:
- print("Unable to mortgage that property.")
- p1mc = "x"
- #If player tries to mortgage Illinois Avenue...
- elif p1mc == "Illinois Avenue":
- if red3 == 1 and red3m == 0 and red1h == 0 and red2h == 0 and red3h == 0:
- print(p1, "mortgaged Illinois Avenue for $120.")
- red3m = 1
- p1m = p1m + 120
- m17.st()
- else:
- print("Unable to mortgage that property.")
- p1mc = "x"
- #If player tries to mortgage Atlantic Avenue...
- elif p1mc == "Atlantic Avenue":
- if ye1 == 1 and ye1m == 0 and ye1h == 0 and ye2h == 0 and ye3h == 0:
- print(p1, "mortgaged Atlantic Avenue for $130.")
- ye1m = 1
- p1m = p1m + 130
- m19.st()
- else:
- print("Unable to mortgage that property.")
- p1mc = "x"
- #If player tries to mortgage Ventnor Avenue...
- elif p1mc == "Ventnor Avenue":
- if ye2 == 1 and ye2m == 0 and ye1h == 0 and ye2h == 0 and ye3h == 0:
- print(p1, "mortgaged Ventnor Avenue for 130.")
- ye2m = 1
- p1m = p1m + 130
- m20.st()
- else:
- print("Unable to mortgage that property.")
- p1mc = "x"
- #If player tries to mortgage Marvin Gardens...
- elif p1mc == "Marvin Gardens":
- if ye3 == 1 and ye3m == 0 and ye1h == 0 and ye2h == 0 and ye3h == 0:
- print(p1, "mortgaged Marvin Gardens for $140.")
- ye3m = 1
- p1m = p1m + 140
- m22.st()
- else:
- print("Unable to mortgage that property.")
- p1mc = "x"
- #If player tries to mortgage Pacific Avenue...
- elif p1mc == "Pacific Avenue":
- if gr1 == 1 and gr1m == 0 and gr1h == 0 and gr2h == 0 and gr3h == 0:
- print(p1, "mortgaged Pacific Avenue for $150.")
- gr1m = 1
- p1m = p1m + 150
- m23.st()
- else:
- print("Unable to mortgage that property.")
- p1mc = "x"
- #If player tries to mortgage North Carolina Avenue...
- elif p1mc == "North Carolina Avenue":
- if gr2 == 1 and gr2m == 0 and gr1h == 0 and gr2h == 0 and gr3h == 0:
- print(p1, "mortgaged North Carolina Avenue for $150.")
- gr2m = 1
- p1m = p1m + 150
- m24.st()
- else:
- print("Unable to mortgage that property.")
- p1mc = "x"
- #If player tries to mortgage Pennsylvania Avenue...
- elif p1mc == "Pennsylvania Avenue":
- if gr3 == 1 and gr3m == 0 and gr1h == 0 and gr2h == 0 and gr3h == 0:
- print(p1, "mortgaged Pennsylvania Avenue for $160.")
- gr3m = 1
- p1m = p1m + 160
- m25.st()
- else:
- print("Unable to mortgage that property.")
- p1mc = "x"
- #If player tries to mortgage Park Place...
- elif p1mc == "Park Place":
- if bl1 == 1 and bl1m == 0 and bl1h == 0 and bl2h == 0:
- print(p1, "mortgaged Park Place for $175.")
- bl1m = 1
- p1m = p1m + 175
- m27.st()
- else:
- print("Unable to mortgage that property.")
- p1mc = "x"
- #If player tries to mortgage Boardwalk...
- elif p1mc == "Boardwalk":
- if bl2 == 1 and bl2m == 0 and bl1h == 0 and bl2h == 0:
- print(p1, "mortgaged Boardwalk for $200.")
- bl2m = 1
- p1m = p1m + 200
- m28.st()
- else:
- print("Unable to mortgage that property.")
- p1mc = "x"
- #If player tries to mortgage Reading Railroad...
- elif p1mc == "Reading Railroad":
- if rrr == 1 and rrrm == 0:
- print(p1, "mortgaged Reading Railroad for $100.")
- rrrm = 1
- p1rr = p1rr - 1
- p1m = p1m + 100
- m3.st()
- else:
- print("Unable to mortgage that property.")
- p1mc = "x"
- #If player tries to mortgage Pennsylvania Railroad...
- elif p1mc == "Pennsylvania Railroad":
- if prr == 1 and prrm == 0:
- print(p1, "mortgaged Pennsylvania Railroad for $100.")
- prrm = 1
- p1rr = p1rr - 1
- p1m = p1m + 100
- m11.st()
- else:
- print("Unable to mortgage that property.")
- p1mc = "x"
- #If player tries to mortgage B & O Railroad...
- elif p1mc == "B & O Railroad":
- if brr == 1 and brrm == 0:
- print(p1, "mortgaged B & O Railroad for $100.")
- brrm = 1
- p1rr = p1rr - 1
- p1m = p1m + 100
- m18.st()
- else:
- print("Unable to mortgage that property.")
- p1mc = "x"
- #If player tries to mortgage Short Line...
- elif p1mc == "Short Line":
- if srr == 1 and srrm == 0:
- print(p1, "mortgaged Short Line for $100.")
- srrm = 1
- p1rr = p1rr - 1
- p1m = p1m + 100
- m26.st()
- else:
- print("Unable to mortgage that property.")
- p1mc = "x"
- #If player tries to mortgage Electric Company...
- elif p1mc == "Electric Company":
- if ec == 1 and ecm == 0:
- print(p1, "mortgaged Electric Company for $75.")
- ecm = 1
- p1u = p1u - 1
- p1m = p1m + 75
- m8.st()
- else:
- print("Unable to mortgage that property.")
- p1mc = "x"
- #If player tries to mortgage Water Works...
- elif p1mc == "Water Works":
- if ww == 1 and wwm == 0:
- print(p1, "mortgaged Water Works for $75.")
- wwm = 1
- p1u = p1u - 1
- p1m = p1m + 75
- m21.st()
- else:
- print("Unable to mortgage that property.")
- p1mc = "x"
- #If player is done mortgaging properties...
- elif p1mc == "Done":
- print("Now then...")
- #If player enters an invalid response...
- else:
- print("Invalid response.")
- p1c = "x"
- print()
- #If player chooses to unmortgage...
- elif p1c == "u":
- p1mc = "x"
- #Huge friggin' unmortgaging while loop
- while p1mc != "Mediterranean Avenue" and p1mc != "Baltic Avenue" and p1mc != "Reading Railroad" and p1mc != "Oriental Avenue" and p1mc != "Vermont Avenue" and p1mc != "Connecticut Avenue" and p1mc != "St. Charles Place" and p1mc != "Electric Company" and p1mc != "States Avenue" and p1mc != "Virginia Avenue" and p1mc != "Pennsylvania Railroad" and p1mc != "St. James Place" and p1mc != "Tennessee Avenue" and p1mc != "New York Avenue" and p1mc != "Kentucky Avenue" and p1mc != "Indiana Avenue" and p1mc != "Illinois Avenue" and p1mc != "B & O Railroad" and p1mc != "Atlantic Avenue" and p1mc != "Ventnor Avenue" and p1mc != "Water Works" and p1mc != "Marvin Gardens" and p1mc != "Pacific Avenue" and p1mc != "North Carolina Avenue" and p1mc != "Pennsylvania Avenue" and p1mc != "Short Line" and p1mc != "Park Place" and p1mc != "Boardwalk" and p1mc != "Done":
- print("Unmortgage which properties?")
- print("``````````````````````````")
- if br1 == 1 and br1m == 1:
- print("Mediterranean Avenue (-$33)")
- if br2 == 1 and br2m == 1:
- print("Baltic Avenue (-$33)")
- if cy1 == 1 and cy1m == 1:
- print("Oriental Avenue (-$55)")
- if cy2 == 1 and cy2m == 1:
- print("Vermont Avenue (-$55)")
- if cy3 == 1 and cy3m == 1:
- print("Connecticut Avenue (-$66)")
- if vi1 == 1 and vi1m == 1:
- print("St. Charles Place (-$77)")
- if vi2 == 1 and vi2m == 1:
- print("States Avenue (-$77)")
- if vi3 == 1 and vi3m == 1:
- print("Virginia Avenue (-$88)")
- if or1 == 1 and or1m == 1:
- print("St. James Place (-$99)")
- if or2 == 1 and or2m == 1:
- print("Tennessee Avenue (-$99)")
- if or3 == 1 and or3m == 1:
- print("New York Avenue (-$110)")
- if red1 == 1 and red1m == 1:
- print("Kentucky Avenue (-$121)")
- if red2 == 1 and red2m == 1:
- print("Indiana Avenue (-$121)")
- if red3 == 1 and red3m == 1:
- print("Illinois Avenue (-$132)")
- if ye1 == 1 and ye1m == 1:
- print("Atlantic Avenue (-$143)")
- if ye2 == 1 and ye2m == 1:
- print("Ventnor Avenue (-$143)")
- if ye3 == 1 and ye3m == 1:
- print("Marvin Gardens (-$154)")
- if gr1 == 1 and gr1m == 1:
- print("Pacific Avenue (-$165)")
- if gr2 == 1 and gr2m == 1:
- print("North Carolina Avenue (-$165)")
- if gr3 == 1 and gr3m == 1:
- print("Pennsylvania Avenue (-$176)")
- if bl1 == 1 and bl1m == 1:
- print("Park Place (-$192)")
- if bl2 == 1 and bl2m == 1:
- print("Boardwalk (-$220)")
- if rrr == 1 and rrrm == 1:
- print("Reading Railroad (-$110)")
- if prr == 1 and prrm == 1:
- print("Pennsylvania Railroad (-$110)")
- if brr == 1 and brrm == 1:
- print("B & O Railroad (-$110)")
- if srr == 1 and srrm == 1:
- print("Short Line (-$110)")
- if ec == 1 and ecm == 1:
- print("Electric Company (-$82)")
- if ww == 1 and wwm == 1:
- print("Water Works (-$82)")
- print("``````````````````````````")
- print("(Type 'Done' to finish)")
- p1mc = input()
- print()
- #If player tries to unmortgage Mediterranean Avenue...
- if p1mc == "Mediterranean Avenue":
- if br1 == 1 and br1m == 1 and p1m >= 33:
- print(p1, "unmortgaged Mediterranean Avenue for $33.")
- br1m = 0
- p1m = p1m - 33
- m1.ht()
- else:
- print("Unable to unmortgage that property.")
- p1mc = "x"
- #If player tries to unmortgage Baltic Avenue...
- elif p1mc == "Baltic Avenue":
- if br2 == 1 and br2m == 1 and p1m >= 33:
- print(p1, "unmortgaged Baltic Avenue for $33.")
- br2m = 0
- p1m = p1m - 33
- m2.ht()
- else:
- print("Unable to unmortgage that property.")
- p1mc = "x"
- #If player tries to unmortgage Oriental Avenue...
- elif p1mc == "Oriental Avenue":
- if cy1 == 1 and cy1m == 1 and p1m >= 55:
- print(p1, "unmortgaged Oriental Avenue for $55.")
- cy1m = 0
- p1m = p1m - 55
- m4.ht()
- else:
- print("Unable to unmortgage that property.")
- p1mc = "x"
- #If player tries to unmortgage Vermont Avenue...
- elif p1mc == "Vermont Avenue":
- if cy2 == 1 and cy2m == 1 and p1m >= 55:
- print(p1, "unmortgaged Vermont Avenue for $55.")
- cy2m = 0
- p1m = p1m - 55
- m5.ht()
- else:
- print("Unable to unmortgage that property.")
- p1mc = "x"
- #If player tries to unmortgage Connecticut Avenue...
- elif p1mc == "Connecticut Avenue":
- if cy3 == 1 and cy3m == 1 and p1m >= 66:
- print(p1, "unmortgaged Connecticut Avenue for $66.")
- cy3m = 0
- p1m = p1m - 66
- m6.ht()
- else:
- print("Unable to unmortgage that property.")
- p1mc = "x"
- #If player tries to unmortgage St. Charles Place...
- elif p1mc == "St. Charles Place":
- if vi1 == 1 and vi1m == 1 and p1m >= 77:
- print(p1, "unmortgaged St. Charles Place for $77.")
- vi1m = 0
- p1m = p1m - 77
- m7.ht()
- else:
- print("Unable to unmortgage that property.")
- p1mc = "x"
- #If player tries to unmortgage States Avenue...
- elif p1mc == "States Avenue":
- if vi2 == 1 and vi2m == 1 and p1m >= 77:
- print(p1, "unmortgaged States Avenue for $77.")
- vi2m = 0
- p1m = p1m - 77
- m9.ht()
- else:
- print("Unable to unmortgage that property.")
- p1mc = "x"
- #If player tries to unmortgage Virginia Avenue...
- elif p1mc == "Virginia Avenue":
- if vi3 == 1 and vi3m == 1 and p1m >= 88:
- print(p1, "unmortgaged Virginia Avenue for $88.")
- vi3m = 0
- p1m = p1m - 88
- m10.ht()
- else:
- print("Unable to unmortgage that property.")
- p1mc = "x"
- #If player tries to unmortgage St. James Place...
- elif p1mc == "St. James Place":
- if or1 == 1 and or1m == 1 and p1m >= 99:
- print(p1, "unmortgaged St. James Place for $99.")
- or1m = 0
- p1m = p1m - 99
- m12.ht()
- else:
- print("Unable to unmortgage that property.")
- p1mc = "x"
- #If player tries to unmortgage Tennessee Avenue...
- elif p1mc == "Tennessee Avenue":
- if or2 == 1 and or2m == 1 and p1m >= 99:
- print(p1, "unmortgaged Tennessee Avenue for $99.")
- or2m = 0
- p1m = p1m - 99
- m13.ht()
- else:
- print("Unable to unmortgage that property.")
- p1mc = "x"
- #If player tries to unmortgage New York Avenue...
- elif p1mc == "New York Avenue":
- if or3 == 1 and or3m == 1 and p1m >= 110:
- print(p1, "unmortgaged New York Avenue for $110.")
- or3m = 0
- p1m = p1m - 110
- m14.ht()
- else:
- print("Unable to unmortgage that property.")
- p1mc = "x"
- #If player tries to unmortgage Kentucky Avenue...
- elif p1mc == "Kentucky Avenue":
- if red1 == 1 and red1m == 1 and p1m >= 121:
- print(p1, "unmortgaged Kentucky Avenue for $121.")
- red1m = 0
- p1m = p1m - 121
- m15.ht()
- else:
- print("Unable to unmortgage that property.")
- p1mc = "x"
- #If player tries to unmortgage Indiana Avenue...
- elif p1mc == "Indiana Avenue":
- if red2 == 1 and red2m == 1 and p1m >= 121:
- print(p1, "unmortgaged Indiana Avenue for $121.")
- red2m = 0
- p1m = p1m - 121
- m16.ht()
- else:
- print("Unable to unmortgage that property.")
- p1mc = "x"
- #If player tries to unmortgage Illinois Avenue...
- elif p1mc == "Illinois Avenue":
- if red3 == 1 and red3m == 1 and p1m >= 132:
- print(p1, "unmortgaged Illinois Avenue for $132.")
- red3m = 0
- p1m = p1m - 132
- m17.ht()
- else:
- print("Unable to unmortgage that property.")
- p1mc = "x"
- #If player tries to unmortgage Atlantic Avenue...
- elif p1mc == "Atlantic Avenue":
- if ye1 == 1 and ye1m == 1 and p1m >= 143:
- print(p1, "unmortgaged Atlantic Avenue for $143.")
- ye1m = 0
- p1m = p1m - 143
- m19.ht()
- else:
- print("Unable to unmortgage that property.")
- p1mc = "x"
- #If player tries to unmortgage Ventnor Avenue...
- elif p1mc == "Ventnor Avenue":
- if ye2 == 1 and ye2m == 1 and p1m >= 143:
- print(p1, "unmortgaged Ventnor Avenue for 143.")
- ye2m = 0
- p1m = p1m - 143
- m20.ht()
- else:
- print("Unable to unmortgage that property.")
- p1mc = "x"
- #If player tries to unmortgage Marvin Gardens...
- elif p1mc == "Marvin Gardens":
- if ye3 == 1 and ye3m == 1 and p1m >= 154:
- print(p1, "unmortgaged Marvin Gardens for $154.")
- ye3m = 0
- p1m = p1m - 154
- m22.ht()
- else:
- print("Unable to unmortgage that property.")
- p1mc = "x"
- #If player tries to unmortgage Pacific Avenue...
- elif p1mc == "Pacific Avenue":
- if gr1 == 1 and gr1m == 1 and p1m >= 165:
- print(p1, "unmortgaged Pacific Avenue for $165.")
- gr1m = 0
- p1m = p1m - 165
- m23.ht()
- else:
- print("Unable to unmortgage that property.")
- p1mc = "x"
- #If player tries to unmortgage North Carolina Avenue...
- elif p1mc == "North Carolina Avenue":
- if gr2 == 1 and gr2m == 1 and p1m >= 165:
- print(p1, "unmortgaged North Carolina Avenue for $165.")
- gr2m = 0
- p1m = p1m - 165
- m24.ht()
- else:
- print("Unable to unmortgage that property.")
- p1mc = "x"
- #If player tries to unmortgage Pennsylvania Avenue...
- elif p1mc == "Pennsylvania Avenue":
- if gr3 == 1 and gr3m == 1 and p1m >= 176:
- print(p1, "unmortgaged Pennsylvania Avenue for $176.")
- gr3m = 0
- p1m = p1m - 176
- m25.ht()
- else:
- print("Unable to unmortgage that property.")
- p1mc = "x"
- #If player tries to unmortgage Park Place...
- elif p1mc == "Park Place":
- if bl1 == 1 and bl1m == 1 and p1m >= 192:
- print(p1, "unmortgaged Park Place for $192.")
- bl1m = 0
- p1m = p1m - 192
- m27.ht()
- else:
- print("Unable to unmortgage that property.")
- p1mc = "x"
- #If player tries to unmortgage Boardwalk...
- elif p1mc == "Boardwalk":
- if bl2 == 1 and bl2m == 1 and p1m >= 220:
- print(p1, "unmortgaged Boardwalk for $220.")
- bl2m = 0
- p1m = p1m - 220
- m28.ht()
- else:
- print("Unable to unmortgage that property.")
- p1mc = "x"
- #If player tries to unmortgage Reading Railroad...
- elif p1mc == "Reading Railroad":
- if rrr == 1 and rrrm == 1 and p1m >= 110:
- print(p1, "unmortgaged Reading Railroad for $110.")
- rrrm = 0
- p1rr = p1rr + 1
- p1m = p1m - 110
- m3.ht()
- else:
- print("Unable to unmortgage that property.")
- p1mc = "x"
- #If player tries to unmortgage Pennsylvania Railroad...
- elif p1mc == "Pennsylvania Railroad":
- if prr == 1 and prrm == 1 and p1m >= 110:
- print(p1, "unmortgaged Pennsylvania Railroad for $110.")
- prrm = 0
- p1rr = p1rr + 1
- p1m = p1m - 110
- m11.ht()
- else:
- print("Unable to unmortgage that property.")
- p1mc = "x"
- #If player tries to unmortgage B & O Railroad...
- elif p1mc == "B & O Railroad":
- if brr == 1 and brrm == 1 and p1m >= 110:
- print(p1, "unmortgaged B & O Railroad for $110.")
- brrm = 0
- p1rr = p1rr + 1
- p1m = p1m - 110
- m18.ht()
- else:
- print("Unable to unmortgage that property.")
- p1mc = "x"
- #If player tries to unmortgage Short Line...
- elif p1mc == "Short Line":
- if srr == 1 and srrm == 1 and p1m >= 110:
- print(p1, "unmortgaged Short Line for $110.")
- srrm = 0
- p1rr = p1rr + 1
- p1m = p1m - 110
- m26.ht()
- else:
- print("Unable to unmortgage that property.")
- p1mc = "x"
- #If player tries to unmortgage Electric Company...
- elif p1mc == "Electric Company":
- if ec == 1 and ecm == 1 and p1m >= 82:
- print(p1, "unmortgaged Electric Company for $82.")
- ecm = 0
- p1u = p1u + 1
- p1m = p1m - 82
- m8.ht()
- else:
- print("Unable to unmortgage that property.")
- p1mc = "x"
- #If player tries to unmortgage Water Works...
- elif p1mc == "Water Works":
- if ww == 1 and wwm == 1 and p1m >= 82:
- print(p1, "unmortgaged Water Works for $82.")
- wwm = 0
- p1u = p1u + 1
- p1m = p1m - 82
- m21.ht()
- else:
- print("Unable to unmortgage that property.")
- p1mc = "x"
- #If player is done mortgaging properties...
- elif p1mc == "Done":
- print("Now then...")
- #If player enters an invalid response...
- else:
- print("Invalid response.")
- p1c = "x"
- print()
- #If player chooses to build houses...
- elif p1c == "b":
- p1hc = "x"
- #Huge friggin' house-building while loop
- while p1hc != "Mediterranean Avenue" and p1mc != "Baltic Avenue" and p1mc != "Oriental Avenue" and p1mc != "Vermont Avenue" and p1mc != "Connecticut Avenue" and p1mc != "St. Charles Place" and p1mc != "States Avenue" and p1mc != "Virginia Avenue" and p1mc != "St. James Place" and p1mc != "Tennessee Avenue" and p1mc != "New York Avenue" and p1mc != "Kentucky Avenue" and p1mc != "Indiana Avenue" and p1mc != "Illinois Avenue" and p1mc != "Atlantic Avenue" and p1mc != "Ventnor Avenue" and p1mc != "Marvin Gardens" and p1mc != "Pacific Avenue" and p1mc != "North Carolina Avenue" and p1mc != "Pennsylvania Avenue" and p1mc != "Park Place" and p1mc != "Boardwalk" and p1mc != "Done":
- print("Build house on which property?")
- print("``````````````````````````")
- if p1m >= 50:
- if br1 == 1 and br2 == 1 and br1m == 0 and br2m == 0:
- if br1h <= br2h and br1h < 5:
- print("Mediterranean Avenue (-$50)")
- if br2h <= br1h and br2h < 5:
- print("Baltic Avenue (-$50)")
- if cy1 == 1 and cy2 == 1 and cy3 == 1 and cy1m == 0 and cy2m == 0 and cy3m == 0:
- if cy1h <= cy2h and cy1h <= cy3h and cy1h < 5:
- print("Oriental Avenue (-$50)")
- if cy2h <= cy1h and cy2h <= cy3h and cy2h < 5:
- print("Vermont Avenue (-$50)")
- if cy3h <= cy1h and cy3h <= cy2h and cy3h < 5:
- print("Connecticut Avenue (-$50)")
- if p1m >= 100:
- if vi1 == 1 and vi2 == 1 and vi3 == 1 and vi1m == 0 and vi2m == 0 and vi3m == 0:
- if vi1h <= vi2h and vi1h <= vi3h and vi1h < 5:
- print("St. Charles Place (-$100)")
- if vi2h <= vi1h and vi2h <= vi3h and vi2h < 5:
- print("States Avenue (-$100)")
- if vi3h <= vi1h and vi3h <= vi2h and vi3h < 5:
- print("Virginia Avenue (-$100)")
- if or1 == 1 and or2 == 1 and or3 == 1 and or1m == 0 and or2m == 0 and or3m == 0:
- if or1h <= or2h and or1h <= or3h and or1h < 5:
- print("St. James Place (-$100)")
- if or2h <= or1h and or2h <= or3h and or2h < 5:
- print("Tennessee Avenue (-$100)")
- if or3h <= or1h and or3h <= or2h and or3h < 5:
- print("New York Avenue (-$100)")
- if p1m >= 150:
- if red1 == 1 and red2 == 1 and red3 == 1 and red1m == 0 and red2m == 0 and red3m == 0:
- if red1h <= red2h and red1h <= red3h and red1h < 5:
- print("Kentucky Avenue (-$150)")
- if red2h <= red1h and red2h <= red3h and red2h < 5:
- print("Indiana Avenue (-$150)")
- if cy3h <= red1h and red3h <= red2h and red3h < 5:
- print("Illinois Avenue (-$150)")
- if ye1 == 1 and ye2 == 1 and ye3 == 1 and ye1m == 0 and ye2m == 0 and ye3m == 0:
- if ye1h <= ye2h and ye1h <= ye3h and ye1h < 5:
- print("Atlantic Avenue (-$150)")
- if ye2h <= ye1h and ye2h <= ye3h and ye2h < 5:
- print("Ventnor Avenue (-$150)")
- if ye3h <= ye1h and ye3h <= ye2h and ye3h < 5:
- print("Marvin Gardens (-$150)")
- if p1m >= 200:
- if gr1 == 1 and gr2 == 1 and gr3 == 1 and gr1m == 0 and gr2m == 0 and gr3m == 0:
- if gr1h <= gr2h and gr1h <= gr3h and gr1h < 5:
- print("Pacific Avenue (-$200)")
- if gr2h <= gr1h and gr2h <= gr3h and gr2h < 5:
- print("North Carolina Avenue (-$200)")
- if gr3h <= gr1h and gr3h <= gr2h and gr3h < 5:
- print("Pennsylvania Avenue (-$200)")
- if bl1 == 1 and bl2 == 1 and bl1m == 0 and bl2m == 0:
- if bl1h <= bl2h and bl1h < 5:
- print("Park Place (-$200)")
- if bl2h <= bl1h and bl2h < 5:
- print("Boardwalk (-$200)")
- print("``````````````````````````")
- print("(Type 'Done' to finish)")
- p1hc = input()
- print()
- #If player tries to build house on Mediterranean Avenue...
- if p1hc == "Mediterranean Avenue":
- if p1m >= 50 and br1 == 1 and br2 == 1 and br1m == 0 and br2m == 0 and br1h <= br2h and br1h < 5:
- if br1h < 4:
- print("Built a house on Mediterranean Avenue!")
- elif br1h == 4:
- print("Built a hotel on Mediterranean Avenue!")
- br1h = br1h + 1
- p1m = p1m - 50
- #Determines how many houses to display
- if br1h == 1:
- h1.shape(house)
- h1.st()
- if br1h == 2:
- h1.shape(house2)
- if br1h == 3:
- h1.shape(house3)
- if br1h == 4:
- h1.shape(house4)
- if br1h == 5:
- h1.shape(hotel)
- else:
- print("Unable to build on Mediterranean Avenue.")
- #If player tries to build house on Baltic Avenue...
- if p1hc == "Baltic Avenue":
- if p1m >= 50 and br1 == 1 and br2 == 1 and br1m == 0 and br2m == 0 and br2h <= br1h and br2h < 5:
- if br2h < 4:
- print("Built a house on Baltic Avenue!")
- elif br2h == 4:
- print("Built a hotel on Baltic Avenue!")
- br2h = br2h + 1
- p1m = p1m - 50
- #Determines how many houses to display
- if br2h == 1:
- h2.shape(house)
- h2.st()
- if br2h == 2:
- h2.shape(house2)
- if br2h == 3:
- h2.shape(house3)
- if br2h == 4:
- h2.shape(house4)
- if br2h == 5:
- h2.shape(hotel)
- else:
- print("Unable to build on Baltic Avenue.")
- #If player tries to build house on Oriental Avenue...
- if p1hc == "Oriental Avenue":
- if p1m >= 50 and cy1 == 1 and cy2 == 1 and cy3 == 1 and cy1m == 0 and cy2m == 0 and cy3m == 0 and cy1h <= cy2h and cy1h <= cy3h and cy1h < 5:
- if cy1h < 4:
- print("Built a house on Oriental Avenue!")
- elif cy1h == 4:
- print("Built a hotel on Oriental Avenue!")
- cy1h = cy1h + 1
- p1m = p1m - 50
- #Determines how many houses to display
- if cy1h == 1:
- h3.shape(house)
- h3.st()
- if cy1h == 2:
- h3.shape(house2)
- if cy1h == 3:
- h3.shape(house3)
- if cy1h == 4:
- h3.shape(house4)
- if cy1h == 5:
- h3.shape(hotel)
- else:
- print("Unable to build on Oriental Avenue.")
- #If player tries to build house on Vermont Avenue...
- if p1hc == "Vermont Avenue":
- if p1m >= 50 and cy1 == 1 and cy2 == 1 and cy3 == 1 and cy1m == 0 and cy2m == 0 and cy3m == 0 and cy2h <= cy1h and cy2h <= cy3h and cy2h < 5:
- if cy2h < 4:
- print("Built a house on Vermont Avenue!")
- elif cy2h == 4:
- print("Built a hotel on Vermont Avenue!")
- cy2h = cy2h + 1
- p1m = p1m - 50
- #Determines how many houses to display
- if cy2h == 1:
- h4.shape(house)
- h4.st()
- if cy2h == 2:
- h4.shape(house2)
- if cy2h == 3:
- h4.shape(house3)
- if cy2h == 4:
- h4.shape(house4)
- if cy2h == 5:
- h4.shape(hotel)
- else:
- print("Unable to build on Vermont Avenue.")
- #If player tries to build house on Connecticut Avenue...
- if p1hc == "Connecticut Avenue":
- if p1m >= 50 and cy1 == 1 and cy2 == 1 and cy3 == 1 and cy1m == 0 and cy2m == 0 and cy3m == 0 and cy3h <= cy1h and cy3h <= cy2h and cy3h < 5:
- if cy3h < 4:
- print("Built a house on Connecticut Avenue!")
- elif cy3h == 4:
- print("Built a hotel on Connecticut Avenue!")
- cy3h = cy3h + 1
- p1m = p1m - 50
- #Determines how many houses to display
- if cy3h == 1:
- h5.shape(house)
- h5.st()
- if cy3h == 2:
- h5.shape(house2)
- if cy3h == 3:
- h5.shape(house3)
- if cy3h == 4:
- h5.shape(house4)
- if cy3h == 5:
- h5.shape(hotel)
- else:
- print("Unable to build on Connecticut Avenue.")
- #If player chooses to sell houses...
- elif p1c == "s":
- p1hc = "x"
- #If player chooses to trade...
- elif p1c == "t":
- p1tc = "x"
- #If player gives an invalid response...
- else:
- print("\nInvalid response.")
- ########Sets dice value
- if p1j == 0:
- die1 = random.randint(1, 6)
- die2 = random.randint(1, 6)
- print(p1, "rolled a", str(die1), "and a", str(die2) + "!\n")
- ############Checks to make sure player space is below 40
- for i in range(die1 + die2):
- if p1s < 40:
- if p1x > -333 and p1y == -335:
- if p1s == 0 or p1s == 9:
- p1x = p1x - 82
- else:
- p1x = p1x - 63
- elif p1x == -333 and p1y < 333:
- if p1s == 10 or p1s == 19:
- p1y = p1y + 82
- else:
- p1y = p1y + 63
- elif p1x < 335 and p1y == 333:
- if p1s == 20 or p1s == 29:
- p1x = p1x + 82
- else:
- p1x = p1x + 63
- elif p1x == 335 and p1y > -335:
- if p1s == 30 or p1s == 39:
- p1y = p1y - 82
- else:
- p1y = p1y - 63
- #Sets player position on board
- player1.setpos(p1x, p1y)
- #Increases space player resides on
- p1s = p1s + 1
- #Resets player 1 space count to 0 when passing 39
- if p1s == 40:
- print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~")
- print(p1, "collects $200 for crossing Go!")
- print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~")
- p1m = p1m + 200
- p1s = 0
- ############Tells what space player lands on
- print("Landed on", space[p1s] + ".", end='')
- input()
- ############If player lands on Mediterranean Avenue...
- if p1s == 1:
- print()
- #If property is unowned...
- if br1 == 0:
- price = 60
- #Checks to ensure y/n answer is given
- while buy != "y" and buy != "n":
- buy = input("Do you want to buy Mediterranean Avenue for $60? (y/n): ")
- #If player wants to buy the property...
- if buy == "y":
- #Success!
- if p1m >= 60:
- print(p1, "bought", space[p1s], "for $" + str(price) + "!")
- p1m = p1m - price
- br1 = 1
- #Not enough money!
- else:
- print("Insufficient funds.")
- #If player doesn't want to buy the property...
- elif buy == "n":
- print(p1, "chose to ignore the property.")
- #If player gives a response that is not "y" or "n"...
- else:
- print("Invalid response.")
- #If Player One owns the property...
- elif br1 == 1:
- print(p1, "stays a free night in their own property.")
- #If Player Two owns the property...
- elif br1 == 2:
- #If property is not mortgaged...
- if br1m == 0:
- br1r = 2
- #If player owns a Monopoly over all colors of the property...
- if br2 == 2:
- br1r = 4
- #If player has 1 house on property...
- if br1h == 1:
- br1r = 10
- #If player has 2 houses on property...
- elif br1h == 2:
- br1r = 30
- #If player has 3 houses on property...
- elif br1h == 3:
- br1r = 90
- #If player has 4 houses on property...
- elif br1h == 4:
- br1r = 160
- #If player has a hotel on property...
- elif br1h == 5:
- br1r = 250
- #If player does not own a Monopoly over all colors of the property...
- elif br2 != 2:
- br1r = 2
- #Player One pays Player Two rent
- print(p1, "pays", p2, "$" + str(br1r) + "!")
- p1m = p1m - br1r
- p2m = p2m + br1r
- #If property is mortgaged...
- elif br1m == 1:
- print("Mediterranean Avenue is currently mortgaged.")
- ############If player lands on Baltic Avenue...
- if p1s == 3:
- print()
- #If property is unowned...
- if br2 == 0:
- price = 60
- #Checks to ensure y/n answer is given
- while buy != "y" and buy != "n":
- buy = input("Do you want to buy Baltic Avenue for $60? (y/n): ")
- #If player wants to buy the property...
- if buy == "y":
- #Success!
- if p1m >= 60:
- print(p1, "bought", space[p1s], "for $" + str(price) + "!")
- p1m = p1m - price
- br2 = 1
- #Not enough money!
- else:
- print("Insufficient funds.")
- #If player doesn't want to buy the property...
- elif buy == "n":
- print(p1, "chose to ignore the property.")
- #If player gives a response that is not "y" or "n"...
- else:
- print("Invalid response.")
- #If Player One owns the property...
- elif br2 == 1:
- print(p1, "stays a free night in their own property.")
- #If Player Two owns the property...
- elif br2 == 2:
- #If property is not mortgaged...
- if br2m == 0:
- br2r = 4
- #If player owns a Monopoly over all colors of the property...
- if br1 == 2:
- br2r = 8
- #If player has 1 house on property...
- if br2h == 1:
- br2r = 20
- #If player has 2 houses on property...
- elif br2h == 2:
- br2r = 60
- #If player has 3 houses on property...
- elif br2h == 3:
- br2r = 180
- #If player has 4 houses on property...
- elif br2h == 4:
- br2r = 320
- #If player has a hotel on property...
- elif br2h == 5:
- br2r = 450
- #If player does not own a Monopoly over all colors of the property...
- elif br1 != 2:
- br2r = 4
- #Player One pays Player Two rent
- print(p1, "pays", p2, "$" + str(br2r) + "!")
- p1m = p1m - br2r
- p2m = p2m + br2r
- #If property is mortgaged...
- elif br2m == 1:
- print("Baltic Avenue is currently mortgaged.")
- ############If player lands on Oriental Avenue...
- if p1s == 6:
- print()
- #If property is unowned...
- if cy1 == 0:
- price = 100
- #Checks to ensure y/n answer is given
- while buy != "y" and buy != "n":
- buy = input("Do you want to buy Oriental Avenue for $100? (y/n): ")
- #If player wants to buy the property...
- if buy == "y":
- #Success!
- if p1m >= 100:
- print(p1, "bought", space[p1s], "for $" + str(price) + "!")
- p1m = p1m - price
- cy1 = 1
- #Not enough money!
- else:
- print("Insufficient funds.")
- #If player doesn't want to buy the property...
- elif buy == "n":
- print(p1, "chose to ignore the property.")
- #If player gives a response that is not "y" or "n"...
- else:
- print("Invalid response.")
- #If Player One owns the property...
- elif cy1 == 1:
- print(p1, "stays a free night in their own property.")
- #If Player Two owns the property...
- elif cy1 == 2:
- #If property is not mortgaged...
- if cy1m == 0:
- cy1r = 6
- #If player owns a Monopoly over all colors of the property...
- if cy2 == 2 and cy3 == 2:
- cy1r = 12
- #If player has 1 house on property...
- if cy1h == 1:
- cy1r = 30
- #If player has 2 houses on property...
- elif cy1h == 2:
- cy1r = 90
- #If player has 3 houses on property...
- elif cy1h == 3:
- cy1r = 270
- #If player has 4 houses on property...
- elif cy1h == 4:
- cy1r = 400
- #If player has a hotel on property...
- elif cy1h == 5:
- cy1r = 550
- #If player does not own a Monopoly over all colors of the property...
- elif cy2 != 2 or cy3 != 2:
- cy1r = 6
- #Player One pays Player Two rent
- print(p1, "pays", p2, "$" + str(cy1r) + "!")
- p1m = p1m - cy1r
- p2m = p2m + cy1r
- #If property is mortgaged...
- elif cy1m == 1:
- print("Oriental Avenue is currently mortgaged.")
- ############If player lands on Vermont Avenue...
- if p1s == 8:
- print()
- #If property is unowned...
- if cy2 == 0:
- price = 100
- #Checks to ensure y/n answer is given
- while buy != "y" and buy != "n":
- buy = input("Do you want to buy Vermont Avenue for $100? (y/n): ")
- #If player wants to buy the property...
- if buy == "y":
- #Success!
- if p1m >= 100:
- print(p1, "bought", space[p1s], "for $" + str(price) + "!")
- p1m = p1m - price
- cy2 = 1
- #Not enough money!
- else:
- print("Insufficient funds.")
- #If player doesn't want to buy the property...
- elif buy == "n":
- print(p1, "chose to ignore the property.")
- #If player gives a response that is not "y" or "n"...
- else:
- print("Invalid response.")
- #If Player One owns the property...
- elif cy2 == 1:
- print(p1, "stays a free night in their own property.")
- #If Player Two owns the property...
- elif cy2 == 2:
- #If property is not mortgaged...
- if cy2m == 0:
- cy2r = 6
- #If player owns a Monopoly over all colors of the property...
- if cy1 == 2 and cy3 == 2:
- cy2r = 12
- #If player has 1 house on property...
- if cy2h == 1:
- cy2r = 30
- #If player has 2 houses on property...
- elif cy2h == 2:
- cy2r = 90
- #If player has 3 houses on property...
- elif cy2h == 3:
- cy2r = 270
- #If player has 4 houses on property...
- elif cy2h == 4:
- cy2r = 400
- #If player has a hotel on property...
- elif cy2h == 5:
- cy2r = 550
- #If player does not own a Monopoly over all colors of the property...
- elif cy1 != 2 or cy3 != 2:
- cy2r = 6
- #Player One pays Player Two rent
- print(p1, "pays", p2, "$" + str(cy2r) + "!")
- p1m = p1m - cy2r
- p2m = p2m + cy2r
- #If property is mortgaged...
- elif cy2m == 1:
- print("Vermont Avenue is currently mortgaged.")
- ############If player lands on Connecticut Avenue...
- if p1s == 9:
- print()
- #If property is unowned...
- if cy3 == 0:
- price = 120
- #Checks to ensure y/n answer is given
- while buy != "y" and buy != "n":
- buy = input("Do you want to buy Connecticut Avenue for $120? (y/n): ")
- #If player wants to buy the property...
- if buy == "y":
- #Success!
- if p1m >= 120:
- print(p1, "bought", space[p1s], "for $" + str(price) + "!")
- p1m = p1m - price
- cy3 = 1
- #Not enough money!
- else:
- print("Insufficient funds.")
- #If player doesn't want to buy the property...
- elif buy == "n":
- print(p1, "chose to ignore the property.")
- #If player gives a response that is not "y" or "n"...
- else:
- print("Invalid response.")
- #If Player One owns the property...
- elif cy3 == 1:
- print(p1, "stays a free night in their own property.")
- #If Player Two owns the property...
- elif cy3 == 2:
- #If property is not mortgaged...
- if cy3m == 0:
- cy3r = 8
- #If player owns a Monopoly over all colors of the property...
- if cy1 == 2 and cy2 == 2:
- cy3r = 16
- #If player has 1 house on property...
- if cy3h == 1:
- cy3r = 40
- #If player has 2 houses on property...
- elif cy3h == 2:
- cy3r = 100
- #If player has 3 houses on property...
- elif cy3h == 3:
- cy3r = 300
- #If player has 4 houses on property...
- elif cy3h == 4:
- cy3r = 450
- #If player has a hotel on property...
- elif cy3h == 5:
- cy3r = 600
- #If player does not own a Monopoly over all colors of the property...
- elif cy1 != 2 or cy2 != 2:
- cy3r = 8
- #Player One pays Player Two rent
- print(p1, "pays", p2, "$" + str(cy3r) + "!")
- p1m = p1m - cy3r
- p2m = p2m + cy3r
- #If property is mortgaged...
- elif cy3m == 1:
- print("Connecticut Avenue is currently mortgaged.")
- ############If player lands on St. Charles Place...
- if p1s == 11:
- print()
- #If property is unowned...
- if vi1 == 0:
- price = 140
- #Checks to ensure y/n answer is given
- while buy != "y" and buy != "n":
- buy = input("Do you want to buy St. Charles Place for $140? (y/n): ")
- #If player wants to buy the property...
- if buy == "y":
- #Success!
- if p1m >= 140:
- print(p1, "bought", space[p1s], "for $" + str(price) + "!")
- p1m = p1m - price
- vi1 = 1
- #Not enough money!
- else:
- print("Insufficient funds.")
- #If player doesn't want to buy the property...
- elif buy == "n":
- print(p1, "chose to ignore the property.")
- #If player gives a response that is not "y" or "n"...
- else:
- print("Invalid response.")
- #If Player One owns the property...
- elif vi1 == 1:
- print(p1, "stays a free night in their own property.")
- #If Player Two owns the property...
- elif vi1 == 2:
- #If property is not mortgaged...
- if vi1m == 0:
- vi1r = 10
- #If player owns a Monopoly over all colors of the property...
- if vi2 == 2 and vi3 == 2:
- vi1r = 20
- #If player has 1 house on property...
- if vi1h == 1:
- vi1r = 50
- #If player has 2 houses on property...
- elif vi1h == 2:
- vi1r = 150
- #If player has 3 houses on property...
- elif vi1h == 3:
- vi1r = 450
- #If player has 4 houses on property...
- elif vi1h == 4:
- vi1r = 625
- #If player has a hotel on property...
- elif vi1h == 5:
- vi1r = 750
- #If player does not own a Monopoly over all colors of the property...
- elif vi2 != 2 or vi3 != 2:
- vi1r = 10
- #Player One pays Player Two rent
- print(p1, "pays", p2, "$" + str(vi1r) + "!")
- p1m = p1m - vi1r
- p2m = p2m + vi1r
- #If property is mortgaged...
- elif vi1m == 1:
- print("St. Charles Place is currently mortgaged.")
- ############If player lands on States Avenue...
- if p1s == 13:
- print()
- #If property is unowned...
- if vi2 == 0:
- price = 140
- #Checks to ensure y/n answer is given
- while buy != "y" and buy != "n":
- buy = input("Do you want to buy States Avenue for $140? (y/n): ")
- #If player wants to buy the property...
- if buy == "y":
- #Success!
- if p1m >= 140:
- print(p1, "bought", space[p1s], "for $" + str(price) + "!")
- p1m = p1m - price
- vi2 = 1
- #Not enough money!
- else:
- print("Insufficient funds.")
- #If player doesn't want to buy the property...
- elif buy == "n":
- print(p1, "chose to ignore the property.")
- #If player gives a response that is not "y" or "n"...
- else:
- print("Invalid response.")
- #If Player One owns the property...
- elif vi2 == 1:
- print(p1, "stays a free night in their own property.")
- #If Player Two owns the property...
- elif vi2 == 2:
- #If property is not mortgaged...
- if vi2m == 0:
- vi2r = 10
- #If player owns a Monopoly over all colors of the property...
- if vi1 == 2 and vi3 == 2:
- vi2r = 20
- #If player has 1 house on property...
- if vi2h == 1:
- vi2r = 50
- #If player has 2 houses on property...
- elif vi2h == 2:
- vi2r = 150
- #If player has 3 houses on property...
- elif vi2h == 3:
- vi2r = 450
- #If player has 4 houses on property...
- elif vi2h == 4:
- vi2r = 625
- #If player has a hotel on property...
- elif vi2h == 5:
- vi2r = 750
- #If player does not own a Monopoly over all colors of the property...
- elif vi1 != 2 or vi3 != 2:
- vi2r = 10
- #Player One pays Player Two rent
- print(p1, "pays", p2, "$" + str(vi2r) + "!")
- p1m = p1m - vi2r
- p2m = p2m + vi2r
- #If property is mortgaged...
- elif vi2m == 1:
- print("States Avenue is currently mortgaged.")
- ############If player lands on Virginia Avenue...
- if p1s == 14:
- print()
- #If property is unowned...
- if vi3 == 0:
- price = 160
- #Checks to ensure y/n answer is given
- while buy != "y" and buy != "n":
- buy = input("Do you want to buy Virginia Avenue for $160? (y/n): ")
- #If player wants to buy the property...
- if buy == "y":
- #Success!
- if p1m >= 160:
- print(p1, "bought", space[p1s], "for $" + str(price) + "!")
- p1m = p1m - price
- vi3 = 1
- #Not enough money!
- else:
- print("Insufficient funds.")
- #If player doesn't want to buy the property...
- elif buy == "n":
- print(p1, "chose to ignore the property.")
- #If player gives a response that is not "y" or "n"...
- else:
- print("Invalid response.")
- #If Player One owns the property...
- elif vi3 == 1:
- print(p1, "stays a free night in their own property.")
- #If Player Two owns the property...
- elif vi3 == 2:
- #If property is not mortgaged...
- if vi3m == 0:
- vi3r = 12
- #If player owns a Monopoly over all colors of the property...
- if vi1 == 2 and vi2 == 2:
- vi3r = 24
- #If player has 1 house on property...
- if vi3h == 1:
- vi3r = 60
- #If player has 2 houses on property...
- elif vi3h == 2:
- vi3r = 180
- #If player has 3 houses on property...
- elif vi3h == 3:
- vi3r = 500
- #If player has 4 houses on property...
- elif vi3h == 4:
- vi3r = 700
- #If player has a hotel on property...
- elif vi3h == 5:
- vi3r = 900
- #If player does not own a Monopoly over all colors of the property...
- elif vi1 != 2 or vi2 != 2:
- vi3r = 12
- #Player One pays Player Two rent
- print(p1, "pays", p2, "$" + str(vi3r) + "!")
- p1m = p1m - vi3r
- p2m = p2m + vi3r
- #If property is mortgaged...
- elif vi3m == 1:
- print("Virginia Avenue is currently mortgaged.")
- ############If player lands on St. James Place...
- if p1s == 16:
- print()
- #If property is unowned...
- if or1 == 0:
- price = 180
- #Checks to ensure y/n answer is given
- while buy != "y" and buy != "n":
- buy = input("Do you want to buy St. James Place for $180? (y/n): ")
- #If player wants to buy the property...
- if buy == "y":
- #Success!
- if p1m >= 180:
- print(p1, "bought", space[p1s], "for $" + str(price) + "!")
- p1m = p1m - price
- or1 = 1
- #Not enough money!
- else:
- print("Insufficient funds.")
- #If player doesn't want to buy the property...
- elif buy == "n":
- print(p1, "chose to ignore the property.")
- #If player gives a response that is not "y" or "n"...
- else:
- print("Invalid response.")
- #If Player One owns the property...
- elif or1 == 1:
- print(p1, "stays a free night in their own property.")
- #If Player Two owns the property...
- elif or1 == 2:
- #If property is not mortgaged...
- if or1m == 0:
- or1r = 14
- #If player owns a Monopoly over all colors of the property...
- if or2 == 2 and or3 == 2:
- or1r = 28
- #If player has 1 house on property...
- if or1h == 1:
- or1r = 70
- #If player has 2 houses on property...
- elif or1h == 2:
- or1r = 200
- #If player has 3 houses on property...
- elif or1h == 3:
- or1r = 550
- #If player has 4 houses on property...
- elif or1h == 4:
- or1r = 750
- #If player has a hotel on property...
- elif or1h == 5:
- or1r = 950
- #If player does not own a Monopoly over all colors of the property...
- elif or2 != 2 or or3 != 2:
- or1r = 14
- #Player One pays Player Two rent
- print(p1, "pays", p2, "$" + str(or1r) + "!")
- p1m = p1m - or1r
- p2m = p2m + or1r
- #If property is mortgaged...
- elif or1m == 1:
- print("St. James Place is currently mortgaged.")
- ############If player lands on Tennessee Avenue...
- if p1s == 18:
- print()
- #If property is unowned...
- if or2 == 0:
- price = 180
- #Checks to ensure y/n answer is given
- while buy != "y" and buy != "n":
- buy = input("Do you want to buy Tennessee Avenue for $180? (y/n): ")
- #If player wants to buy the property...
- if buy == "y":
- #Success!
- if p1m >= 180:
- print(p1, "bought", space[p1s], "for $" + str(price) + "!")
- p1m = p1m - price
- or2 = 1
- #Not enough money!
- else:
- print("Insufficient funds.")
- #If player doesn't want to buy the property...
- elif buy == "n":
- print(p1, "chose to ignore the property.")
- #If player gives a response that is not "y" or "n"...
- else:
- print("Invalid response.")
- #If Player One owns the property...
- elif or2 == 1:
- print(p1, "stays a free night in their own property.")
- #If Player Two owns the property...
- elif or2 == 2:
- #If property is not mortgaged...
- if or2m == 0:
- or2r = 14
- #If player owns a Monopoly over all colors of the property...
- if or1 == 2 and or3 == 2:
- or2r = 28
- #If player has 1 house on property...
- if or2h == 1:
- or2r = 70
- #If player has 2 houses on property...
- elif or2h == 2:
- or2r = 200
- #If player has 3 houses on property...
- elif or2h == 3:
- or2r = 550
- #If player has 4 houses on property...
- elif or2h == 4:
- or2r = 750
- #If player has a hotel on property...
- elif or2h == 5:
- or2r = 950
- #If player does not own a Monopoly over all colors of the property...
- elif or1 != 2 or or3 != 2:
- or2r = 14
- #Player One pays Player Two rent
- print(p1, "pays", p2, "$" + str(or2r) + "!")
- p1m = p1m - or2r
- p2m = p2m + or2r
- #If property is mortgaged...
- elif or2m == 1:
- print("Tennessee Avenue is currently mortgaged.")
- ############If player lands on New York Avenue...
- if p1s == 19:
- print()
- #If property is unowned...
- if or3 == 0:
- price = 200
- #Checks to ensure y/n answer is given
- while buy != "y" and buy != "n":
- buy = input("Do you want to buy New York Avenue for $200? (y/n): ")
- #If player wants to buy the property...
- if buy == "y":
- #Success!
- if p1m >= 200:
- print(p1, "bought", space[p1s], "for $" + str(price) + "!")
- p1m = p1m - price
- or3 = 1
- #Not enough money!
- else:
- print("Insufficient funds.")
- #If player doesn't want to buy the property...
- elif buy == "n":
- print(p1, "chose to ignore the property.")
- #If player gives a response that is not "y" or "n"...
- else:
- print("Invalid response.")
- #If Player One owns the property...
- elif or3 == 1:
- print(p1, "stays a free night in their own property.")
- #If Player Two owns the property...
- elif or3 == 2:
- #If property is not mortgaged...
- if or3m == 0:
- or3r = 16
- #If player owns a Monopoly over all colors of the property...
- if or1 == 2 and or2 == 2:
- or3r = 32
- #If player has 1 house on property...
- if or3h == 1:
- or3r = 80
- #If player has 2 houses on property...
- elif or3h == 2:
- or3r = 220
- #If player has 3 houses on property...
- elif or3h == 3:
- or3r = 600
- #If player has 4 houses on property...
- elif or3h == 4:
- or3r = 800
- #If player has a hotel on property...
- elif or3h == 5:
- or3r = 1000
- #If player does not own a Monopoly over all colors of the property...
- elif or1 != 2 or or2 != 2:
- or3r = 16
- #Player One pays Player Two rent
- print(p1, "pays", p2, "$" + str(or3r) + "!")
- p1m = p1m - or3r
- p2m = p2m + or3r
- #If property is mortgaged...
- elif or3m == 1:
- print("New York Avenue is currently mortgaged.")
- ############If player lands on Kentucky Avenue...
- if p1s == 21:
- print()
- #If property is unowned...
- if red1 == 0:
- price = 220
- #Checks to ensure y/n answer is given
- while buy != "y" and buy != "n":
- buy = input("Do you want to buy Kentucky Avenue for $220? (y/n): ")
- #If player wants to buy the property...
- if buy == "y":
- #Success!
- if p1m >= 220:
- print(p1, "bought", space[p1s], "for $" + str(price) + "!")
- p1m = p1m - price
- red1 = 1
- #Not enough money!
- else:
- print("Insufficient funds.")
- #If player doesn't want to buy the property...
- elif buy == "n":
- print(p1, "chose to ignore the property.")
- #If player gives a response that is not "y" or "n"...
- else:
- print("Invalid response.")
- #If Player One owns the property...
- elif red1 == 1:
- print(p1, "stays a free night in their own property.")
- #If Player Two owns the property...
- elif red1 == 2:
- #If property is not mortgaged...
- if red1m == 0:
- red1r = 18
- #If player owns a Monopoly over all colors of the property...
- if red2 == 2 and red3 == 2:
- red1r = 36
- #If player has 1 house on property...
- if red1h == 1:
- red1r = 90
- #If player has 2 houses on property...
- elif red1h == 2:
- red1r = 250
- #If player has 3 houses on property...
- elif red1h == 3:
- red1r = 700
- #If player has 4 houses on property...
- elif red1h == 4:
- red1r = 875
- #If player has a hotel on property...
- elif red1h == 5:
- red1r = 1050
- #If player does not own a Monopoly over all colors of the property...
- elif red2 != 2 or red3 != 2:
- red1r = 18
- #Player One pays Player Two rent
- print(p1, "pays", p2, "$" + str(red1r) + "!")
- p1m = p1m - red1r
- p2m = p2m + red1r
- #If property is mortgaged...
- elif red1m == 1:
- print("Kentucky Avenue is currently mortgaged.")
- ############If player lands on Indiana Avenue...
- if p1s == 23:
- print()
- #If property is unowned...
- if red2 == 0:
- price = 220
- #Checks to ensure y/n answer is given
- while buy != "y" and buy != "n":
- buy = input("Do you want to buy Indiana Avenue for $220? (y/n): ")
- #If player wants to buy the property...
- if buy == "y":
- #Success!
- if p1m >= 220:
- print(p1, "bought", space[p1s], "for $" + str(price) + "!")
- p1m = p1m - price
- red2 = 1
- #Not enough money!
- else:
- print("Insufficient funds.")
- #If player doesn't want to buy the property...
- elif buy == "n":
- print(p1, "chose to ignore the property.")
- #If player gives a response that is not "y" or "n"...
- else:
- print("Invalid response.")
- #If Player One owns the property...
- elif red2 == 1:
- print(p1, "stays a free night in their own property.")
- #If Player Two owns the property...
- elif red2 == 2:
- #If property is not mortgaged...
- if red2m == 0:
- red2r = 18
- #If player owns a Monopoly over all colors of the property...
- if red1 == 2 and red3 == 2:
- red2r = 36
- #If player has 1 house on property...
- if red2h == 1:
- red2r = 90
- #If player has 2 houses on property...
- elif red2h == 2:
- red2r = 250
- #If player has 3 houses on property...
- elif red2h == 3:
- red2r = 700
- #If player has 4 houses on property...
- elif red2h == 4:
- red2r = 875
- #If player has a hotel on property...
- elif red2h == 5:
- red2r = 1050
- #If player does not own a Monopoly over all colors of the property...
- elif red1 != 2 or red3 != 2:
- red2r = 18
- #Player One pays Player Two rent
- print(p1, "pays", p2, "$" + str(red2r) + "!")
- p1m = p1m - red2r
- p2m = p2m + red2r
- #If property is mortgaged...
- elif red2m == 1:
- print("Indiana Avenue is currently mortgaged.")
- ############If player lands on Illinois Avenue...
- if p1s == 24:
- print()
- #If property is unowned...
- if red3 == 0:
- price = 240
- #Checks to ensure y/n answer is given
- while buy != "y" and buy != "n":
- buy = input("Do you want to buy Illinois Avenue for $240? (y/n): ")
- #If player wants to buy the property...
- if buy == "y":
- #Success!
- if p1m >= 240:
- print(p1, "bought", space[p1s], "for $" + str(price) + "!")
- p1m = p1m - price
- red3 = 1
- #Not enough money!
- else:
- print("Insufficient funds.")
- #If player doesn't want to buy the property...
- elif buy == "n":
- print(p1, "chose to ignore the property.")
- #If player gives a response that is not "y" or "n"...
- else:
- print("Invalid response.")
- #If Player One owns the property...
- elif red3 == 1:
- print(p1, "stays a free night in their own property.")
- #If Player Two owns the property...
- elif red3 == 2:
- #If property is not mortgaged...
- if red3m == 0:
- red3r = 20
- #If player owns a Monopoly over all colors of the property...
- if red1 == 2 and red2 == 2:
- red3r = 40
- #If player has 1 house on property...
- if red3h == 1:
- red3r = 100
- #If player has 2 houses on property...
- elif red3h == 2:
- red3r = 300
- #If player has 3 houses on property...
- elif red3h == 3:
- red3r = 750
- #If player has 4 houses on property...
- elif red3h == 4:
- red3r = 925
- #If player has a hotel on property...
- elif red3h == 5:
- red3r = 1100
- #If player does not own a Monopoly over all colors of the property...
- elif red1 != 2 or red2 != 2:
- red3r = 20
- #Player One pays Player Two rent
- print(p1, "pays", p2, "$" + str(red3r) + "!")
- p1m = p1m - red3r
- p2m = p2m + red3r
- #If property is mortgaged...
- elif red3m == 1:
- print("Illinois Avenue is currently mortgaged.")
- ############If player lands on Atlantic Avenue...
- if p1s == 26:
- print()
- #If property is unowned...
- if ye1 == 0:
- price = 260
- #Checks to ensure y/n answer is given
- while buy != "y" and buy != "n":
- buy = input("Do you want to buy Atlantic Avenue for $260? (y/n): ")
- #If player wants to buy the property...
- if buy == "y":
- #Success!
- if p1m >= 260:
- print(p1, "bought", space[p1s], "for $" + str(price) + "!")
- p1m = p1m - price
- ye1 = 1
- #Not enough money!
- else:
- print("Insufficient funds.")
- #If player doesn't want to buy the property...
- elif buy == "n":
- print(p1, "chose to ignore the property.")
- #If player gives a response that is not "y" or "n"...
- else:
- print("Invalid response.")
- #If Player One owns the property...
- elif ye1 == 1:
- print(p1, "stays a free night in their own property.")
- #If Player Two owns the property...
- elif ye1 == 2:
- #If property is not mortgaged...
- if ye1m == 0:
- ye1r = 22
- #If player owns a Monopoly over all colors of the property...
- if ye2 == 2 and ye3 == 2:
- ye1r = 44
- #If player has 1 house on property...
- if ye1h == 1:
- ye1r = 110
- #If player has 2 houses on property...
- elif ye1h == 2:
- ye1r = 330
- #If player has 3 houses on property...
- elif ye1h == 3:
- ye1r = 800
- #If player has 4 houses on property...
- elif ye1h == 4:
- ye1r = 975
- #If player has a hotel on property...
- elif ye1h == 5:
- ye1r = 1150
- #If player does not own a Monopoly over all colors of the property...
- elif ye2 != 2 or ye3 != 2:
- ye1r = 22
- #Player One pays Player Two rent
- print(p1, "pays", p2, "$" + str(ye1r) + "!")
- p1m = p1m - ye1r
- p2m = p2m + ye1r
- #If property is mortgaged...
- elif ye1m == 1:
- print("Atlantic Avenue is currently mortgaged.")
- ############If player lands on Ventnor Avenue...
- if p1s == 27:
- print()
- #If property is unowned...
- if ye2 == 0:
- price = 260
- #Checks to ensure y/n answer is given
- while buy != "y" and buy != "n":
- buy = input("Do you want to buy Ventnor Avenue for $260? (y/n): ")
- #If player wants to buy the property...
- if buy == "y":
- #Success!
- if p1m >= 260:
- print(p1, "bought", space[p1s], "for $" + str(price) + "!")
- p1m = p1m - price
- ye2 = 1
- #Not enough money!
- else:
- print("Insufficient funds.")
- #If player doesn't want to buy the property...
- elif buy == "n":
- print(p1, "chose to ignore the property.")
- #If player gives a response that is not "y" or "n"...
- else:
- print("Invalid response.")
- #If Player One owns the property...
- elif ye2 == 1:
- print(p1, "stays a free night in their own property.")
- #If Player Two owns the property...
- elif ye2 == 2:
- #If property is not mortgaged...
- if ye2m == 0:
- ye2r = 22
- #If player owns a Monopoly over all colors of the property...
- if ye1 == 2 and ye3 == 2:
- ye2r = 44
- #If player has 1 house on property...
- if ye2h == 1:
- ye2r = 110
- #If player has 2 houses on property...
- elif ye2h == 2:
- ye2r = 330
- #If player has 3 houses on property...
- elif ye2h == 3:
- ye2r = 800
- #If player has 4 houses on property...
- elif ye2h == 4:
- ye2r = 975
- #If player has a hotel on property...
- elif ye2h == 5:
- ye2r = 1150
- #If player does not own a Monopoly over all colors of the property...
- elif ye1 != 2 or ye3 != 2:
- ye2r = 22
- #Player One pays Player Two rent
- print(p1, "pays", p2, "$" + str(ye2r) + "!")
- p1m = p1m - ye2r
- p2m = p2m + ye2r
- #If property is mortgaged...
- elif ye2m == 1:
- print("Ventnor Avenue is currently mortgaged.")
- ############If player lands on Marvin Gardens...
- if p1s == 29:
- print()
- #If property is unowned...
- if ye3 == 0:
- price = 280
- #Checks to ensure y/n answer is given
- while buy != "y" and buy != "n":
- buy = input("Do you want to buy Marvin Gardens for $280? (y/n): ")
- #If player wants to buy the property...
- if buy == "y":
- #Success!
- if p1m >= 280:
- print(p1, "bought", space[p1s], "for $" + str(price) + "!")
- p1m = p1m - price
- ye3 = 1
- #Not enough money!
- else:
- print("Insufficient funds.")
- #If player doesn't want to buy the property...
- elif buy == "n":
- print(p1, "chose to ignore the property.")
- #If player gives a response that is not "y" or "n"...
- else:
- print("Invalid response.")
- #If Player One owns the property...
- elif ye3 == 1:
- print(p1, "stays a free night in their own property.")
- #If Player Two owns the property...
- elif ye3 == 2:
- #If property is not mortgaged...
- if ye3m == 0:
- ye3r = 24
- #If player owns a Monopoly over all colors of the property...
- if ye1 == 2 and ye2 == 2:
- ye3r = 48
- #If player has 1 house on property...
- if ye3h == 1:
- ye3r = 120
- #If player has 2 houses on property...
- elif ye3h == 2:
- ye3r = 360
- #If player has 3 houses on property...
- elif ye3h == 3:
- ye3r = 850
- #If player has 4 houses on property...
- elif ye3h == 4:
- ye3r = 1025
- #If player has a hotel on property...
- elif ye3h == 5:
- ye3r = 1200
- #If player does not own a Monopoly over all colors of the property...
- elif ye1 != 2 or ye2 != 2:
- ye3r = 24
- #Player One pays Player Two rent
- print(p1, "pays", p2, "$" + str(ye3r) + "!")
- p1m = p1m - ye3r
- p2m = p2m + ye3r
- #If property is mortgaged...
- elif ye3m == 1:
- print("Marvin Gardens is currently mortgaged.")
- ############If player lands on Pacific Avenue...
- if p1s == 31:
- print()
- #If property is unowned...
- if gr1 == 0:
- price = 300
- #Checks to ensure y/n answer is given
- while buy != "y" and buy != "n":
- buy = input("Do you want to buy Pacific Avenue for $300? (y/n): ")
- #If player wants to buy the property...
- if buy == "y":
- #Success!
- if p1m >= 300:
- print(p1, "bought", space[p1s], "for $" + str(price) + "!")
- p1m = p1m - price
- gr1 = 1
- #Not enough money!
- else:
- print("Insufficient funds.")
- #If player doesn't want to buy the property...
- elif buy == "n":
- print(p1, "chose to ignore the property.")
- #If player gives a response that is not "y" or "n"...
- else:
- print("Invalid response.")
- #If Player One owns the property...
- elif gr1 == 1:
- print(p1, "stays a free night in their own property.")
- #If Player Two owns the property...
- elif gr1 == 2:
- #If property is not mortgaged...
- if gr1m == 0:
- gr1r = 26
- #If player owns a Monopoly over all colors of the property...
- if gr2 == 2 and gr3 == 2:
- gr1r = 52
- #If player has 1 house on property...
- if gr1h == 1:
- gr1r = 130
- #If player has 2 houses on property...
- elif gr1h == 2:
- gr1r = 390
- #If player has 3 houses on property...
- elif gr1h == 3:
- gr1r = 900
- #If player has 4 houses on property...
- elif gr1h == 4:
- gr1r = 1100
- #If player has a hotel on property...
- elif gr1h == 5:
- gr1r = 1275
- #If player does not own a Monopoly over all colors of the property...
- elif gr2 != 2 or gr3 != 2:
- gr1r = 26
- #Player One pays Player Two rent
- print(p1, "pays", p2, "$" + str(gr1r) + "!")
- p1m = p1m - gr1r
- p2m = p2m + gr1r
- #If property is mortgaged...
- elif gr1m == 1:
- print("Pacific Avenue is currently mortgaged.")
- ############If player lands on North Carolina Avenue...
- if p1s == 32:
- print()
- #If property is unowned...
- if gr2 == 0:
- price = 300
- #Checks to ensure y/n answer is given
- while buy != "y" and buy != "n":
- buy = input("Do you want to buy North Carolina Avenue for $300? (y/n): ")
- #If player wants to buy the property...
- if buy == "y":
- #Success!
- if p1m >= 300:
- print(p1, "bought", space[p1s], "for $" + str(price) + "!")
- p1m = p1m - price
- gr2 = 1
- #Not enough money!
- else:
- print("Insufficient funds.")
- #If player doesn't want to buy the property...
- elif buy == "n":
- print(p1, "chose to ignore the property.")
- #If player gives a response that is not "y" or "n"...
- else:
- print("Invalid response.")
- #If Player One owns the property...
- elif gr2 == 1:
- print(p1, "stays a free night in their own property.")
- #If Player Two owns the property...
- elif gr2 == 2:
- #If property is not mortgaged...
- if gr2m == 0:
- gr2r = 26
- #If player owns a Monopoly over all colors of the property...
- if gr1 == 2 and gr3 == 2:
- gr2r = 52
- #If player has 1 house on property...
- if gr2h == 1:
- gr2r = 130
- #If player has 2 houses on property...
- elif gr2h == 2:
- gr2r = 390
- #If player has 3 houses on property...
- elif gr2h == 3:
- gr2r = 900
- #If player has 4 houses on property...
- elif gr2h == 4:
- gr2r = 1100
- #If player has a hotel on property...
- elif gr2h == 5:
- gr2r = 1275
- #If player does not own a Monopoly over all colors of the property...
- elif gr1 != 2 or gr3 != 2:
- gr2r = 26
- #Player One pays Player Two rent
- print(p1, "pays", p2, "$" + str(gr2r) + "!")
- p1m = p1m - gr2r
- p2m = p2m + gr2r
- #If property is mortgaged...
- elif gr2m == 1:
- print("North Carolina Avenue is currently mortgaged.")
- ############If player lands on Pennsylvania Avenue...
- if p1s == 34:
- print()
- #If property is unowned...
- if gr3 == 0:
- price = 320
- #Checks to ensure y/n answer is given
- while buy != "y" and buy != "n":
- buy = input("Do you want to buy Pennsylvania Avenue for $320? (y/n): ")
- #If player wants to buy the property...
- if buy == "y":
- #Success!
- if p1m >= 320:
- print(p1, "bought", space[p1s], "for $" + str(price) + "!")
- p1m = p1m - price
- gr3 = 1
- #Not enough money!
- else:
- print("Insufficient funds.")
- #If player doesn't want to buy the property...
- elif buy == "n":
- print(p1, "chose to ignore the property.")
- #If player gives a response that is not "y" or "n"...
- else:
- print("Invalid response.")
- #If Player One owns the property...
- elif gr3 == 1:
- print(p1, "stays a free night in their own property.")
- #If Player Two owns the property...
- elif gr3 == 2:
- #If property is not mortgaged...
- if gr3m == 0:
- gr3r = 28
- #If player owns a Monopoly over all colors of the property...
- if gr1 == 2 and gr2 == 2:
- gr3r = 56
- #If player has 1 house on property...
- if gr3h == 1:
- gr3r = 150
- #If player has 2 houses on property...
- elif gr3h == 2:
- gr3r = 450
- #If player has 3 houses on property...
- elif gr3h == 3:
- gr3r = 1000
- #If player has 4 houses on property...
- elif gr3h == 4:
- gr3r = 1200
- #If player has a hotel on property...
- elif gr3h == 5:
- gr3r = 1400
- #If player does not own a Monopoly over all colors of the property...
- elif gr1 != 2 or gr2 != 2:
- gr3r = 28
- #Player One pays Player Two rent
- print(p1, "pays", p2, "$" + str(gr3r) + "!")
- p1m = p1m - gr3r
- p2m = p2m + gr3r
- #If property is mortgaged...
- elif gr3m == 1:
- print("Pennsylvania Avenue is currently mortgaged.")
- ############If player lands on Park Place...
- if p1s == 37:
- print()
- #If property is unowned...
- if bl1 == 0:
- price = 350
- #Checks to ensure y/n answer is given
- while buy != "y" and buy != "n":
- buy = input("Do you want to buy Park Place for $350? (y/n): ")
- #If player wants to buy the property...
- if buy == "y":
- #Success!
- if p1m >= 350:
- print(p1, "bought", space[p1s], "for $" + str(price) + "!")
- p1m = p1m - price
- bl1 = 1
- #Not enough money!
- else:
- print("Insufficient funds.")
- #If player doesn't want to buy the property...
- elif buy == "n":
- print(p1, "chose to ignore the property.")
- #If player gives a response that is not "y" or "n"...
- else:
- print("Invalid response.")
- #If Player One owns the property...
- elif bl1 == 1:
- print(p1, "stays a free night in their own property.")
- #If Player Two owns the property...
- elif bl1 == 2:
- #If property is not mortgaged...
- if bl1m == 0:
- bl1r = 35
- #If player owns a Monopoly over all colors of the property...
- if bl2 == 2:
- bl1r = 70
- #If player has 1 house on property...
- if bl1h == 1:
- bl1r = 175
- #If player has 2 houses on property...
- elif bl1h == 2:
- bl1r = 500
- #If player has 3 houses on property...
- elif bl1h == 3:
- bl1r = 1100
- #If player has 4 houses on property...
- elif bl1h == 4:
- bl1r = 1300
- #If player has a hotel on property...
- elif bl1h == 5:
- bl1r = 1500
- #If player does not own a Monopoly over all colors of the property...
- elif bl2 != 2:
- bl1r = 35
- #Player One pays Player Two rent
- print(p1, "pays", p2, "$" + str(bl1r) + "!")
- p1m = p1m - bl1r
- p2m = p2m + bl1r
- #If property is mortgaged...
- elif bl1m == 1:
- print("Park Place is currently mortgaged.")
- ############If player lands on Boardwalk...
- if p1s == 39:
- print()
- #If property is unowned...
- if bl2 == 0:
- price = 400
- #Checks to ensure y/n answer is given
- while buy != "y" and buy != "n":
- buy = input("Do you want to buy Boardwalk for $400? (y/n): ")
- #If player wants to buy the property...
- if buy == "y":
- #Success!
- if p1m >= 400:
- print(p1, "bought", space[p1s], "for $" + str(price) + "!")
- p1m = p1m - price
- bl2 = 1
- #Not enough money!
- else:
- print("Insufficient funds.")
- #If player doesn't want to buy the property...
- elif buy == "n":
- print(p1, "chose to ignore the property.")
- #If player gives a response that is not "y" or "n"...
- else:
- print("Invalid response.")
- #If Player One owns the property...
- elif bl2 == 1:
- print(p1, "stays a free night in their own property.")
- #If Player Two owns the property...
- elif bl2 == 2:
- #If property is not mortgaged...
- if bl2m == 0:
- bl2r = 50
- #If player owns a Monopoly over all colors of the property...
- if bl1 == 2:
- bl2r = 100
- #If player has 1 house on property...
- if bl2h == 1:
- bl2r = 200
- #If player has 2 houses on property...
- elif bl2h == 2:
- bl2r = 600
- #If player has 3 houses on property...
- elif bl2h == 3:
- bl2r = 1400
- #If player has 4 houses on property...
- elif bl2h == 4:
- bl2r = 1700
- #If player has a hotel on property...
- elif bl2h == 5:
- bl2r = 2000
- #If player does not own a Monopoly over all colors of the property...
- elif bl1 != 2:
- bl2r = 50
- #Player One pays Player Two rent
- print(p1, "pays", p2, "$" + str(bl2r) + "!")
- p1m = p1m - bl2r
- p2m = p2m + bl2r
- #If property is mortgaged...
- elif bl2m == 1:
- print("Boardwalk is currently mortgaged.")
- ############If player lands on Reading Railroad...
- if p1s == 5:
- print()
- #If property is unowned...
- if rrr == 0:
- price = 200
- #Checks to ensure y/n answer is given
- while buy != "y" and buy != "n":
- buy = input("Do you want to buy Reading Railroad for $200? (y/n): ")
- #If player wants to buy the property...
- if buy == "y":
- #Success!
- if p1m >= 200:
- print(p1, "bought", space[p1s], "for $" + str(price) + "!")
- p1m = p1m - price
- rrr = 1
- p1rr = p1rr + 1
- #Not enough money!
- else:
- print("Insufficient funds.")
- #If player doesn't want to buy the property...
- elif buy == "n":
- print(p1, "chose to ignore the railroad.")
- #If player gives a response that is not "y" or "n"...
- else:
- print("Invalid response.")
- #If Player One owns the property...
- elif rrr == 1:
- print(p1, "admires their railroad.")
- #If Player Two owns the property...
- elif rrr == 2:
- #If property is not mortgaged...
- if rrrm == 0:
- rrrr = 25
- #If player owns a Monopoly over all colors of the property...
- if p2rr == 2:
- rrrr = 50
- elif p2rr == 3:
- rrrr = 100
- elif p2rr == 4:
- rrrr = 200
- #Player One pays Player Two rent
- print(p1, "pays", p2, "$" + str(rrrr) + "!")
- p1m = p1m - rrrr
- p2m = p2m + rrrr
- #If property is mortgaged...
- elif rrrm == 1:
- print("Reading Railroad is currently mortgaged.")
- ############If player lands on Pennsylvania Railroad...
- if p1s == 15:
- print()
- #If property is unowned...
- if prr == 0:
- price = 200
- #Checks to ensure y/n answer is given
- while buy != "y" and buy != "n":
- buy = input("Do you want to buy Pennsylvania Railroad for $200? (y/n): ")
- #If player wants to buy the property...
- if buy == "y":
- #Success!
- if p1m >= 200:
- print(p1, "bought", space[p1s], "for $" + str(price) + "!")
- p1m = p1m - price
- prr = 1
- p1rr = p1rr + 1
- #Not enough money!
- else:
- print("Insufficient funds.")
- #If player doesn't want to buy the property...
- elif buy == "n":
- print(p1, "chose to ignore the railroad.")
- #If player gives a response that is not "y" or "n"...
- else:
- print("Invalid response.")
- #If Player One owns the property...
- elif prr == 1:
- print(p1, "admires their railroad.")
- #If Player Two owns the property...
- elif prr == 2:
- #If property is not mortgaged...
- if prrm == 0:
- prrr = 25
- #If player owns a Monopoly over all colors of the property...
- if p2rr == 2:
- prrr = 50
- elif p2rr == 3:
- prrr = 100
- elif p2rr == 4:
- prrr = 200
- #Player One pays Player Two rent
- print(p1, "pays", p2, "$" + str(prrr) + "!")
- p1m = p1m - prrr
- p2m = p2m + prrr
- #If property is mortgaged...
- elif prrm == 1:
- print("Pennsylvania Railroad is currently mortgaged.")
- ############If player lands on B & O Railroad...
- if p1s == 25:
- print()
- #If property is unowned...
- if brr == 0:
- price = 200
- #Checks to ensure y/n answer is given
- while buy != "y" and buy != "n":
- buy = input("Do you want to buy B & O Railroad for $200? (y/n): ")
- #If player wants to buy the property...
- if buy == "y":
- #Success!
- if p1m >= 200:
- print(p1, "bought", space[p1s], "for $" + str(price) + "!")
- p1m = p1m - price
- brr = 1
- p1rr = p1rr + 1
- #Not enough money!
- else:
- print("Insufficient funds.")
- #If player doesn't want to buy the property...
- elif buy == "n":
- print(p1, "chose to ignore the railroad.")
- #If player gives a response that is not "y" or "n"...
- else:
- print("Invalid response.")
- #If Player One owns the property...
- elif brr == 1:
- print(p1, "admires their railroad.")
- #If Player Two owns the property...
- elif brr == 2:
- #If property is not mortgaged...
- if brrm == 0:
- brrr = 25
- #If player owns a Monopoly over all colors of the property...
- if p2rr == 2:
- brrr = 50
- elif p2rr == 3:
- brrr = 100
- elif p2rr == 4:
- brrr = 200
- #Player One pays Player Two rent
- print(p1, "pays", p2, "$" + str(brrr) + "!")
- p1m = p1m - brrr
- p2m = p2m + brrr
- #If property is mortgaged...
- elif brrm == 1:
- print("B & O Railroad is currently mortgaged.")
- ############If player lands on Short Line...
- if p1s == 35:
- print()
- #If property is unowned...
- if srr == 0:
- price = 200
- #Checks to ensure y/n answer is given
- while buy != "y" and buy != "n":
- buy = input("Do you want to buy Short Line for $200? (y/n): ")
- #If player wants to buy the property...
- if buy == "y":
- #Success!
- if p1m >= 200:
- print(p1, "bought", space[p1s], "for $" + str(price) + "!")
- p1m = p1m - price
- srr = 1
- p1rr = p1rr + 1
- #Not enough money!
- else:
- print("Insufficient funds.")
- #If player doesn't want to buy the property...
- elif buy == "n":
- print(p1, "chose to ignore the railroad.")
- #If player gives a response that is not "y" or "n"...
- else:
- print("Invalid response.")
- #If Player One owns the property...
- elif srr == 1:
- print(p1, "admires their railroad.")
- #If Player Two owns the property...
- elif srr == 2:
- #If property is not mortgaged...
- if srrm == 0:
- srrr = 25
- #If player owns a Monopoly over all colors of the property...
- if p2rr == 2:
- srrr = 50
- elif p2rr == 3:
- srrr = 100
- elif p2rr == 4:
- srrr = 200
- #Player One pays Player Two rent
- print(p1, "pays", p2, "$" + str(srrr) + "!")
- p1m = p1m - srrr
- p2m = p2m + srrr
- #If property is mortgaged...
- elif srrm == 1:
- print("Short Line is currently mortgaged.")
- ############If player lands on Electric Company...
- if p1s == 12:
- print()
- #If property is unowned...
- if ec == 0:
- price = 150
- #Checks to ensure y/n answer is given
- while buy != "y" and buy != "n":
- buy = input("Do you want to buy Electric Company for $150? (y/n): ")
- #If player wants to buy the property...
- if buy == "y":
- #Success!
- if p1m >= 150:
- print(p1, "bought", space[p1s], "for $" + str(price) + "!")
- p1m = p1m - price
- ec = 1
- p1u = p1u + 1
- #Not enough money!
- else:
- print("Insufficient funds.")
- #If player doesn't want to buy the property...
- elif buy == "n":
- print(p1, "chose to ignore the utility.")
- #If player gives a response that is not "y" or "n"...
- else:
- print("Invalid response.")
- #If Player One owns the property...
- elif ec == 1:
- print(p1, "admires their utility.")
- #If Player Two owns the property...
- elif ec == 2:
- #If property is not mortgaged...
- if ecm == 0:
- ecr = ((die1 + die2) * 4)
- #If both utilities are owned...
- if p1u == 2:
- ecr = ((die1 + die2) * 10)
- #Player One pays Player Two rent
- print(p1, "pays", p2, "$" + str(ecr) + "!")
- p1m = p1m - ecr
- p2m = p2m + ecr
- #If property is mortgaged...
- elif ecm == 1:
- print("Electric Company is currently mortgaged.")
- ############If player lands on Water Works...
- if p1s == 28:
- print()
- #If property is unowned...
- if ww == 0:
- price = 150
- #Checks to ensure y/n answer is given
- while buy != "y" and buy != "n":
- buy = input("Do you want to buy Water Works for $150? (y/n): ")
- #If player wants to buy the property...
- if buy == "y":
- #Success!
- if p1m >= 150:
- print(p1, "bought", space[p1s], "for $" + str(price) + "!")
- p1m = p1m - price
- ww = 1
- p1u = p1u + 1
- #Not enough money!
- else:
- print("Insufficient funds.")
- #If player doesn't want to buy the property...
- elif buy == "n":
- print(p1, "chose to ignore the utility.")
- #If player gives a response that is not "y" or "n"...
- else:
- print("Invalid response.")
- #If Player One owns the property...
- elif ww == 1:
- print(p1, "admires their utility.")
- #If Player Two owns the property...
- elif ww == 2:
- #If property is not mortgaged...
- if wwm == 0:
- wwr = ((die1 + die2) * 4)
- #If both utilities are owned...
- if p1u == 2:
- wwr = ((die1 + die2) * 10)
- #Player One pays Player Two rent
- print(p1, "pays", p2, "$" + str(wwr) + "!")
- p1m = p1m - wwr
- p2m = p2m + wwr
- #If property is mortgaged...
- elif wwm == 1:
- print("Water Works is currently mortgaged.")
- ############If player lands on Free Parking...
- if p1s == 20:
- print()
- print(p1, "landed on Free Parking! You receive $" + str(fp) + "!")
- p1m = p1m + fp
- fp = 200
- ############If player lands on Income Tax...
- if p1s == 4:
- if p1m >= 200:
- p1m = p1m - 200
- fp = fp + 200
- print(p1, "paid off a $200 income tax.")
- elif p1m < 200:
- print(p1, "couly only afford to pay off $" + str(p1m), "of their income tax. Yikes.")
- p1m = p1m - p1m
- fp = fp + p1m
- ############If player lands on Luxury Tax...
- if p1s == 38:
- if p1m >= 100:
- p1m = p1m - 100
- fp = fp + 100
- print(p1, "paid off a $100 luxury tax.")
- elif p1m < 100:
- print(p1, "could only afford to pay off $" + str(p1m), "of their luxury tax. Yikes.")
- p1m = p1m - p1m
- fp = fp + p1m
- ############If player lands on Jail...
- if p1s == 30:
- p1j = 1
- for i in range(20):
- if p1s < 40:
- if p1x > -333 and p1y == -335:
- if p1s == 0 or p1s == 9:
- p1x = p1x - 82
- else:
- p1x = p1x - 63
- elif p1x == -333 and p1y < 333:
- if p1s == 10 or p1s == 19:
- p1y = p1y + 82
- else:
- p1y = p1y + 63
- elif p1x < 335 and p1y == 333:
- if p1s == 20 or p1s == 29:
- p1x = p1x + 82
- else:
- p1x = p1x + 63
- elif p1x == 335 and p1y > -335:
- if p1s == 30 or p1s == 39:
- p1y = p1y - 82
- else:
- p1y = p1y - 63
- #Sets player position on board
- player1.setpos(p1x, p1y)
- #Increases space player resides on
- p1s = p1s + 1
- #Resets player 1 space count to 0 when passing 39
- if p1s == 40:
- p1s = 0
- #Resets the "buy" variable
- buy = "x"
- #if die1 == die2:
- #turn = 1
- #elif die1 != die2:
- #turn = 2
- ############Signifies end of Player One's turn
- input("---------------------------------------------------------")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement