repl.it
@minecraftmake55/

Monopoly Finished

Python

No description

fork
loading
Files
  • main.py
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
# Properties

help = " MEAVE for Mediterranean Avenue \n BAAVE for Baltic Avenue \n ORAVE for Oriental Avenue \n VTAVE for Vermont Avenue \n CTAVE for Conneticut Avenue \n STCPL for Saint Patrick's Place \n STAVE for State Avenue VAAVE for Virginia Avenue \n STJPL for Saint Jame's place \n TNAVE for Tennesse Avenue \n NYAVE for New York Avenue \n KYAVE for Kentucky Avenue \n INAVE for Indiana Avenue \n ILAVE for Illinois Avenue \n ATAVE for Atlantic Avenue \n VEAVE for Ventnor Avenue \n MAGAR for Marvin's Gardens \n PFAVE for Pacific Avenue \n NCAVE for North Carolina Avenue \n PAAVE for Pennsylvania Avenue \n PARPL for Park Place \n BRDWK for Boardwalk \n \n"
places = [ "GO", "MEDITERRANEAN AVENUE", "COMMUNITY CHEST", "BALTIC AVENUE", "INCOME TAX", "READING RAILROAD", "ORIENTAL AVENUE", "CHANCE", "VERMONT AVENUE", "CONNETICUT AVENUE", "JUST VISITING: JAIL", "SAINT CHARLES'S PLACE", "ELECTRIC COMPANY", "STATE AVENUE", "VIRGINIA AVENUE", "PENNSYLVANIA RAILROAD", "SAINT JAMES' PLACE", "COMMUNITY CHEST", "TENNESSE AVENUE", "NEW YORK AVENUE", "FREE PARKING", "KENTUCKY AVENUE", "CHANCE", "INDIANA AVENUE", "ILLINOIS AVENUE", "B.O RAILROAD", "ATLANTIC AVENUE", "PACIFIC AVENUE", "WATER WORKS", "MARVIN GARDENS", "GO TO JAIL", "PACIFIC AVENUE", "NORTH CAROLINA AVENUE", "COMMUNITY CHEST", "PENNSYLVANIA AVENUE", "SHORT LINE", "CHANCE", "PARK PLACE", "LUXURY TAX", "BOARDWALK", "IN JAIL"]
specPlaces = [ "GO", "COMMUNITY CHEST", "READING RAILROAD", "PENNSYLVANIA RAILROAD", "B.O RAILROAD", "SHORT LINE", "CHANCE", "JAIL", "WATER WORKS", "ELECTRIC COMPANY", "INCOME TAX", "LUXURY TAX", "FREE PARKING", "GO TO JAIL"]
import random
    
P1 = 1500
P2 = 1500
P3 = 1500
P4 = 1500
P1Mnply = 0
P2Mnply = 0
P3Mnply = 0
P4Mnply = 0
P1L = 0
P2L = 0
P3L = 0
P4L = 0
P1FreeJail = 0
P2FreeJail = 0 
P3FreeJail = 0 
P4FreeJail = 0
JailOut = [ P1FreeJail, P2FreeJail, P3FreeJail, P4FreeJail]
Bnk = "Bank"
P1p = "P1"
P2p = "P2"
P3p = "P3"
P4p = "P4"
P1m = "P1 Mortgage"
P2m = "P2 Mortgage"
P3m = "P3 Mortgage"
P4m = "P4 Mortgage"
mortList = [ 0, P1m, P2m, P3m, P4m ]
#Prices
MEAVE = 60
BAAVE = 60
ORAVE = 100
VTAVE = 100
CTAVE = 120
STCPL = 140
STAVE = 140
VAAVE = 160
STJPL = 180
TNAVE = 180
NYAVE = 200
KYAVE = 220
INAVE = 220
ILAVE = 240
ATAVE = 260
VEAVE = 260
MAGAR = 280
PFAVE = 300
NCAVE = 300
PAAVE = 320
PARPL = 350
BRDWK = 400
priceAll = [ 0, "MEAVE", "NONE", "BAAVE", "NONE", "NONE", "ORAVE", "NONE", "VTAVE", "CTAVE", "NONE", "STCPL", "NONE", "STAVE", "VAAVE", "NONE", "STJPL", "NONE", "TNAVE", "NYAVE", "NONE", "KYAVE", "NONE", "INAVE", "ILAVE", "NONE", "ATAVE", "VEAVE", "NONE", "MAGAR","NONE",  "PFAVE", "NCAVE", "NONE", "PAAVE", "NONE", "NONE", "PARPL", "NONE", "BRDWK" ]
BrownMonopolyList = [ "MEAVE", "BAAVE" ]
LightMonopolyList = [ "ORAVE", "VTAVE", "CTAVE" ]
PinkMonopolyList = [ "STCPL", "STAVE", "VAAVE" ]
OrangeMonopolyList = [ "STJPL", "TNAVE", "NYAVE" ]
RedMonopolyList = [ "KYAVE", "INAVE", "ILAVE" ]
YellowMonopolyList = [ "ATAVE", "VEAVE", "MAGAR" ]
GreenMonopolyList = [ "PFAVE", "NCAVE", "PAAVE" ]
BlueMonopolyList = [ "PARPL", "BRDWK" ]

ELCCM = 150
WTRWK = 150
RRLRD = 200
RRlrdPos = Bnk
PRLRD = 200
PRlrdPos = Bnk
BRLRD = 200
BRlrdPos = Bnk
SRTLN = 200
SrtLnPos = Bnk
RailP1 = 0
RailP2 = 0
RailP3 = 0
RailP4 = 0
RailList = [ 0, RailP1, RailP2, RailP3, RailP4 ]
#utilities
utilit = 150
eleComPos = Bnk
watComPos = Bnk
prices = [ "GO", MEAVE, "NONE", BAAVE, "NONE", RRLRD, ORAVE, "NONE", VTAVE, CTAVE, "NONE", STCPL, ELCCM, STAVE, VAAVE, PRLRD, STJPL, "NONE", TNAVE, NYAVE, "NONE", KYAVE, "NONE", INAVE, ILAVE, BRLRD, ATAVE, VEAVE, WTRWK, MAGAR, "NONE", PFAVE, NCAVE, "NONE", PAAVE, SRTLN, "NONE", PARPL, "NONE", BRDWK, "NONE"]

# house variables
MeAveHouse = 0
BaAveHouse = 0
OrAveHouse = 0
VtAveHouse = 0
CtAveHouse = 0
StCPlHouse = 0
StAveHouse = 0
VaAveHouse = 0
StJPlHouse = 0
TnAveHouse = 0
NYAveHouse = 0
KyAveHouse = 0
InAveHouse = 0
IlAveHouse = 0
AtAveHouse = 0
VeAveHouse = 0
MaGarHouse = 0
PfAveHouse = 0
NcAveHouse = 0
PaAveHouse = 0
ParPlHouse = 0
BrdWkHouse = 0
houseList = [ 0, MeAveHouse, BaAveHouse, OrAveHouse, VtAveHouse, CtAveHouse, StCPlHouse, StAveHouse, VaAveHouse, StJPlHouse, TnAveHouse, NYAveHouse, KyAveHouse, InAveHouse, IlAveHouse, AtAveHouse, VeAveHouse, MaGarHouse, PfAveHouse, NcAveHouse, PaAveHouse, ParPlHouse, BrdWkHouse ]
BrownHouse = [ MeAveHouse, BaAveHouse ]
LightHouse = [ OrAveHouse, VtAveHouse, CtAveHouse ]
PinkHouse = [ StCPlHouse, StAveHouse, VaAveHouse ]
OrangeHouse = [ StJPlHouse, TnAveHouse, NYAveHouse ]
RedHouse = [ KyAveHouse, InAveHouse, IlAveHouse ]
YellowHouse = [ AtAveHouse, VeAveHouse, MaGarHouse ]
GreenHouse = [ PfAveHouse, NcAveHouse, PaAveHouse ]
BlueHouse = [ ParPlHouse, BrdWkHouse ]

# price of houses
SIDE1HOUSEPRICE = 50
SIDE2HOUSEPRICE = 100
SIDE3HOUSEPRICE = 150
SIDE4HOUSEPRICE = 200


P1HouseNum = 0
P2HouseNum = 0
P3HouseNum = 0 
P4HouseNum = 0 
HouseNumList = [ 0, P1HouseNum, P2HouseNum, P3HouseNum, P4HouseNum ]
P1HotelNum = 0
P2HotelNum = 0
P3HotelNum = 0
P4HotelNum = 0
HotelNumList = [ 0, P1HotelNum, P2HotelNum, P3HotelNum, P4HotelNum ]

