Simulation of the popular property trading game.
- DONE: Player movement mechanics. Board and dice. Chance & Community Chest for cards which move the player. Go To Jail and different ways of leaving jail.
- DONE: Work out square frequencies. How often do players land on each square, and how often do they end their turn on each square. Graphing of results.
- DONE: Financial implications of Chance and Community Chest, money when passing Go, Tax squares, pay to leave Jail (after 3 failed attempts at doubles).
- TO DO: Other financial parts of the game. Deed buying, house building, rent calculation and collection.
- TO DO: Simulate players with different strategies. For example, players with preference for buying certain sets of properties, different appetites for risk taking (how much of their cash they will spend on houses, etc.).
pip install matplotlib
This allows you to check that tha player movement mechanics are working as expected - dice rolling, Chance and Community Chest cards that move players, 'Go to Jail', etc.
python one_player_on_board.py 25 True
The 1st parameter is how many turns the player will take. True
for the 2nd parameter tells the program to print info about the player's movements to stdout. Example output here.
python one_player_on_board.py 1000000 False
The 1st parameter is how many turns the player will take. False
for the 2nd parameter tells the program to not send detailed info about the player's movement to stdout.
python money_after_each_turn.py 50 1000 False
The 1st parameter is how many turns the player will take each game. 2nd parameter is number of games to be analysed. False
for the 2nd parameter tells the program to not send detailed info about the player's movement to stdout.
There is a class diagram here.
Property rents, etc. http://www.jdawiseman.com/papers/trivia/monopoly-rents.html
House prices, https://en.wikipedia.org/wiki/List_of_London_Monopoly_locations
UK board layout, https://en.wikipedia.org/wiki/Template:London_Monopoly_board_layout
Official rules, https://en.wikibooks.org/wiki/Monopoly/Official_Rules
List of Chance cards, https://monopolyguide.com/london/monopoly-london-list-of-chance-cards/
List of Community Chest cards, https://monopolyguide.com/london/monopoly-london-list-of-community-chest-cards/
The Mathematics of Winning Monopoly (Matt Parker & Hannah Fry) https://youtu.be/ubQXz5RBBtU