In my analysis I didn't draw the board; store the names of the sites; maintain any money for site prices or rents; only each location's popularity is important. Without money, cards only redirect the player's position and Community Chest is just a subset of Chance. Finally, we get out of jail immediately, but I ignored going to Jail by rolling three doubles.
This means the simulation is pretty simple:
- We need an array of 40 locations to hold popularities.
- We need to simulate two dice for moving parts: the sum of two random numbers 1..6.
- We need to redirect the locations if we land on one of the 3 Chance or 3 Community Chest locations or Goto Jail.
- The redirect locations are: 0 (GO), 10 (Jail), 11 (Pall Mall), 15 (Marlebone stations), 24 (Trafalgar Square), 39 (Mayfair) or back 3 spaces, but Community Chest is limited to the first two.
- We could calculate going to jail if the last 3 rolls are doubles and this would mean an extra jail visit every 1/216 throws on average. Getting out of jail by throwing a double wouldn't affect results because the throw only puts the player into the 'just visiting' location and thus doesn't affect where they land after leaving jail.
- Periodically we should display the current popularities.
It takes about 1 hour to run the simulation in slow mode, printing out an update every 84s. Running it in fast mode would take about 15 minutes and would stop when Just Visiting Jail had been hit 256 times (because the count is held as byte values in a string array).
You can find out more details and the amazing results (which I've excluded here for the thrill of the suspense) from my wondrous blog entry.. at: https://oneweekwonder.blogspot.com/2019 ... y-sim.html