Share your repls and programming experiences

← Back to all posts
Monopoly
juliomorenotos (28)

The original monopoly board game.
It still has some functionallity missing (like buying houses and hotels).
You can play with as many players as you want.
You just have to decide when to buy properties.
If any player goes broke (money < 0) the game ends.

Commentshotnewtop
GrantKeo (81)

Love it! I don't have a monopoly board at home. but can you set a limit on how many players there are (It's hard to name 123 players)

jaydah_pride (0)

This is really cool!

RyanRana (189)

Very impressive coding!

Noob_vn (7)

i can play with 999 players xD

CyanCoding (1536)

Nice work! This is a very cool game! I like that you can actually play against the computer, and the AI is very fun to watch (I had 32 players play :D). Great work!

tenyiyi123 (2)

I think you can add a mode that allow the player to play with the computer when there is only 1 player

Darklordx (5)

@juliomorenotos Maybe you could've split it up into a couple of modules (Maybe it's just me, but I like to keep my modules <200 lines), but yeah, like @Maelstrom said. It's pretty nice.
One note: the dice function is inaccurate. (i.e., a real pair of dice has 1/6 chance of rolling a 7 and a 1/36 chance of rolling a 12, but in your program all numbers have probability 1/11. I would have something like
def roll_dice(): return (random.randint(1,6),random.randint(1,6))

That way, not only do you have a realistic probability distribution but you can now also implement the roll-a-double-to-get-out-of-jail feature, the water works and electricity payment feature, etc.

I voted for you! Best of luck, darklordx

juliomorenotos (28)

@Darklordx Hello, thank you for the comment. Totally right about the roll_dice(). I already chenged it. Thanks.

Maelstrom (25)

Best thing about this is the cleanliness. Very pretty code to look at. Not very often do you get to see pretty code that works flawlessly. +1 from me!