# mortgage value
MeAveMort = MEAVE / 2 + ( MeAveHouse * ( SIDE1HOUSEPRICE / 2))
BaAveMort = BAAVE / 2 + ( BaAveHouse * ( SIDE1HOUSEPRICE / 2))
OrAveMort = ORAVE / 2 + ( OrAveHouse * ( SIDE1HOUSEPRICE / 2))
VtAveMort = VTAVE / 2 + ( VtAveHouse * ( SIDE1HOUSEPRICE / 2))
CtAveMort = CTAVE / 2 + ( CtAveHouse * ( SIDE1HOUSEPRICE / 2))
StCPlMort = STCPL / 2 + ( StCPlHouse * ( SIDE2HOUSEPRICE / 2))
StAveMort = STAVE / 2 + ( StAveHouse * ( SIDE2HOUSEPRICE / 2))
VaAveMort = VAAVE / 2 + ( VaAveHouse * ( SIDE2HOUSEPRICE / 2))
StJPlMort = STJPL / 2 + ( StJPlHouse * ( SIDE2HOUSEPRICE / 2))
TnAveMort = TNAVE / 2 + ( TnAveHouse * ( SIDE2HOUSEPRICE / 2))
NYAveMort = NYAVE / 2 + ( NYAveHouse * ( SIDE2HOUSEPRICE / 2))
KyAveMort = KYAVE / 2 + ( KyAveHouse * ( SIDE3HOUSEPRICE / 2))
InAveMort = INAVE / 2 + ( InAveHouse * ( SIDE3HOUSEPRICE / 2))
IlAveMort = ILAVE / 2 + ( IlAveHouse * ( SIDE3HOUSEPRICE / 2))
AtAveMort = ATAVE / 2 + ( AtAveHouse * ( SIDE3HOUSEPRICE / 2))
VeAveMort = VEAVE / 2 + ( VeAveHouse * ( SIDE3HOUSEPRICE / 2))
MaGarMort = MAGAR / 2 + ( MaGarHouse * ( SIDE3HOUSEPRICE / 2))
PfAveMort = PFAVE / 2 + ( PfAveHouse * ( SIDE4HOUSEPRICE / 2))
NcAveMort = NCAVE / 2 + ( NcAveHouse * ( SIDE4HOUSEPRICE / 2))
PaAveMort = PAAVE / 2 + ( PaAveHouse * ( SIDE4HOUSEPRICE / 2))
ParPlMort = PARPL / 2 + ( ParPlHouse * ( SIDE4HOUSEPRICE / 2))
BrdWkMort = BRDWK / 2 + ( BrdWkHouse * ( SIDE4HOUSEPRICE / 2))
mortList = [ ]

#Ownership
P1p = "P1"
P2p = "P2"
P3p = "P3"
P4p = "P4"

Bnk = "Bank"

MeAvePos = Bnk 
BaAvePos = Bnk
OrAvePos = Bnk
VtAvePos = Bnk
CtAvePos = Bnk
StCPlPos = Bnk
StAvePos = Bnk
VaAvePos = Bnk
StJPlPos = Bnk
TnAvePos = Bnk
NYAvePos = Bnk
KyAvePos = Bnk
InAvePos = Bnk
IlAvePos = Bnk
AtAvePos = Bnk
VeAvePos = Bnk
MaGarPos = Bnk
PfAvePos = Bnk
NcAvePos = Bnk
PaAvePos = Bnk
ParPlPos = Bnk
BrdWkPos = Bnk
# Railroads



buyloop = True
posList = [ 0, MeAvePos, "NONE", BaAvePos, "NONE", RRlrdPos, OrAvePos, "NONE", VtAvePos, CtAvePos, "NONE", StCPlPos, eleComPos, StAvePos, VaAvePos, PRlrdPos, StJPlPos, "NONE", TnAvePos, NYAvePos, "NONE", KyAvePos, "NONE", InAvePos, IlAvePos, BRlrdPos, AtAvePos, VeAvePos, watComPos, MaGarPos, "NONE", PfAvePos, NcAvePos, "NONE", PaAvePos, SrtLnPos, "NONE", ParPlPos, "NONE", BrdWkPos, "NONE"]

#Rents
MeAveRent = 2
MEAVE_RENT1H = 10
MEAVE_RENT2H = 30
MEAVE_RENT3H = 90
MEAVE_RENT4H = 160
MEAVE_RENT5H = 250
MeAveList = [ 0, MEAVE_RENT1H, MEAVE_RENT2H, MEAVE_RENT3H, MEAVE_RENT4H, MEAVE_RENT5H]
BaAveRent = 4
BAAVE_RENT1H = 20
BAAVE_RENT2H = 60
BAAVE_RENT3H = 180
BAAVE_RENT4H = 320
BAAVE_RENT5H = 450
BaAveList = [ 0, BAAVE_RENT1H, BAAVE_RENT2H, BAAVE_RENT3H, BAAVE_RENT4H, BAAVE_RENT5H]
OrAveRent = 6
ORAVE_RENT1H = 30
ORAVE_RENT2H = 90
ORAVE_RENT3H = 270
ORAVE_RENT4H = 400
ORAVE_RENT5H = 550
OrAveList = [ 0, ORAVE_RENT1H, ORAVE_RENT2H, ORAVE_RENT3H, ORAVE_RENT4H, ORAVE_RENT5H]
VtAveRent = 6
VTAVE_RENT1H = 30
VTAVE_RENT2H = 90
VTAVE_RENT3H = 270
VTAVE_RENT4H = 400
VTAVE_RENT5H = 550
VtAveList = [ 0, VTAVE_RENT1H, VTAVE_RENT2H, VTAVE_RENT3H, VTAVE_RENT4H, VTAVE_RENT5H]
CtAveRent = 8
CTAVE_RENT1H = 40
CTAVE_RENT2H = 100
CTAVE_RENT3H = 300
CTAVE_RENT4H = 450
CTAVE_RENT5H = 600
CtAveList = [ 0, CTAVE_RENT1H, CTAVE_RENT2H, CTAVE_RENT3H, CTAVE_RENT4H, CTAVE_RENT5H]
StCPlRent = 10
STCPL_RENT1H = 50
STCPL_RENT2H = 150
STCPL_RENT3H = 450
STCPL_RENT4H = 625
STCPL_RENT5H = 730
StCPlList = [ 0, STCPL_RENT1H, STCPL_RENT2H, STCPL_RENT3H, STCPL_RENT4H, STCPL_RENT5H]
StAveRent = 10
STAVE_RENT1H = 50
STAVE_RENT2H = 150
STAVE_RENT3H = 450
STAVE_RENT4H = 625
STAVE_RENT5H = 730
StAveList = [ 0, STAVE_RENT1H, STAVE_RENT2H, STAVE_RENT3H, STAVE_RENT4H, STAVE_RENT5H]
VaAveRent = 12
VAAVE_RENT1H = 60
VAAVE_RENT2H = 180
vAAVE_RENT3H = 500
VAAVE_RENT4H = 700
VAAVE_RENT5H = 900
VaAveList = [ 0, VAAVE_RENT1H, VAAVE_RENT2H, vAAVE_RENT3H, VAAVE_RENT4H, VAAVE_RENT5H]
StJPlRent = 14
STJPL_RENT1H = 70
STJPL_RENT2H = 200
STJPL_RENT3H = 550
STJPL_RENT4H = 750
STJPL_RENT5H = 950
StJPlList = [ 0, STJPL_RENT1H, STJPL_RENT2H, STJPL_RENT3H, STJPL_RENT4H, STJPL_RENT5H]
TnAveRent = 14
TNAVE_RENT1H = 70
TNAVE_RENT2H = 200
TNAVE_RENT3H = 550
TNAVE_RENT4H = 750
TNAVE_RENT5H = 950
TnAveList = [ 0, TNAVE_RENT1H, TNAVE_RENT2H, TNAVE_RENT3H, TNAVE_RENT4H, TNAVE_RENT5H]
NYAveRent = 16
NYAVE_RENT1H = 80
NYAVE_RENT2H = 220
NYAVE_RENT3H = 600
NYAVE_RENT4H = 800
NYAVE_RENT5H = 1000
NYAveList = [ 0, NYAVE_RENT1H, NYAVE_RENT2H, NYAVE_RENT3H, NYAVE_RENT4H, NYAVE_RENT5H]
KyAveRent = 18
KYAVE_RENT1H = 90
KYAVE_RENT2H = 250
KYAVE_RENT3H = 700
KYAVE_RENT4H = 875
KYAVE_RENT5H = 1050
KyAveList = [ 0, KYAVE_RENT1H, KYAVE_RENT2H, KYAVE_RENT3H, KYAVE_RENT4H, KYAVE_RENT5H]
InAveRent = 18
INAVE_RENT1H = 90
INAVE_RENT2H = 250
INAVE_RENT3H = 700
INAVE_RENT4H = 875
INAVE_RENT5H = 1050
InAveList = [ 0, INAVE_RENT1H, INAVE_RENT2H, INAVE_RENT3H, INAVE_RENT4H, INAVE_RENT5H]
IlAveRent = 20
ILAVE_RENT1H = 100
ILAVE_RENT2H = 300
ILAVE_RENT3H = 750
ILAVE_RENT4H = 925
ILAVE_RENT5H = 1100
IlAveList = [ 0, ILAVE_RENT1H, ILAVE_RENT2H, ILAVE_RENT3H, ILAVE_RENT4H, ILAVE_RENT5H]
AtAveRent = 22
ATAVE_RENT1H = 110
ATAVE_RENT2H = 330
ATAVE_RENT3H = 800
ATAVE_RENT4H = 975
ATAVE_RENT5H = 1150
AtAveList = [ 0, ATAVE_RENT1H, ATAVE_RENT2H, ATAVE_RENT3H, ATAVE_RENT4H, ATAVE_RENT5H]
VeAveRent = 22
VEAVE_RENT1H = 110
VEAVE_RENT2H = 330
VEAVE_RENT3H = 800
VEAVE_RENT4H = 975
VEAVE_RENT5H = 1150
VeAveList = [ 0, VEAVE_RENT1H, VEAVE_RENT2H, VEAVE_RENT3H, VEAVE_RENT4H, VEAVE_RENT5H]
MaGarRent = 24
MAGAR_RENT1H = 120
MAGAR_RENT2H = 360
MAGAR_RENT3H = 850
MAGAR_RENT4H = 1025
MAGAR_RENT5H = 1200
MaGarList = [ 0, MAGAR_RENT1H, MAGAR_RENT2H, MAGAR_RENT3H, MAGAR_RENT4H, MAGAR_RENT5H]
PfAveRent = 26
PFAVE_RENT1H = 130
PFAVE_RENT2H = 390
PFAVE_RENT3H = 900
PFAVE_RENT4H = 1100
PFAVE_RENT5H = 1275
PfAveList = [ 0, PFAVE_RENT1H, PFAVE_RENT2H, PFAVE_RENT3H, PFAVE_RENT4H, PFAVE_RENT5H]
NCAveRent = 26
NCAVE_RENT1H = 130
NCAVE_RENT2H = 390
NCAVE_RENT3H = 900
NCAVE_RENT4H = 1100
NCAVE_RENT5H = 1275
NCAveList = [ 0, NCAVE_RENT1H, NCAVE_RENT2H, NCAVE_RENT3H, NCAVE_RENT4H, NCAVE_RENT5H]
PaAveRent = 28
PAAVE_RENT1H = 150
PAAVE_RENT2H = 450
PAAVE_RENT3H = 1000
PAAVE_RENT4H = 1200
PAAVE_RENT5H = 1400
PaAveList = [ 0, PAAVE_RENT1H, PAAVE_RENT2H, PAAVE_RENT3H, PAAVE_RENT4H, PAAVE_RENT5H]
ParPlRent = 35
PARPL_RENT1H = 175
PARPL_RENT2H = 500
PARPL_RENT3H = 1100
PARPL_RENT4H = 1300
PARPL_RENT5H = 1500
ParPlList = [ 0, PARPL_RENT1H, PARPL_RENT2H, PARPL_RENT3H, PARPL_RENT4H, PARPL_RENT5H]
BrdWkRent = 50
BRDWK_RENT1H = 200
BRDWK_RENT2H = 600
BRDWK_RENT3H = 1400
BRDWK_RENT4H = 1700
BRDWK_RENT5H = 2000
BrdWkList = [ 0, BRDWK_RENT1H, BRDWK_RENT2H, BRDWK_RENT3H, BRDWK_RENT4H, BRDWK_RENT5H]

