Didn't know if you wanted to try to adapt this to C++ (or otherwise to work with it any longer). I took a look at the code and noticed a significant error which means that 10000-move games are much rarer than we thought before, but it's still true that Phil is several times more likely to win than you are. d # This is a Maple script to simulate an endgame scenario in Monopoly. # Tell Maple to shut up during garbage collection: kernelopts(printbytes=false): # Some data arrays: who:=[1,2]: # 1 = Nicholas, 2 = Phil; 0 = no owner, -1 = CC, -2 = Chance balance:=array[1..2]: pos:=array[1..2]: owner:=[0, 2, -1, 2, 0, 1, 2, -2, 2, 2, 0, 2, 1, 2, 2, 1, 1, -1, 1, 1, 0, 2, -2, 2, 2, 1, 2, 2, 1, 2, 0, 1, 1, -1, 1, 1, -2, 1, 0, 1]: rent:=[0, 30, 0, 60, 0, 200, 550, 0, 550, 600, 0, 750, 0, 750, 900, 200, 200, 0, 550, 600, 0, 875, 0, 875, 925, 200, 975, 1150, 0, 1200, 0, 1100, 1275, 0, 1400, 200, 0, 1500, 0, 2000]: # Now run the simulation. # We will play the game 100 times and keep track of the outcomes. outcome:=array[1..100]: for exper_number from 1 to 100 do # Here's where we begin each of these 100 games. # Starting data: balance[1]:=5000: balance[2]:=5000: pos[1]:=1: pos[2]:=1: movenumber:=1: # I thought I'd keep track of the intermediate balances during the game. # (Not really necessary.) keep:=[]: while balance[1]>0 and balance[2]>0 and movenumber < 10000 do # OK, here is a pair of moves, one per player. movenumber:=movenumber + 1: for player in who do otherguy:= 3 - player: r1:=ceil(rand()/10^12 * 6); r2:=ceil(rand()/10^12 * 6); r:=r1+r2: pos[player]:=pos[player] + r: if pos[player]>40 then pos[player]:=pos[player]-40: balance[player]:=balance[player] + 200: fi: if owner[ pos[player] ] = otherguy then topay:=rent[ pos[player] ]: balance[player]:=balance[player] - topay: balance[otherguy]:=balance[otherguy] + topay: fi: if pos[player]= 5 then balance[player]:=balance[player] - 200: fi: if pos[player]=39 then balance[player]:=balance[player] - 75: fi: if pos[player]=31 then pos[player]:=11: balance[player]:=balance[player] - 50: fi: # assuming always buy out of jail # utilities are mortgaged # ignore chance, community chest od: # both players have now moved. if (movenumber mod 100)= 0 then keep:=[ op(keep), [balance[1],balance[2]]]:fi: od: # Game over: either 20000 moves or someone is broke. Record outcome: outcome[exper_number]:=[ movenumber, balance[1], balance[2] ]: print(exper_number): od: # End of simulation # After the simulation is over, let's find out who won and how often. nwins:=0: pwins:=0: nowins:=0: for i to 100 do run:=outcome[i]: if run[1]=10000 then nowins:=nowins+1: elif run[2]<=0 then pwins:=pwins+1: elif run[3]<=0 then nwins:=nwins+1: else print(`Huh?`, run): fi: od: nwins, pwins, nowins; # We can also plot the two fortunes over time during one game: plot({[seq([i,keep[i][1]], i=1..nops(keep))],[seq([i,keep[i][2]], i=1..nops(keep))]});