Ask coding questions

← Back to all posts
Monopoly game
juliomorenotos (28)

I am triying to make the cards.py file to work, but when a player lands on a chance or community chest place, the game resets. Does anyone have a clue why?

here is the repl:
https://repl.it/@juliomorenotos/Monopoly

Thank you.

Answered by pyelias (936) [earned 5 cycles]
View Answer
Commentshotnewtop
pyelias (936)

When you import main, that re-runs the main.py file, including all your game code. To fix this, you could pass the things you need as arguments, or move card_chooser into main.py.

juliomorenotos (28)

@pyelias moved card_chooser to main.py and it works.
Thank you.