houseRentList = [ "NONE", MeAveList, "NONE", BaAveList,"NONE", "NONE",  OrAveList, "NONE", VtAveList, CtAveList, "NONE", StCPlList, "NONE", StAveList, VaAveList, "NONE", StJPlList, "NONE", TnAveList, NYAveList, "NONE", KyAveList, "NONE", InAveList, "NONE", IlAveList, AtAveList, VeAveList, "NONE", MaGarList, "NONE", PfAveList, NCAveList, "NONE", PaAveList, "NONE", "NONE", ParPlList, "NONE", BrdWkList]
rentList = [ "NONE", MeAveRent, "NONE", BaAveRent, "NONE", "NONE", OrAveRent, "NONE", VtAveRent, CtAveRent, "NONE", StCPlRent, "NONE", StAveRent, VaAveRent, "NONE", StJPlRent, "NONE", TnAveRent, NYAveRent, "NONE", KyAveRent, "NONE", InAveRent, IlAveRent, "NONE", AtAveRent, VeAveRent, "NONE", MaGarRent, "NONE", PfAveRent,  NCAveRent, "NONE", PaAveRent, "NONE", "NONE", ParPlRent, "NONE", BrdWkRent, "NONE"]
# Monopolies
BrownMonopoly = Bnk
LightMonopoly = Bnk
PinkMonopoly = Bnk
OrangeMonopoly = Bnk
RedMonopoly = Bnk
YellowMonopoly = Bnk
GreenMonopoly = Bnk
BlueMonopoly = Bnk
mnplies = [ BrownMonopoly, LightMonopoly, PinkMonopoly, OrangeMonopoly, RedMonopoly, YellowMonopoly, GreenMonopoly, BlueMonopoly ]


ChanceCard1 = "'Advance to GO!'"
ChanceCard2 = "'Advance to ILLINOIS AVENUE! If you pass GO, collect 200 dollars.'"
ChanceCard3 = "'Advance to ST. CHARLES PLACE! If you pass GO, collect 200 dollars.'"
ChanceCard4 = "'Go to JAIL. Go directly to JAIL. Do not pass GO. Do not collect 200 dollars.'"
ChanceCard5 = "'You have been elected Chairman of the Board! Pay everyone 50 dollars.'"
ChanceCard6 = "'Go back 3 spaces!'"
ChanceCard7 = "'Bank pays you dividend of 50 dollars!"
ChanceCard8 = "'Pay speeding fine of 15 dollars!'"
ChanceCard9 = "'Advance to BOARDWALK!'"
ChanceCard10 = "'Your building and loan matures! Collect 150 dollars.'"
ChanceCard11 = "'Make general repairs on all your property! For each house pay 25 dollars. For each hotel pay 100.'"
ChanceCard12 = "'Take a ride on the Reading ( Railroad ). if you pass GO, collect 200 dollars.'"
ChanceCard13 = "'Get out of JAIL free! This card may be kept until needed, or traded/sold'"
ChanceCard14 = "'Advance to the nearest Railroad! Pay owner double rent to he/she is otherwise entitled to. If property is unowned, you may purchase it from the bank.'"
ChanceCard15 = "'Advance to the nearest Utility! If unowned, you may buy it from the bank. If owned, throw dice and pay the owner 10 times the amount thrown.'"
ChanceCard16 = "'Advance to nearest Railroad! Pay owner double rent to he/she is entitled to. If property is unowned, you may purchase it from the bank.'"
ChanceCardList = [ 0, ChanceCard1, ChanceCard2, ChanceCard3, ChanceCard4, ChanceCard5, ChanceCard6, ChanceCard7, ChanceCard8, ChanceCard9, ChanceCard10, ChanceCard11, ChanceCard12, ChanceCard13, ChanceCard14, ChanceCard15, ChanceCard16 ]

ComChestCard1 = "'Advance to GO!'"
ComChestCard2 = "'Bank error in your favor! Collect 200 dollars.'"
ComChestCard3 = "'Doctor's fee! Pay 50 dollars.'"
ComChestCard4 = "'From sale of stock you get 50 dollars!'"
ComChestCard5 = "'Get out of JAIL free! this card can be kept until needed, or traded/sold.'"
ComChestCard6 = "'Go to JAIL. Go directly to JAIL. Do not pass GO. Do not collect 200 dollars.'"
ComChestCard7 = "'Grand Opera tonight! Collect 50 dollars from every player for opening night seats.'"
ComChestCard8 = "'X-mas fund matures! Collect 50 dollars.'"
ComChestCard9 = "'Income tax refund! Collect 20 dollars.'"
ComChestCard10 = "'You win a beauty contest! Collect 10 dollars.'"
ComChestCard11 = "'Life insurance matures! Collect 100 dollars.'"
ComChestCard12 = "'Pay doctor's fee of 100 dollars!'"
ComChestCard13 = "'Pay school fees of 100 dollars!'"
ComChestCard14 = "'Recieve 25 dollar consultancy fee!'"
ComChestCard15 = "'You inherit 100 dollars!'"
ComChestCard16 = "'You are assessed for street repairs: 40 dollars for each house, 115 for each hotel.'"
ComChestCardList = [ 0, ComChestCard1, ComChestCard2, ComChestCard3, ComChestCard4, ComChestCard5, ComChestCard6, ComChestCard7, ComChestCard8, ComChestCard9, ComChestCard10, ComChestCard11, ComChestCard12, ComChestCard13, ComChestCard14, ComChestCard15, ComChestCard16]
#bids
P1AuctVal = 50
P2AuctVal = 50
P3AuctVal = 50
P4AuctVal = 50
P1PrevAuctVal = 0
P2PrevAuctVal = 0
P3PrevAuctVal = 0
P4PrevAuctVal = 0
players = 2
turns = 0
winAmount = 0
win = Bnk
roll1 = 0
roll2 = 0
rollSum = 0
#Lists
Players = [ "Index 0", "Player 1", "Player 2", "Player 3", "Player 4" ]
playList = [ 0, P1, P2, P3, P4 ]
playLoca = [ 0, P1L, P2L, P3L, P4L ]
playMono = [ 0, P1Mnply, P2Mnply, P3Mnply, P4Mnply ]

