Skip to content

Instantly share code, notes, and snippets.

@audhiaprilliant
Created April 16, 2023 15:58
Show Gist options
  • Save audhiaprilliant/6c6420c5bf39c30849cde891e955d5ae to your computer and use it in GitHub Desktop.
Save audhiaprilliant/6c6420c5bf39c30849cde891e955d5ae to your computer and use it in GitHub Desktop.
Creating a Monopoly Game Board Simulation with Python
# Update spaces
def update_space(
last_move: int,
dices: list,
data_space: dict
):
# Updated board based latest move
l_board = (data_space[last_move - 1:] + data_space[:last_move - 1])
# Current space
d_current_space = [l_board[np.sum(dices) % len(l_board)]]
return d_current_space
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment