nivinpoly
import random
#bankacc
b1=100000
b2=100000
b3=1000000
l=10000
#cities
CITIES={100:{"Name":"psgps","ref no":101,"price":20000,"owner":0,"houses":0,"Rent":1000},
101:{"Name":"Psgit","ref no":101,"price":6000,"owner":0,"houses":0,"Rent":4000},
102:{"Name":"Coimbatore","ref no":102,"price":11000,"owner":0,"houses":0,"Rent":1000},
103:{"Name":"Chennai","ref no":103,"price":9000,"owner":0,"houses":0,"Rent":10000},
104:{"Name":"Shimla","ref no":104,"price":6000,"owner":0,"houses":0,"Rent":6000},
105:{"Name":"Airports","ref no":105,"price":20000,"owner":0,"houses":0,"Rent":6000},
106:{"Name":"CottonIndustries","ref no":106,"price":28090,"owner":0,"houses":0,"Rent":8000},
107:{"Name":"IndianBank","ref no":107,"price":89000,"owner":0,"houses":0,"Rent":40000},
1
08:{"Name":"Electriccompany","ref no":108,"price":23000,"owner":0,"houses":0,"Rent":5000},
109:{"Name":"FinancialOffice","ref no":109,"price":100000,"owner":0,"houses":0,"Rent":40000},
110:{"Name":"Mumbai","ref no":110,"price":250000,"owner":0,"houses":0,"Rent":43003},
111:{"Name":"Andaman","ref no":111,"price":150000,"owner":0,"houses":0,"Rent":40000},
112:{"Name":"Kolkata","ref no":112,"price":18000,"owner":0,"houses":0,"Rent":4099},
113:{"Name":"Kanpur","ref no":113,"price":19000,"owner":0,"houses":0,"Rent":500},
114:{"Name":"Patna","ref no":114,"price":20000,"owner":0,"houses":0,"Rent":40009},
115:{"Name":"Hyderabad","ref no":115,"price":250000,"owner":0,"houses":0,"Rent":70000},
116:{"Name":"Banglore","ref no":116,"price":400000,"owner":0,"houses":0,"Rent":4000000},
117:{"Name":"Cochin","ref no":117,"price":270000,"owner":0,"houses":0,"Rent":50494},
118:{"Name":"Textile","ref no":118,"price":27000,"owner":0,"houses":0,"Rent":64848},
119:{"Name":"Agra","ref no":119,"price":25000,"owner":0,"houses":0,"Rent":484949},
120:{"Name":"NewDelhi","ref no":120,"price":27000,"owner":0,"houses":0,"Rent":1010102}}
#players
u1=input("Player1:")
u2=input("Player2:")
u3=input("Player3:")
#positions
p1=100
p2=100
p3=100
for i in range(100):
#Player1
input("Player 1,Roll the dice")
print()
dice=random.randint(1,6)
print("Its ",dice,"!")
p1+=dice
if p1<120: ame="" are="" at:="" b1="" buy="" cities="" else:="" if="" lace="" o="" ou="" owner="" p1="" place="" price="" print="" q1="=1:" rice:="" this="" to="" want="" you="">CITIES[p1]["price"]:
b1=b1-CITIES[p1]["price"]
CITIES[p1]["owner"]=1
print("Bank Balance:",b1)
else:
print("NO MONEY")
elif CITIES[p1]["owner"]==1:
q2=int(input("Do you want to build a house"))
if q2==1:
b1=b1-1000
elif CITIES[p1]["owner"]==2:
b1=b1-CITIES[p1]["Rent"]
b2=b2+CITIES[p1]["Rent"]
print("Rent ",CITIES[p1]["Rent"],"Payed to",u2)
elif CITIES[p1]["owner"]==3:
b1=b1-CITIES[p1]["Rent"]
b3=b3+CITIES[p1]["Rent"]
print("Rent ",CITIES[p1]["Rent"],"Payed to",u3)
print()
#Player2
input("Player 2,Roll the dice")
dice=random.randint(1,6)
print()
print("Its ",dice,"!")
p2+=dice
if p2<120: ame="" are="" at:="" b2="" buy="" cities="" else:="" if="" lace="" o="" ou="" owner="" p1="" p2="" place="" price="" print="" q1="=1:" rice:="" this="" to="" want="" you="">CITIES[p2]["price"]:
b2=b2-CITIES[p2]["price"]
CITIES[p2]["owner"]=2
print("Bank Balance:",b2)
else:
print("NO MONEY")
elif CITIES[p2]["owner"]==2:
q2=int(input("Do you want to build a house"))
if q2==1:
b2=b2-1000
elif CITIES[p2]["owner"]==1:
b2=b2-CITIES[p3]["Rent"]
b1=b1+CITIES[p3]["Rent"]
print("Rent ",CITIES[p3]["Rent"],"Payed to",u1)
elif CITIES[p2]["owner"]==3:
b2=b2-CITIES[p3]["Rent"]
b3=b3+CITIES[p3]["Rent"]
print("Rent ",CITIES[p1]["Rent"],"Payed to",u3)
print()
#Player3
input("Player 3,Roll the dice")
print()
dice=random.randint(1,6)
print("Its ",dice,"!")
p3+=dice
if p3<120: ame="" are="" at:="" b3="" buy="" cities="" else:="" if="" lace="" o="" ou="" owner="" p1="" p3="" place="" price="" print="" q1="=1:" rice:="" this="" to="" want="" you="">CITIES[p3]["price"]:
b3=b3-CITIES[p3]["price"]
CITIES[p3]["owner"]=3
print("Bank Balance:",b3)
else:
print("NO MONEY")
elif CITIES[p3]["owner"]==3:
q2=int(input("Do you want to build a house"))
if q2==1:
b3=b3-1000
elif CITIES[p3]["owner"]==1:
b3=b3-CITIES[p3]["Rent"]
b1=b1+CITIES[p3]["Rent"]
print("Rent ",CITIES[p1]["Rent"],"Payed to",u1)
elif CITIES[p1]["owner"]==2:
b3=b3-CITIES[p3]["Rent"]
b2=b2+CITIES[p3]["Rent"]
print("Rent ",CITIES[p1]["Rent"],"Payed to",u2)
print()
print("*************")
print(u1,"at",CITIES[p1]["Name"]," Bank Balance:",b1)
print(u2,"at",CITIES[p2]["Name"]," Bank Balance:",b2)
print(u3,"at",CITIES[p3]["Name"]," Bank Balance:",b3)
#result
if b1>b2 and b1>b3:
print(u1,"Is the Winner!")
if b2>b1 and b2>b3:
print(u2,"Is the Winner!")
if b3>b2 and b3>b1:
print(u3,"Is the Winner!")
120:>120:>120:>
Comments
Post a Comment