positions = [ 0, P1p, P2p, P3p, P4p ]
placeVar = playLoca[turns]
doubleRent = False
doubleUtil = False
railroad = False
# auction
def Xor(*args):
    return sum(args) == 1
def auction():
    global P1AuctVal, P2AuctVal, P3AuctVal, P4AuctVal, P1PrevAuctVal, P2PrevAuctVal, P3PrevAuctVal, P4PrevAuctVal, P2, P1, P3, P4, buyloop, AuctWin, bugfix, players, winAmount, win, placeVar
    P1AuctVal = P2AuctVal = P3AuctVal = P4AuctVal = 50
    auctList = [ 0, P1AuctVal, P2AuctVal, P3AuctVal, P4AuctVal ]
    prevAuct = [ 0, P1PrevAuctVal, P2PrevAuctVal, P3PrevAuctVal, P4PrevAuctVal ]
    AuctContinue = True
    print( "-" * 50)
    print("%29s" % ("Auction!"))
    print("-" * 50)
    P1AuctVal = 50
    P2AuctVal = 50
    P3AuctVal = 50
    P4AuctVal = 50
    loseProcedure = False
    NoP1 = True
    NoP2 = True
    NoP3 = False
    NoP4 = False
    if players > 2:
        NoP3 = True
        loseP3 = False
        if players > 3:
            NoP4 = True
            loseP4 = False
    auct = turns - 1
    auctPlay = [ 0, NoP1, NoP2, NoP3, NoP4 ]
    while True:
        auct += 1
        if players == 2:
            if auct > 2:
                auct -= 2
        elif players == 3:
            if auct > 3:
                auct -= 3
        else:
            if auct > 4:
                auct -= 4
        if AuctContinue:
            auctList.sort()
            highest = auctList[4]
            
            auctList = [ 0, P1AuctVal, P2AuctVal, P3AuctVal, P4AuctVal ]
            if highest >= playList[auct]:
                print( Players[auct] + ", the current highest bid is greater than your amount of money. You have immediately forfeited.")
                auctList[auct] = False
            if auctPlay[auct]:
                P1PrevAuctVal = P1AuctVal
                P2PrevAuctVal = P2AuctVal
                P3PrevAuctVal = P3AuctVal
                P4PrevAuctVal = P4AuctVal
                loseProcedure = False
                print( Players[auct] + ", please put in your bid.\nInput 'n' to quit the auction.")
                print("Bidding starts at " + str(highest) + " dollars.")
                while True: 
                    bid = input()
                        
                    try:
                        bid = int(bid)
                    except ValueError:
                        bid = str(bid)
                        bid = bid.upper()
                        if bid == "N":
                            loseProcedure = True                        
                        else:
                            print("Unrecognized value. Please retry.")
                            bug = False
                    else:
                        bid = int(bid)
                        bug = True
                    if loseProcedure:
                        print( Players[auct] + ", you have forfeited.\n")
                        auctPlay[auct] = False
                        if auct == 1:
                            NoP1 = False
                        elif auct == 2:
                            NoP2 = False
                        elif auct == 3:
                            NoP3 = False
                        elif auct == 4:
                            NoP4 = False
                        if Xor(NoP1, NoP2, NoP3, NoP4):
                            winner = auctPlay.index(True)
                            print( str(Players[winner]) + ", you have won the auction for " + str(auctList[winner]) + " dollars!")
                            win = positions[winner]
                            auctList[winner] = highest
                            
                            AuctContinue = False
                        break
                    if bug:
                        if highest >= int(bid):                   
                            print( Players[auct] + ", the bid you put in is not greater than the highest bid.\nThe highest bid is " + str(highest) + " dollars.")
                        else:
                            print("You have successfully bidded.\n")
                            auctList[auct] = bid
                            break
        else:
            break
                     
    playList[winner] -= auctList[winner]
    print(Players[winner] + ", you have won the auction for " + places[placeVar] + ".")
    print("You now have " + str(playList[winner]) + " dollars.")
    posList[placeVar] = positions[winner]
    P1AuctVal = P2AuctVal = P3AuctVal = P4AuctVal = 50
    if railroad:
        RailList[winner] += 1
doubleRent = False
doubleUtil = False
def go_pass():
    if playLoca[turns] > 40:
        print(Players[turns] + ", you have passed GO. You have earned 200 dollars!")
        playList[turns] += 200
        playLoca[turns] -= 40
def Properties():
    go_pass()
    print("You are at " + places[playLoca[turns]] + ".")
    try: 
        specPlaces.index(places[playLoca[turns]])
    except ValueError:
        normProcedure = True
        facility = False
    else:
        normProcedure = False
        facility = False
    railroad = False
    placeVar = playLoca[turns]
    if not normProcedure:
        if placeVar == 0:
            print("You have earned 200 dollars!")
            playList[turns] += 200
            print("You now have " + str(playList[turns]) + " dollars.")
        elif placeVar == 4:
            print("You had to pay 200 dollars income tax. ")
            playList[turns] -= 200
            print("You now have " + str(playList[turns]) + " dollars.")
        elif placeVar == 5 or placeVar == 15 or placeVar == 25 or placeVar == 35:
            railroad = True
        elif placeVar == 10:
            print("You are just visiting.")
        elif placeVar == 12 or placeVar == 28:
            facility = True
        elif placeVar == 20:
            pass
        elif placeVar == 30:
            print("You have gone to jail.")
            playLoca[turns] = 41
        elif placeVar == 38:
            print("You had to pay 100 dollars luxury tax.")
            playList[turns] -= 100
            print("You now have " + playList[turns] + " dollars.")
            
    if placeVar == 7 or playLoca[turns] == 21 or playLoca[turns] == 36:
        chance = True
    else:
        chance = False
    if placeVar == 2 or placeVar == 17 or placeVar == 33:
        community = True
    else:
        community = False
    if normProcedure:
        chance = False
        community = False
        if posList[placeVar] == Bnk:
            print( Players[turns] + ", do you want to buy this property for " + str(prices[placeVar]) + " dollars? ( y/n ):")
            while True:
                buy = input()
                buy = buy.upper()
                if buy == "Y":
                    print("\nYou have bought " + places[placeVar] + ".")
                    playList[turns] -= prices[placeVar]
                    posList[placeVar] = positions[turns]
                    print("You now have "+ str(playList[turns]) + " dollars.")
                    break
                elif buy == "N":
                    auction()
                    break
                else:
                    print("Try again.")
        
        else:
            if posList[placeVar] == positions[turns]:
                print("You already own " + places[placeVar] + ".")
            else:
                playOwn = positions.index(posList[placeVar]) 
                payRent = Players[playOwn]
                print(Players[turns] + ", you have landed on your opponents' property. You have payed off " + str(rentList[placeVar]) + " dollars to " + payRent + ".")
                playList[turns] -= rentList[placeVar]
                playList[playOwn] += rentList[placeVar]
                print("You now have " + str(playList[turns]) + " dollars.")
                print( Players[playOwn] + " now has "+ str(playList[playOwn]) + ".")
                
                
    if facility:
        if posList[placeVar] == Bnk:
            print( Players[turns] + ", do you want to buy this property for " + str(prices[placeVar]) + " dollars? ( y/n ):")
            while True:
                buy = input()
                buy = buy.upper()
                if buy == "Y":
                    print("\nYou have bought " + places[placeVar] + ".")
                    playList[turns] -= prices[placeVar]
                    posList[placeVar] = positions[turns]
                    print("You now have "+ str(playList[turns]) + " dollars.")
                    break
                elif buy == "N":
                    auction()
                    break
                else:
                    print("Try again.")
        else:
            if posList[placeVar] == positions[turns]:
                print("You already own " + places[placeVar] + ".")
            else:
                playOwn = positions.index(posList[placeVar]) 
                payRent = Players[playOwn]
                doubleUtil = False
                if chance:
                    doubleUtil = True
                if eleComPos == watComPos or doubleUtil:
                    facRent = rollSum * 10
                else:
                    facRent = rollSum * 4
                print(Players[turns] + ", you have landed on your opponents' property. You have payed off " + str(facRent) + " dollars to " + payRent + ".")
                if doubleUtil:
                    print("Chance has increased your payment.")
                playList[turns] -= facRent
                playList[playOwn] -= facRent
                print("You now have " + str(playList[turns]) + " dollars.")
                print( Players[playOwn] + " now has "+ str(playList[playOwn]) + ".")
                doubleUtil = False
                
                
    if railroad:
        if posList[placeVar] == Bnk:
            print( Players[turns] + ", do you want to buy this property for " + str(prices[placeVar]) + " dollars? ( y/n ):")
            while True:
                buy = input()
                buy = buy.upper()
                if buy == "Y":
                    print("\nYou have bought " + places[placeVar] + ".")
                    playList[turns] -= prices[placeVar]
                    posList[placeVar] = positions[turns]
                    print("You now have "+ str(playList[turns]) + " dollars.")
                    break
                    RailList[turns] += 1
                elif buy == "N":
                    auction()
                    break
                else:
                    print("Try again.")
        else:
            if posList[placeVar] == positions[turns]:
                print("You already own " + places[placeVar] + ".")
            else:
                playOwn = positions.index(posList[placeVar]) 
                payRent = Players[playOwn]
                railRent = 50 * RailList[playOwn]
                doubleRent = False
                if chance:
                    doubleRent = True
                if doubleRent:
                    railRent = railRent * 2
                print(Players[turns] + ", you have landed on your opponents' property. You have payed off " + railRent + " dollars to " + payRent + ".")
                if doubleRent:
                    print("Chance has doubled your rent.")
                playList[turns] -= railRent
                playList[playOwn] -= railRent
                print("You now have " + str(playList[turns]) + " dollars.")
                print( Players[playOwn] + " now has "+ str(playList[playOwn]) + ".")
                doubleRent = False
