Created
April 16, 2023 15:58
-
-
Save audhiaprilliant/6c6420c5bf39c30849cde891e955d5ae to your computer and use it in GitHub Desktop.
Creating a Monopoly Game Board Simulation with Python
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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