A few days ago, I was playing Monopoly with my friends and found myself often asking the question, "What are the odds of me going there?". So I decided to find out.
The attached program is a Python 2.7 program that simulates the path of ONE player in Monopoly. You specify how many rolls you want to do, then the computer does the rest. After all its processing, it will return for you statistics on how many times it landed on each property, how many times you went to jail, and even draw you a Monopoly board containing the number of times you have landed on each property (make sure that your terminal is wide enough to show each row of the board in a seperate line).
*The color scheme of the board in this program is based off this image: http://img.thesun.co.uk/aidemitlum/archive/01771/Monopoly2_1771742a.jpg
In the future, if I have the time, these are some improvements that I would like to make:
-
Add a monetary value to each property and a balance to the player to see how much money you would be left with if you bought certain property.
-
Multiple player support, so that when player C lands on player A's property, the correct amount of money is transferred from player C's balance to player A's balance.
-
Program in the effects of every single chance card and community sheild (financial effects such as "Collect $500K" and movement effects such as "Go to Kensington Palace Gardens") so that the simulation is as realistic as possible.
If you have any other suggestions, you are welcome to share them with me!
That's all from me.
Enjoy :D