chanceList = list(range(1,17))
random.shuffle(chanceList)
chestList = list(range(1,17))
random.shuffle(chestList)
def chanceProcedure():
    if playLoca[turns] == 7 or playLoca[turns] == 22 or playLoca[turns] == 36:
        normProcedure = False
    else:
        normProcedure = True
    if normProcedure:
        chance = False
    else:
        chance = True
    if chance:
        Card = chanceList.pop(1)
        chanceList.append(Card)
        print( Players[turns] + ", you have drawn the card" + ChanceCardList[Card] )
        if Card == 1:
            playLoca[turns] = 0
        elif Card == 2:
            if playLoca[turns] > 24:
                go_pass()
            playLoca[turns] = 24
        elif Card == 3:
            if playLoca[turns] > 13:
                go_pass()
            playLoca[turns] = 13
        elif Card == 4:
            playLoca[turns] = 41
        elif Card == 5:
            playList[turns] -= 50 * ( players - 1 )
            num = 0
            kid = 4
            for var in kid:
                num += 1
                if num == turns:
                    pass
                else:
                    playList[num] += 50
        elif Card == 6:
            playLoca[turns] -= 3
        elif Card == 7:
            playList[turns] += 50
            print("You now have " + playList[turns] + "dollars.")
        elif Card == 8: 
            playList[turns] -= 15
            print("You now have " + playList[turns] + "dollars.")
        elif Card == 9:
            playLoca[turns] = 39
        elif Card == 10:
            playList[turns] += 150
            print("You now have " + playList[turns] + "dollars.")
        elif Card == 11:
            houseCost = houseList[turns] * 25 
            hotelCost = hotelList[turns] * 100
            pay = houseCost + hotelCost
            playList[turns] -= pay
            print("You paid " + houseCost + " dollars for houses.")
            print("You paid " + hotelCost + " dollars for hotels.")
            print("You now have " + playList[turns] + "dollars.")
        elif Card == 12:
            if playLoca[turns] > 5:
                go_pass()
            playLoca[turns] = 5
        elif Card == 13:
            JailOut[turns] += 1
        elif Card == 14 or Card == 16:
            if playLoca[turns] == 7:
                playLoca[turns] = 5
            elif playLoca[turns] == 22:
                playLoca[turns] = 25
            elif playLoca[turns] == 36:
                playLoca[turns] = 35
            doubleRent = True
        elif Card == 15:
            if playLoca[turns] == 7:
                playLoca[turns] = 12
            else:
                playLoca[turns] = 28
            doubleUtil = True
        Properties()
def chestProcedure():
    global playLoca
    if playLoca[turns] == 2  or playLoca[turns] == 18 or playLoca[turns] == 33:
        normProcedure = False
    else:
        normProcedure = True
    if normProcedure:
        community = False
    else:
        community = True
    if community:
        Card = chestList.pop(1)
        chestList.append(Card)
        print( Players[turns] + ", you have drawn the card" + ComChestCardList[Card] )
        if Card == 1:
            playLoca[turns] = 0
        elif Card == 2:
            playList[turns] += 200
            print("You now have " + playList[turns] + "dollars.")
        elif Card == 3:
            playList[turns] -= 50
            print("You now have " + playList[turns] + "dollars.")
        elif Card == 4:
            playList[turns] += 50
            print("You now have " + playList[turns] + "dollars.")
        elif Card == 5:
            JailOut[turns] += 1
        elif Card == 6:
            playLoca = 41
        elif Card == 7:
            num = 0
            kid = 4
            for var in kid:
                num += 1
                if num == turns:
                    playList[turns] += 50 * ( players - 1 )
                else:
                    playList[num] -= 50
        elif Card == 8:
            playList[turns] += 50
            print("You now have " + playList[turns] + "dollars.")
        elif Card == 9:
            playList[turns] += 20
            print("You now have " + playList[turns] + "dollars.")
        elif Card == 10:
            playList[turns] += 10
            print("You now have " + playList[turns] + "dollars.")
        elif Card == 11:
            playList[turns] += 100
            print("You now have " + playList[turns] + "dollars.")
        elif Card == 12:
            playList[turns] -= 100
            print("You now have " + playList[turns] + "dollars.")
        elif Card == 13:
            playList[turns] -= 100
            print("You now have " + playList[turns] + "dollars.")
        elif Card == 14:
            playList[turns] += 25
            print("You now have " + playList[turns] + "dollars.")
        elif Card == 15:
            playList[turns] += 100
            print("You now have " + playList[turns] + "dollars.")
        elif Card == 16:
            houseCost = houseList[turns] * 40
            hotelCost = hotelList[turns] * 110
            pay = houseCost + hotelCost
            playList[turns] -= pay
            print("You paid " + houseCost + " dollars for houses.")
            print("You paid " + hotelCost + " dollars for hotels.")
            print("You now have " + playList[turns] + " dollars.")
        Properties()
def houseBuild():
    
    if playMono[turns] > 0:
        if BrownMonopoly == positions[turns]:
            print(" MEAVE for Mediterranean Avenue \nBAAVE for Baltic Avenue \n ")
        if LightMonopoly == positions[turns]:
            print(" ORAVE for Oriental Avenue \n VTAVE for Vermont Avenue \n CTAVE for Conneticut Avenue \n ")
        if PinkMonopoly == positions[turns]:
            print(" STCPL for Saint Patrick's Place \n STAVE for State Avenue VAAVE for Virginia Avenue \n ")
        if OrangeMonopoly == positions[turns]:
            print(" STJPL for Saint Jame's place \n TNAVE for Tennesse Avenue \n NYAVE for New York Avenue \n ")
        if RedMonopoly == positions[turns]:
             print("KYAVE for Kentucky Avenue \n INAVE for Indiana Avenue \n ILAVE for Illinois Avenue \n ")
        if YellowMonopoly == positions[turns]:
            print(" ATAVE for Atlantic Avenue \n VEAVE for Ventnor Avenue \n MAGAR for Marvin Gardens \n ")
        if GreenMonopoly == positions[turns]:
            print(" PFAVE for Pacific Avenue \n NCAVE for North Carolina Avenue \n PAAVE for Pennsylvania Avenue \n ")
        if BlueMonopoly == postions[turns]:
            print(" PARPL for Park Place \n BRDWK for Boardwalk \n ")
        buildMore = True
        while True:
            if buildMore:
                build = input("Where do you want to build your house? (Input 'N' to quit)")
                build = build.upper()
                build = build.strip
                numIndex = priceAll.index(build)
                housePlace = posList[numIndex]
                if houseList[numIndex] > 4 and posList[numIndex] == positions[turns]:
                        print("You cannot build more houses on " + housePlace + ". Please choose somewhere else.")
                        stop = True
                elif BrownMonopolyList.count(build) > 0:
                    if BrownMonopoly == positions[turns]: 
                        if MeAveHouse == BaAveHouse:
                            buildAble = True
                            side1 = True
                            break
                        else:
                            BrownHouse.sort()
                            lowerHouse = BrownHouse[0]
                            if MeAveHouse == lowerHouse and build == "BAAVE":
                                print("Youdo not have enough houses on MEDITERRANEAN AVENUE. \nPlease build more to proceed.")
                            if BaAveHouse == lowerHouse and build == "MEAVE":
                                print("You do not have enough houses on BALTIC AVENUE. \nPlease build more to proceed.")
                elif LightMonopolyList.count(build) > 0:
                    if LightMonopoly == positions[turns]:
                        if OrAveHouse == VtAveHouse == CtAveHouse:
                            buildAble = True
                            side1 = True
                            break
                        else:
                            LightHouse.sort()
                            lowerHouse = LightHouse[0]
                            if OrAveHouse == lowerHouse and build == "CTAVE" or build == "VTAVE":
                                if build == "VTAVE":
                                    if OrAveHouse == CtAveHouse:
                                        print("You do not have enough houses on ORIENTAL AVENUE or CONNETICUT AVENUE. Please build more to proceed.")
                                    elif OrAveHouse < VtAveHouse:
                                        print("You do not have enough houses on ORIENTAL AVENUE. \nPlease build more to proceed.")
                                    else:
                                        buildAble = True
                                        side1 = True
                                        break
                                elif build == "CTAVE":
                                    if OrAveHouse == VtAveHouse:
                                        print("You do not have enough houses on ORIENTAL AVENUE or VERMONT AVENUE. Please build more to proceed.")
                                    elif OrAveHouse < CtAveHouse:
                                        print("You do not have enough houses on ORIENTAL AVENUE. \nPlease build more to proceed.")
                                    else:
                                        buildAble = True
                                        side1 = True
                                        break

                                
                            if VtAveHouse == lowerHouse and build == "ORAVE" or build == "CTAVE":
                                if build == "ORAVE":
                                    if VtAveHouse == CtAveHouse:
                                        print("You do not have enough houses on VERMONT AVENUE or CONNETICUT AVENUE. Please build more to proceed.")
                                    elif VtAveHouse < OrAveHouse:
                                        print("You do not have enough houses on VERMONT AVENUE. \nPlease build more to proceed.")
                                    else:
                                        buildAble = True
                                        side1 = True
                                        break
                                elif build == "CTAVE":
                                    if VtAveHouse == OrAveHouse:
                                        print("You do not have enough houses on VERMONT AVENUE or ORIENTAL AVENUE. Please build more to proceed.")
                                    elif VtAveHouse < CtAveHouse:
                                        print("You do not have enough houses on VERMONT AVENUE. \nPlease build more to proceed.")
                                    else:
                                        buildAble = True
                                        side1 = True
                                        break
                            if CtAveHouse == lowerHouse and build == "ORAVE" or build == "VTAVE":
                                if build == "ORAVE":
                                    if CtAveHouse == VtAveHouse:
                                        print("You do not have enough houses on CONNETICUT AVENUE or VERMONT AVENUE. Please build more to proceed.")
                                    elif CtAveHouse < OrAveHouse:
                                        print("You do not have enough houses on CONNETICUT AVENUE. \nPlease build more to proceed.")
                                    else:
                                        buildAble = True
                                        side1 = True
                                        break
                                elif build == "VTAVE":
                                    if CtAveHouse == OrAveHouse:
                                        print("You do not have enough houses on CONNETICUT AVENUE or ORIENTAL AVENUE. Please build more to proceed.")
                                    elif CtAveHouse < VtAveHouse:
                                        print("You do not have enough houses on CONNETICUT AVENUE. \nPlease build more to proceed.")
                                    else:
                                        buildAble = True
                                        side1 = True
                                        break
                elif PinkMonopolyList.count(build) > 0:
                    if PinkMonopoly == positions[turns]:
                        if StCPlHouse == StAveHouse == VaAveHouse:
                            buildAble = True
                            side1 = True
                            break
                        else:
                            PinkHouse.sort()
                            lowerHouse = PinkHouse[0]
                            if StCPlHouse == lowerHouse and build == "STAVE" or build == "VAAVE":
                                if build == "VAAVE":
                                    if StCPlHouse == StAveHouse:
                                        print("You do not have enough houses on SAINT CHARLES' PLACE or STATE AVENUE. Please build more to proceed.")
                                    elif StCPlHouse < VaAveHouse:
                                        print("You do not have enough houses on SAINT CHARLES' PLACE. \nPlease build more to proceed.")
                                    else:
                                        buildAble = True
                                        side1 = True
                                        break
                                elif build == "STAVE":
                                    if StCPlHouse == VaAveHouse:
                                        print("You do not have enough houses on SAINT CHARLES' PLACE or VIRGINIA AVENUE. Please build more to proceed.")
                                    elif StCPlHouse < StAveHouse:
                                        print("You do not have enough houses on SAINT CHARLES' PLACE. \nPlease build more to proceed.")
                                    else:
                                        buildAble = True
                                        side1 = True
                                        break

                                
                            if VaAveHouse == lowerHouse and build == "STCPL" or build == "STAVE":
                                if build == "STCPL":
                                    if VaAveHouse == StAveHouse:
                                        print("You do not have enough houses on VIRGINIA AVENUE or STATE AVENUE. Please build more to proceed.")
                                    elif VaAveHouse < StCPlHouse:
                                        print("You do not have enough houses on VIRGINIA AVENUE. \nPlease build more to proceed.")
                                    else:
                                        buildAble = True
                                        side1 = True
                                        break
                                elif build == "STAVE":
                                    if VaAveHouse == StCPlHouse:
                                        print("You do not have enough houses on VIRGINIA AVENUE or SAINT CHARLES' PLACE. Please build more to proceed.")
                                    elif VaAveHouse < StAveHouse:
                                        print("You do not have enough houses on VIRGINIA AVENUE. \nPlease build more to proceed.")
                                    else:
                                        buildAble = True
                                        side1 = True
                                        break
                            if StAveHouse == lowerHouse and build == "STCPL" or build == "VAAVE":
                                if build == "STCPL":
                                    if StAveHouse == VaAveHouse:
                                        print("You do not have enough houses on STATE AVENUE or VIRGINIA AVENUE. Please build more to proceed.")
                                    elif StAveHouse < StCPlHouse:
                                        print("You do not have enough houses on STATE AVENUE. \nPlease build more to proceed.")
                                    else:
                                        buildAble = True
                                        side1 = True
                                        break
                                elif build == "VAAVE":
                                    if StAveHouse == StCPlHouse:
                                        print("You do not have enough houses on STATE AVENUE or SAINT CHARLES' PLACE. Please build more to proceed.")
                                    elif StAveHouse < VaAveHouse:
                                        print("You do not have enough houses on STATE AVENUE. \nPlease build more to proceed.")
                                    else:
                                        buildAble = True
                                        side1 = True
                                        break
                elif OrangeMonopolyList.count(build) > 0:
                    if OrangeMonopoly == positions[turns]:
                        if StJPlHouse == TnAveHouse == NYAveHouse:
                            buildAble = True
                            side1 = True
                            break
                        else:
                            OrangeHouse.sort()
                            lowerHouse = OrangeHouse[0]
                            if StJPlHouse == lowerHouse and build == "TNAVE" or build == "NYAVE":
                                if build == "VAAVE":
                                    if StJPlHouse == TnAveHouse:
                                        print("You do not have enough houses on SAINT JAMES' PLACE or TENNESSE AVENUE. Please build more to proceed.")
                                    elif StCPlHouse < VaAveHouse:
                                        print("You do not have enough houses on SAINT JAMES' PLACE. \nPlease build more to proceed.")
                                    else:
                                        buildAble = True
                                        side1 = True
                                        break
                                elif build == "TNAVE":
                                    if StJPlHouse == NYAveHouse:
                                        print("You do not have enough houses on SAINT JAMES' PLACE or NEW YORK AVENUE. Please build more to proceed.")
                                    elif StJPlHouse < TnAveHouse:
                                        print("You do not have enough houses on SAINT JAMES' PLACE. \nPlease build more to proceed.")
                                    else:
                                        buildAble = True
                                        side1 = True
                                        break

                                
                            if NYAveHouse == lowerHouse and build == "STJPL" or build == "TNAVE":
                                if build == "STJPL":
                                    if NYAveHouse == StAveHouse:
                                        print("You do not have enough houses on NEW YORK AVENUE or STATE AVENUE. Please build more to proceed.")
                                    elif NYAveHouse < StJPlHouse:
                                        print("You do not have enough houses on NEW YORK AVENUE. \nPlease build more to proceed.")
                                    else:
                                        buildAble = True
                                        side1 = True
                                        break
                                elif build == "TNAVE":
                                    if NYAveHouse == StJPlHouse:
                                        print("You do not have enough houses on NEW YORK AVENUE or SAINT JAMES' PLACE. Please build more to proceed.")
                                    elif NYAveHouse < TnAveHouse:
                                        print("You do not have enough houses on NEW YORK AVENUE. \nPlease build more to proceed.")
                                    else:
                                        buildAble = True
                                        side1 = True
                                        break
                            if TnAveHouse == lowerHouse and build == "STJPL" or build == "NYAVE":
                                if build == "STJPL":
                                    if TnAveHouse == NYAveHouse:
                                        print("You do not have enough houses on TENNESSE AVENUE or NEW YORK AVENUE. Please build more to proceed.")
                                    elif TnAveHouse < StJPlHouse:
                                        print("You do not have enough houses on TENNESSE AVENUE. \nPlease build more to proceed.")
                                    else:
                                        buildAble = True
                                        side1 = True
                                        break
                                elif build == "VAAVE":
                                    if TnAveHouse == StJPlHouse:
                                        print("You do not have enough houses on TENNESSE AVENUE or SAINT JAMES' PLACE. Please build more to proceed.")
                                    elif TnAveHouse < NYAveHouse:
                                        print("You do not have enough houses on TENNESSE AVENUE. \nPlease build more to proceed.")
                                    else:
                                        buildAble = True
                                        side1 = True
                                        break
                elif RedMonopolyList.count(build) > 0:
                    if RedMonopoly == positions[turns]:
                        if KyAveHouse == InAveHouse == IlAveHouse:
                            buildAble = True
                            side1 = True
                            break
                        else:
                            RedHouse.sort()
                            lowerHouse = RedHouse[0]
                            if KyAveHouse == lowerHouse and build == "INAVE" or build == "ILAVE":
                                if build == "ILAVE":
                                    if KyAveHouse == InAveHouse:
                                        print("You do not have enough houses on KENTUCKY AVENUE or INDIANA AVENUE. Please build more to proceed.")
                                    elif KyAveHouse < IlAveHouse:
                                        print("You do not have enough houses on KENTUCKY AVENUE. \nPlease build more to proceed.")
                                    else:
                                        buildAble = True
                                        side1 = True
                                        break
                                elif build == "INAVE":
                                    if KyAveHouse == IlAveHouse:
                                        print("You do not have enough houses on KENTUCKY AVENUE or ILLINOIS AVENUE. Please build more to proceed.")
                                    elif KyAveHouse < InAveHouse:
                                        print("You do not have enough houses on KENTUCKY AVENUE. \nPlease build more to proceed.")
                                    else:
                                        buildAble = True
                                        side1 = True
                                        break

                                
                            if IlAveHouse == lowerHouse and build == "KYAVE" or build == "INAVE":
                                if build == "KYAVE":
                                    if IlAveHouse == InAveHouse:
                                        print("You do not have enough houses on ILLINOIS AVENUE or INDIANA AVENUE. Please build more to proceed.")
                                    elif IlAveHouse < KyAveHouse:
                                        print("You do not have enough houses on ILLINOIS AVENUE. \nPlease build more to proceed.")
                                    else:
                                        buildAble = True
                                        side1 = True
                                        break
                                elif build == "INAVE":
                                    if IlAveHouse == KyAveHouse:
                                        print("You do not have enough houses on ILLINOIS AVENUE or KENTUCKY AVENUE. Please build more to proceed.")
                                    elif IlAveHouse < InAveHouse:
                                        print("You do not have enough houses on ILLINOIS AVENUE. \nPlease build more to proceed.")
                                    else:
                                        buildAble = True
                                        side1 = True
                                        break
                            if InAveHouse == lowerHouse and build == "KYAVE" or build == "ILAVE":
                                if build == "KYAVE":
                                    if InAveHouse == IlAveHouse:
                                        print("You do not have enough houses on INDIANA AVENUE or ILLINOIS AVENUE. Please build more to proceed.")
                                    elif InAveHouse < KyAveHouse:
                                        print("You do not have enough houses on INDIANA AVENUE. \nPlease build more to proceed.")
                                    else:
                                        buildAble = True
                                        side1 = True
                                        break
                                elif build == "ILAVE":
                                    if InAveHouse == KyAveHouse:
                                        print("You do not have enough houses on INDIANA AVENUE or KENTUCKY AVENUE. Please build more to proceed.")
                                    elif InAveHouse < IlAveHouse:
                                        print("You do not have enough houses on INDIANA AVENUE. \nPlease build more to proceed.")
                                    else:
                                        buildAble = True
                                        side1 = True
                                        break
                elif YellowMonopolyList.count(build) > 0:
                    if YellowMonopoly == positions[turns]:
                        if AtAveHouse == VeAveHouse == MaGarHouse:
                            buildAble = True
                            side1 = True
                            break
                        else:
                            YellowHouse.sort()
                            lowerHouse = YellowHouse[0]
                            if AtAveHouse == lowerHouse and build == "VEAVE" or build == "MAGAR":
                                if build == "MAGAR":
                                    if AtAveHouse == VeAveHouse:
                                        print("You do not have enough houses on ATLANTIC AVENUE or VENTNOR AVENUE. Please build more to proceed.")
                                    elif AtAveHouse < MaGarHouse:
                                        print("You do not have enough houses on ATLANTIC AVENUE. \nPlease build more to proceed.")
                                    else:
                                        buildAble = True
                                        side1 = True
                                        break
                                elif build == "VEAVE":
                                    if AtAveHouse == MaGarHouse:
                                        print("You do not have enough houses on ATLANTIC AVENUE or MARVIN GARDENS AVENUE. Please build more to proceed.")
                                    elif AtAveHouse < VeAveHouse:
                                        print("You do not have enough houses on ATLANTIC AVENUE. \nPlease build more to proceed.")
                                    else:
                                        buildAble = True
                                        side1 = True
                                        break

                                
                            if MaGarHouse == lowerHouse and build == "ATAVE" or build == "VEAVE":
                                if build == "ATAVE":
                                    if MaGarHouse == VeAveHouse:
                                        print("You do not have enough houses on MARVIN GARDENS or VENTNOR AVENUE. Please build more to proceed.")
                                    elif MaGarHouse < AtAveHouse:
                                        print("You do not have enough houses on MARVIN GARDENS. \nPlease build more to proceed.")
                                    else:
                                        buildAble = True
                                        side1 = True
                                        break
                                elif build == "VEAVE":
                                    if MaGarHouse == AtAveHouse:
                                        print("You do not have enough houses on MARVIN GARDENS or ATLANTIC AVENUE. Please build more to proceed.")
                                    elif MaGarHouse < VeAveHouse:
                                        print("You do not have enough houses on MARVIN GARDENS. \nPlease build more to proceed.")
                                    else:
                                        buildAble = True
                                        side1 = True
                                        break
                            if VeAveHouse == lowerHouse and build == "ATAVE" or build == "MAGAR":
                                if build == "ATAVE":
                                    if VeAveHouse == MaGarHouse:
                                        print("You do not have enough houses on VENTNOR AVENUE or MARVIN GARDENS. Please build more to proceed.")
                                    elif VeAveHouse < AtAveHouse:
                                        print("You do not have enough houses on VENTNOR AVENUE. \nPlease build more to proceed.")
                                    else:
                                        buildAble = True
                                        side1 = True
                                        break
                                elif build == "MAGAR":
                                    if VeAveHouse == AtAveHouse:
                                        print("You do not have enough houses on VENTNOR AVENUE or ATLANTIC AVENUE. Please build more to proceed.")
                                    elif VeAveHouse < MaGarHouse:
                                        print("You do not have enough houses on VENTNOR AVENUE. \nPlease build more to proceed.")
                                    else:
                                        buildAble = True
                                        side1 = True
                                        break
                elif GreenMonopolyList.count(build) > 0:
                    if GreenMonopoly == positions[turns]:
                        if KyAveHouse == InAveHouse == IlAveHouse:
                            buildAble = True
                            side1 = True
                            break
                        else:
                            GreenHouse.sort()
                            lowerHouse = GreenHouse[0]
                            if PfAveHouse == lowerHouse and build == "NCAVE" or build == "PAAVE":
                                if build == "PAAVE":
                                    if PfAveHouse == NCAveHouse:
                                        print("You do not have enough houses on PACIFIC AVENUE or NORTH CAROLINA AVENUE. Please build more to proceed.")
                                    elif PfAveHouse < PaAveHouse:
                                        print("You do not have enough houses on PACIFIC AVENUE. \nPlease build more to proceed.")
                                    else:
                                        buildAble = True
                                        side1 = True
                                        break
                                elif build == "NCAVE":
                                    if PfAveHouse == PaAveHouse:
                                        print("You do not have enough houses on PACIFIC AVENUE or PENNSYLVANIA AVENUE. Please build more to proceed.")
                                    elif PfAveHouse < NCAveHouse:
                                        print("You do not have enough houses on PACIFIC AVENUE. \nPlease build more to proceed.")
                                    else:
                                        buildAble = True
                                        side1 = True
                                        break

                                
                            if PaAveHouse == lowerHouse and build == "PFAVE" or build == "NCAVE":
                                if build == "PFAVE":
                                    if PaAveHouse == NCAveHouse:
                                        print("You do not have enough houses on PENNSYLVANIA AVENUE or NORTH CAROLINA AVENUE. Please build more to proceed.")
                                    elif PaAveHouse < PfAveHouse:
                                        print("You do not have enough houses on PENNSYLVANIA AVENUE. \nPlease build more to proceed.")
                                    else:
                                        buildAble = True
                                        side1 = True
                                        break
                                elif build == "INAVE":
                                    if PaAveHouse == PfAveHouse:
                                        print("You do not have enough houses on PENNSYLVANIA AVENUE or PACIFIC AVENUE. Please build more to proceed.")
                                    elif PaAveHouse < NCAveHouse:
                                        print("You do not have enough houses on PENNSYLVANIA AVENUE. \nPlease build more to proceed.")
                                    else:
                                        buildAble = True
                                        side1 = True
                                        break
                            if NCAveHouse == lowerHouse and build == "PFAVE" or build == "ILAVE":
                                if build == "PFAVE":
                                    if NCAveHouse == PaAveHouse:
                                        print("You do not have enough houses on NORTH CAROLINA AVENUE or PENNSYLVANIA AVENUE. Please build more to proceed.")
                                    elif NCAveHouse < KyAveHouse:
                                        print("You do not have enough houses on NORTH CAROLINA AVENUE. \nPlease build more to proceed.")
                                    else:
                                        buildAble = True
                                        side1 = True
                                        break
                                elif build == "PAAVE":
                                    if NCAveHouse == PfAveHouse:
                                        print("You do not have enough houses on NORTH CAROLINA AVENUE or PACIFIC AVENUE. Please build more to proceed.")
                                    elif NCAveHouse < PaAveHouse:
                                        print("You do not have enough houses on NORTH CAROLINA AVENUE. \nPlease build more to proceed.")
                                    else:
                                        buildAble = True
                                        side1 = True
                                        break
                elif BlueMonopolyList.count(build) > 0:
                    if BlueMonopoly == positions[turns]:
                        if ParPlHouse == BrdWkHouse:
                            buildAble = True
                            side1 = True
                            break
                        else:
                            BlueHouse.sort()
                            lowerHouse = BlueHouse[0]
                            if ParPlHouse == lowerHouse and build == "BRDWK":
                                print("Youdo not have enough houses on PARK PLACE. \nPlease build more to proceed.")
                            if BrdWkHouse == lowerHouse and build == "PARPL":
                                print("You do not have enough houses on BOARDWALK. \nPlease build more to proceed.")
                elif build == 'N':
                    buildMore = False
                else:
                    print("You do not own the property or entered an unrecognizable value. Try again.")
                if buildAble:
                    if side1:
                        housePrice = SIDE1HOUSEPRICE
                    elif side2:
                        housePrice = SIDE2HOUSEPRICE
                    elif side3:
                        housePrice = SIDE3HOUSEPRICE
                    elif side4:
                        housePrice = SIDE4HOUSEPRICE
                    numIndex = priceAll.index(build)
                    housePlace = posList[numIndex]
                    
                    
                    if houseList[numindex] == 4:
                        housePrice = housePrice * 4
                        print("Do you want to buy a hotel on " + housePlace + " for " + housePrice + " dollars? ( Y/N ):")
                    else:
                        print("Do you want to build a house on " + housePlace + " for " + housePrice + " dollars? ( Y/N ):")
                    while True:
                        confirm = input()
                        confirm = confirm.upper()
                        if stop:
                            confirm = "N"
                        if confirm == "Y":
                            confirm = True
                            break
                        elif confirm == "N":
                            break
                        else:
                            print("Unrecognized value. Try again.")
                        if confirm:
                            playList[turns] -= housePrice
                            houseList[numindex] += 1
                            rentList[numindex] = houseRentList[numindex]
                            rentList[numindex] = rentList[numindex][houseList[numindex]]
                            print("Buy was successful!")
                    side1 = False
                    side2 = False
                    side3 = False
                    side4 = False
            else:
                break
        
    else:
        print("You have no Monopolies.")
def jailbreak():
    print("1 for bail\n2 for rolling doubles")
    if jailOut[turns] > 0:
        print("3 to use ' GET OUT OF JAIL FREE!' card")
    while True:
        jailBreak = input()
        try:
            jailBreak = int(jailBreak)
        except ValueError:
            pass
        if jailBreak == 1:
            playList -= 50
            print("You have bailed out of jail for 50 dollars.")
            print("You now have " + playList[turns] + " dollars.")
            print("You may now roll.")
            playLoca[turns] = 10
            break
        elif jailBreak == 2:
            roll = True
            for doubles in range(3):
                if roll:
                    roll1 = random.randint(1,6)
                    roll2 = random.randint(1,6)
                    if roll1 == roll2:
                        print("You got doubles! You only need to roll doubles" + 3 - doubles + " more times.")
                        gotDoubles += 1
                        roll = True
                    else:
                        print("You did not roll doubles. You cannot escape jail this turn.")
                        jail = False
                        roll = False
            if gotDouble == 3:
                print("You got out of jail!\nYou may now roll.")
                playLoca[turns] = 10
                break
        elif jailBreak == 3:
            if jailOut[turns] > 0:
                jailOut[turns] -= 1
                print("You have used a 'GET OUT OF JAIL FREE' card. \nYou may now roll.")
                break
            else:
                print("You cannot choose this option.")
def sellProp():
    print(help)
    print("\nThese are the properties you may mortgage:")
    for i in range(41):
        sellDontList = [ 0, 2, 4, 5, 7, 10, 12, 15, 17, 20, 22, 25, 28, 30, 33, 35, 36, 38]
        if sellDontList.count(i) > 0:
            pass
        else:
            if posList[i - 1] == positions[turns]:
                print(places[i])
    while True:
        print("Which property would you like to mortgage? ( Use above list ) input 'n' to quit.")
        sell = input()
        sell = sell.upper()
        sell = sell.strip()
        if priceAll.count(sell) > 0:
            sellPos = posList[priceAll[sell]]
            if sellPos == positions[turns]:
                sellPlace = places[priceAll[sell]]
                if BrownMonopolyList.count(priceAll[sell]) > 0 or LightMonopolyList.count(priceAll[sell]) > 0:
                    houseVal = SIDE1HOUSEPRICE
                elif PinkMonopolyList(priceAll[sell]) > 0 or OrangeMonopolyList.count(priceAll[sell]) > 0:
                    houseVal = SIDE2HOUSEPRICE
                elif RedMonopolyList(priceAll[sell]) > 0 or YellowMonopolyList.count(priceAll[sell]) > 0:
                    houseVal = SIDE3HOUSEPRICE
                elif GreenMonopolyList(priceAll[sell]) > 0 or BlueMonopolyList.count(priceAll[sell]) > 0:
                    houseVal = SIDE4HOUSEPRICE
                mortValue = prices[priceAll[sell]] / 2 + (houseList[priceAll[sell]] + houseVal / 2)
                print("Do you want to sell " + sellPlace + " for " + str(mortValue) + " dollars? ( Y/N):")
                sellConfirm = input()
                sellConfirm = sellConfirm.upper()
                sellConfirm = sellConfirm.strip()
                if sellConfirm == "Y":
                    sellPos = Bnk
                    houseList[priceAll[sell]] = 0
                    playList[turns] += mortList
                    print("You have mortgaged "+ sellPlace + ".\nYou now have " + playList[turns] + " dollars.")
            else:
                print("You do not have this property.")
        else:
            print("You have entered a unrecognizable value. Try again.")
Contin1 = Contin2 = Contin3 = Contin4 = True
ContinList = [ Contin1, Contin2, Contin3, Contin4]
Delay = False
def startTurn():
    global turns
    turns += 1
    if turns > players:
        turns -= players
    global playLoca, Delay
    if ContinList[turns]:
        if playLoca[turns] == 41:
            jailCounter += 1
        else:
            jailCounter = 0
        if jailCounter == 3:
            print("You have stayed in jail for 3 turns. You are forced to bail.")
            playList[turns] -= 50
            playLoca = 10
        print(Players[turns])
        print(str(playList[turns]) + " dollars")
        print("Location: " + places[playLoca[turns]])
        
        if Delay:
            print("*" * 32)
            print("URGENT! INDEBT! SELL PROPERTIES!")
            print("*" * 32)
        while True:
            print("\n1 for roll \n2 for houses\n3 for selling")
            if playLoca[turns] == 41:
                jail = True
            if playLoca[turns] == 41 and jail == True:
                print("4 for jailbreak")
            decision = input()
            try:
                decision = int(decision)
            except ValueError:
                pass
            if decision == 1:
                if playLoca[turns] == 41:
                    print("You cannot roll this turn. You are currently in jail.")
                else:
                    break
            elif decision == 2:
                houseBuild()
            elif decision == 3:
                sellProp()
            elif decision == 4:
                if playLoca[turns] == 41 and jail:
                    jailbreak()
                else:
                    print("You cannot choose this at this time.")
            else:
                print("Unrecognizable input. Try again.")
        while True:
            roll1 = random.randint(1, 6)
            roll2 = random.randint(1, 6)
            rollSum = roll1 + roll2
            doubles = 0
            playLoca[turns] += rollSum
            print("You rolled a " + str(roll1) + " and a " + str(roll2) + ".")
            Properties()
            chanceProcedure()
            chestProcedure()
            if roll1 == roll2:
                doubles += 1
                print("You got doubles! Roll again.")
                if doubles == 3:
                    print("You are now in jail.")
                    PlayLoca[turns] = 41
                    break
            else:
                break
        if Delay:
            print("You are still in debt. You are forced to quit.")
            ContinList[turns] = False
            if turns == 1:
                Contin1 = False
            elif turns == 2:
                Contin2 = False
            elif turns == 3:
                Contin3 = False
            elif turns == 4:
                Contin4 = False
            Delay = False
        if playList[turns] < 0:
            print("You are now in debt. You have 1 turn to get out of bankruptcy.")
            Delay = True

def playGame():
    print( "-" * 50)
    print("%29s" % ("Monopoly"))
    print("-" * 50)
    Contin1 = True
    Contin2 = True
    Contin3 = True
    Contin4 = True
    while True:
        players = input("How many people are playing? 2-4:")
        try:
            players = int(players)
        except ValueError:
            print("Invalid input. Try again.")
            valCon = False
        else:
            valCon = True
        if valCon:
            if players < 2 or players > 4:
                print("Invalid input. Try again.")
            else:
                break
    def Xor(*args):
        return sum(args) == 1
    turns = 0
    while not Xor(Contin1, Contin2, Contin3, Contin4):
        
        startTurn()
    if Contin1:
        gameWinner = 1
    if Contin2:
        gameWinner = 2
    if Contin3:
        gameWinner = 3
    if Contin4:
        gameWinner = 4
    print( Players[gameWinner] + ", you have won the game!")
    input("p05 r29 yao kevin CEP \nPress enter to quit.")
playGame()