Simulate a Monopoly game to generate the probabilities of landing on each square.

Overview

Monopoly-Probabilities

Simulate a Monopoly game to generate the probabilities of landing on each square.

While this project originally was inspired by Stand-up Maths from YouTube, it kind of grew into a way for me to play around with how to best share a python project. I wanted to make it easy for someone who was not a developer/not familiar with the command line, to be able to run this. Over time, this led me down a rabbit hole that has culminated in the current version of this repository. I'd love to continue to expand on this and add other ways to package up a Python project. Each approach has its pros and cons, so it is interesting (and useful) to try them out.

More README coming soon... How to use this library - TO-DO Add on other build tools - TO-DO

Comments
  • Stop using setup.py

    Stop using setup.py

    It seems that using setup.py is deprecated in favor of using either setup.cfg or pyproject.toml. As of PEP 621 you can store your project metadata in pyproject.toml, since I am basically already doing that I don't see why I shouldn't more formally use it.

    I do think I would need to keep using setup.py to build the C extension, but everything else can be moved to pyproject.toml. This should eliminate having to keep both files up to date with each other, which I already forgot about once.

    This does bring about an interesting situation. Poetry does not currently support PEP 621, so while it stores metadata in pyproject.toml, it does not yet support storing the project metadata there, in the standardized way. This isn't a total dealbreaker, as I could just manually add the info needed. But I also could migrate to something like PDM.

    There are a few thoughts I have regarding what tool to use:

    1. For a build backend, I'm going to have to use setuptools because I want to build a C extension. So even if I were to use Poetry's build backend, I would still also need setuptools...so I don't see a strong argument against simply using setuptools.
    2. For a frontend, I really like having pip in the scripts (scriptopoly and install). It is very integral in the script commands and I think for what it does, nothing more than pip is needed (and I suppose setuptools as well) Plus, it is basically included for free when setting up the virtual environment. I like having something more featureful while developing so I can have a better tool for setting up and managing dependencies. Poetry works great here, but moving forward, if it doesn't incorporate PEP 621, I would have to manually do that myself. The whole point of this is to simplify and use the approach that is going to be supported moving forward. It would seem to me I'd only be accomplishing the latter, and not even totally, with Poetry (for the time being, until it does add support for PEP 621).
    3. This is where PDM comes into play. It does dependency management like Poetry and Pipenv, but it is also PEP 621 compliant. I know I came across it a while back when it was relatively new. Now it seems to have grown and looks like it would be nice to work with. I'm kind of interested in using it just to see how it compares. Virtual Environments are also optional with that, it lets you use a different approach to dependency isolation if desired. I wouldn't need that, but it does seem interesting.

    So to sum up, for a build backend, just stick with setuptools since I have a C extension. For the frontend stick with pip in the scripts and switch to PDM for development so I can fully migrate to using pyproject.toml for storing the project metadata and dependencies in the Python blessed way. 🙏

    opened by dunkmann00 3
  • Produce a bar chart with the simulation's results

    Produce a bar chart with the simulation's results

    This will produce a bar chart with the results of the simulation. The chart is always produced as an svg image and is produced as a png image for everything except the PyOxidizer binary. There were just too many issues with getting it to work on that so it just isn't going to happen.

    opened by dunkmann00 2
  • Improve handling of Keyboard Interrupts

    Improve handling of Keyboard Interrupts

    This improves handling of keyboard interrupts in the C extension by explicitly checking for any queued signals. It also changes the text output to indicate the simulation was cancelled.

    opened by dunkmann00 1
  • Always make BUILD_DISTPATH a posix path

    Always make BUILD_DISTPATH a posix path

    After action-gh-release was updated globs are handled differently. This is because the glob library it uses was updated. The updated glob library always interprets backslashes as escape characters. This means if BUILD_DISTPATH has backslashes in it, action-gh-release won't match it correctly and won't upload our archives. To fix this, we can make sure to always use a posix path.

    opened by dunkmann00 1
  • Add code signing & notarization to GitHub Actions macOS build

    Add code signing & notarization to GitHub Actions macOS build

    This adds code signing and notarization to the Github Actions release workflow for macOS builds. This required a few changes to script.py as well. The actual signing is all handled in the script, while adding the certificate and notarization are handled in the release workflow.

    Closes #33

    opened by dunkmann00 1
  • Get Nuitka working on Windows

    Get Nuitka working on Windows

    With this pull request the Nuitka built binary builds on Windows, woohoo!

    There were two problems:

    1. The output filename needed to have the .exe extension.
    2. The directories for the output file path needed to exist.

    The other changes in this pull request are related to upgrading the version of Nuitka

    opened by dunkmann00 1
  • Improve status indicator on Windows

    Improve status indicator on Windows

    This improves the status indicator on Windows by using a custom class to handle rendering. Using rich created a blinking effect across the whole line while the bouncing bars appeared to skip quite a lot. Not very nice looking. This takes a different approach and brings back much of the old Spinner code, while updating it to only handle Windows, and also using the internals of rich to still create nice looking styles.

    opened by dunkmann00 0
  • Setup GitHub Pages

    Setup GitHub Pages

    Only include the README.md and title-image.png in the site build. For now, all settings can just be configured with the default ones GH pages uses when there is no config.

    This was working fine, until it stopped actually building the README.md and now the css is not getting loaded...I think I may merge this and see what happens.

    opened by dunkmann00 0
  • Fix Keyboard Interrupts Windows

    Fix Keyboard Interrupts Windows

    It seems that even though I had gotten the keyboard interrupts working on macOS, they still didn't want to work on Windows when ran in multi-core mode. This change fixes that problem by switching to starmap_async and then manually looping and sleeping until it is ready. This seems to give the interrupts a chance to be processed on Windows while also not adding a performance penalty.

    I also tested this on my Mac and the same was true. I won't bother adding a conditional check to only do it this way on Windows since it seems to not have any negative effects on macOS.

    opened by dunkmann00 0
  • Revert

    Revert "Let PyOxidizer handle multiprocessing on its own"

    Reverts dunkmann00/Monopoly-Probabilities#50

    After giving this a test on Windows (which I should have done before merging...) this still doesn't work. Reverting for now.

    opened by dunkmann00 0
  • Add 'Rich' text to monopoly's text output

    Add 'Rich' text to monopoly's text output

    This adds the Rich package to get nicer looking text output in the terminal. Rich also comes with a spinner so the Spinner from utils is no longer needed.

    This also required adding a hash to PyGal's requirements-runtime.txt entry because of how pip handles hashes. If one requirement has it, they all must. In the process of doing this I ended up building a wheel of the PyGal patch so that is what is now used to install PyGal. In the end, this is probably an improvement.

    Closes #43

    opened by dunkmann00 0
  • Enhancement: Add visual output from running simulation

    Enhancement: Add visual output from running simulation

    Currently a text and csv file are produced as results from the simulation. I would like to add a visual output like a bar graph and maybe an image of a heat-map over a basic version of the board outline.

    • [X] Bar Chart (#42)
    • [ ] Board Heat Map
    opened by dunkmann00 0
  • Nuitka binary doesn't work with multiprocessing

    Nuitka binary doesn't work with multiprocessing

    Not sure exactly why this is, but when I try to run the Nuitka binary with multiple cores using multiprocessing it doesn't work. When built in onefile mode it just dies after you try to run it. With standalone mode it sometimes spits out a segmentation fault, and other times it seems to run but error at the end with the following:

    /resource_tracker.py:96: UserWarning: resource_tracker: process died unexpectedly, relaunching.  Some resources might leak.
    

    So for now I have just disabled multi-core support for the Nuitka build.

    If a user wants to try multi-core mode despite the current problems, they can set the environment variable FORCE_NUITKA_MULTI when running monopoly and it will force it to run in multi-core mode.

    opened by dunkmann00 0
Releases(0.3.0)
  • 0.3.0(Dec 3, 2022)

    What's Changed

    • Update readme by @dunkmann00 in https://github.com/dunkmann00/Monopoly-Probabilities/pull/36
    • Add code signing & notarization to GitHub Actions macOS build by @dunkmann00 in https://github.com/dunkmann00/Monopoly-Probabilities/pull/35
    • Script work by @dunkmann00 in https://github.com/dunkmann00/Monopoly-Probabilities/pull/38
    • Upload binaries as artifacts by @dunkmann00 in https://github.com/dunkmann00/Monopoly-Probabilities/pull/39
    • Always make BUILD_DISTPATH a posix path by @dunkmann00 in https://github.com/dunkmann00/Monopoly-Probabilities/pull/40
    • Produce a bar chart with the simulation's results by @dunkmann00 in https://github.com/dunkmann00/Monopoly-Probabilities/pull/42
    • Refactor saving results code by @dunkmann00 in https://github.com/dunkmann00/Monopoly-Probabilities/pull/44
    • Remove cairosvg, don't render pngs by @dunkmann00 in https://github.com/dunkmann00/Monopoly-Probabilities/pull/45
    • Improving dependency managament by @dunkmann00 in https://github.com/dunkmann00/Monopoly-Probabilities/pull/46
    • Add 'Rich' text to monopoly's text output by @dunkmann00 in https://github.com/dunkmann00/Monopoly-Probabilities/pull/48
    • Downgrade PyOxidizer by @dunkmann00 in https://github.com/dunkmann00/Monopoly-Probabilities/pull/49
    • Let PyOxidizer handle multiprocessing on its own by @dunkmann00 in https://github.com/dunkmann00/Monopoly-Probabilities/pull/50
    • Add title-image to README by @dunkmann00 in https://github.com/dunkmann00/Monopoly-Probabilities/pull/51
    • Bump to 0.3.0 by @dunkmann00 in https://github.com/dunkmann00/Monopoly-Probabilities/pull/52
    • Revert "Let PyOxidizer handle multiprocessing on its own" by @dunkmann00 in https://github.com/dunkmann00/Monopoly-Probabilities/pull/53

    Full Changelog: https://github.com/dunkmann00/Monopoly-Probabilities/compare/0.2.0...0.3.0

    Source code(tar.gz)
    Source code(zip)
    monopoly-0.3.0-linux-x86_64.tar.gz(66.55 MB)
    monopoly-0.3.0-macosx-10.15-x86_64.tar.gz(39.56 MB)
    monopoly-0.3.0-win-amd64.zip(38.11 MB)
  • 0.2.0(Oct 28, 2022)

    Initial release of Monopoly Probabilities. This release includes the binaries to run the simulation on Mac, Windows, & Linux. The binaries included are built with PyInstaller, PyOxidizer, and Nuitka.

    What's Changed

    • Use python for script file by @dunkmann00 in https://github.com/dunkmann00/Monopoly-Probabilities/pull/2
    • Improve build system by @dunkmann00 in https://github.com/dunkmann00/Monopoly-Probabilities/pull/3
    • Fix pyoxidizer multiprocessing on Windows by @dunkmann00 in https://github.com/dunkmann00/Monopoly-Probabilities/pull/4
    • Get Nuitka working on Windows by @dunkmann00 in https://github.com/dunkmann00/Monopoly-Probabilities/pull/5
    • Add .so and .pyd files to BUILD_ARTIFACTS by @dunkmann00 in https://github.com/dunkmann00/Monopoly-Probabilities/pull/6
    • Fix scriptopoly command by @dunkmann00 in https://github.com/dunkmann00/Monopoly-Probabilities/pull/8
    • Bump dependencies by @dunkmann00 in https://github.com/dunkmann00/Monopoly-Probabilities/pull/9
    • Have subprocess output string instead of bytes by @dunkmann00 in https://github.com/dunkmann00/Monopoly-Probabilities/pull/10
    • Add release.yml GH action by @dunkmann00 in https://github.com/dunkmann00/Monopoly-Probabilities/pull/11
    • Fix release.yml errors by @dunkmann00 in https://github.com/dunkmann00/Monopoly-Probabilities/pull/12 https://github.com/dunkmann00/Monopoly-Probabilities/pull/13 https://github.com/dunkmann00/Monopoly-Probabilities/pull/14 https://github.com/dunkmann00/Monopoly-Probabilities/pull/15 https://github.com/dunkmann00/Monopoly-Probabilities/pull/16 https://github.com/dunkmann00/Monopoly-Probabilities/pull/17 https://github.com/dunkmann00/Monopoly-Probabilities/pull/18 https://github.com/dunkmann00/Monopoly-Probabilities/pull/19 https://github.com/dunkmann00/Monopoly-Probabilities/pull/20 https://github.com/dunkmann00/Monopoly-Probabilities/pull/21 https://github.com/dunkmann00/Monopoly-Probabilities/pull/22 https://github.com/dunkmann00/Monopoly-Probabilities/pull/23 https://github.com/dunkmann00/Monopoly-Probabilities/pull/24 https://github.com/dunkmann00/Monopoly-Probabilities/pull/25 https://github.com/dunkmann00/Monopoly-Probabilities/pull/26 https://github.com/dunkmann00/Monopoly-Probabilities/pull/29 (If there is a better way to debug this I would love to hear about it...)
    • Add archive-binaries command to script by @dunkmann00 in https://github.com/dunkmann00/Monopoly-Probabilities/pull/27
    • Use simple tag name in BUILD_DISTPATH by @dunkmann00 in https://github.com/dunkmann00/Monopoly-Probabilities/pull/28
    • Add to requirements-binaries.txt by @dunkmann00 in https://github.com/dunkmann00/Monopoly-Probabilities/pull/30
    • Bump project version by @dunkmann00 in https://github.com/dunkmann00/Monopoly-Probabilities/pull/31
    • Fix distpath handling with PyInstaller by @dunkmann00 in https://github.com/dunkmann00/Monopoly-Probabilities/pull/32

    New Contributors

    • @dunkmann00 made their first contribution in https://github.com/dunkmann00/Monopoly-Probabilities/pull/2

    Full Changelog: https://github.com/dunkmann00/Monopoly-Probabilities/commits/0.2.0

    Source code(tar.gz)
    Source code(zip)
    monopoly-0.2.0-linux-x86_64.tar.gz(58.05 MB)
    monopoly-0.2.0-macosx-10.15-x86_64.tar.gz(30.39 MB)
    monopoly-0.2.0-win-amd64.zip(30.74 MB)
Owner
George Waters
George Waters
Pygame Raycaster made by me.

Pygame Raycaster made by me.

Sable 0 Jan 10, 2022
Editing tool (read/write) .sc files (*_tes.sc , *.sc, *_dl.sc ) from Supercell games (Brawl Stars, Clash Royale, Clash of Clans and others).

SupercellSWF Version 0.1.0.2 About Editing tool (read/write) .sc files (*_tes.sc , *.sc, *_dl.sc ) from Supercell games (Brawl Stars, Clash Royale, Cl

Fred31 11 Jun 23, 2022
Netskrafl - an Icelandic crossword game website

Netskrafl - an Icelandic crossword game website English summary This repository contains the implementation of an Icelandic crossword game in the genr

Miðeind ehf 30 May 09, 2022
Chess - A python gui application

Chess Python version 3.10 or greater is required to play. Note This is a gui application, and as such will not run inside WSL.

Jonxslays 1 Dec 16, 2021
Deep Running

Deep Running 1. Install $ pip install --user deep_running 2. Lap N Lap. Name Remarks Citation Meta 1 Mario Deeeeeep Running I was born to run. dannyso

karaage 69 Jan 31, 2022
A Street Fighter game in Pygame

What is Street Fighter? Street Fighter, commonly abbreviated as SF or スト, is a Japanese competitive fighting video game franchise developed and publis

Sameer Sahu 3 Aug 20, 2022
This is a simple Tic-Tac-Toe game.

Tic-Tac-Toe Nosso famoso e tradicional Jogo da Velha, mas agora em Python. Development setup Para rodar o programa, basta instalar python em sua maqui

João Assalim 1 Oct 10, 2022
uses Entropy to find the best next guess for Wordle, given the color clues

WordleSolver uses Entropy to find the best next guess for Wordle, given the color clues use player.py and enter in the string for the suggested clue w

Steve Earth 1 Jan 26, 2022
A rhythm-based game that automatically generates obstacles based on a song's features.

DISCLAIMER: This is my first coding project, created in December 2019. The game may not be optimized, and looking back on it, there are a lot of chang

Kenneth Huang 1 Dec 27, 2021
Wordle Tas Tool is a terminal application for solving Wordle puzzles

Wordle Tas Tool Terminal application for solving Wordle puzzles Wordle Tas Tool (WTT) is a Python script that iterates over SCOWL95 to solve Wordle pu

1 Feb 08, 2022
A small, Pygame-based library project intended for personal use.

EzyGame Version 0.0.1 A simple library project intended for personal use with Pygame. Warning: I am a very amateur programmer, so the code will probab

Dorbell 1 Jan 08, 2022
Running Chess Night results tabulation

Running Chess Night results tabulation

Mitch LeBlanc 2 Nov 20, 2021
j-chess implementation in python

j-chess-client-python This repository aims to be a starting point for implementing a chess ai for the j-chess-server in python. To start, you can copy

Jonas 1 Dec 25, 2021
SuperChess is a GUI application for playing chess.

About SuperChess is a GUI application for playing chess. It is written in Python 3.10 programming language, uses PySide6 GUI library, python-chess lib

Boštjan Mejak 1 Oct 16, 2022
Among AIs is a (prototype of) PC Game we developed as part of the Smart Applications course @ University of Pisa.

Among AIs is a PC Game we developed as part of the Smart Applications course @ Department of Computer Science of University of Pisa, under t

Gabriele Pisciotta 5 Dec 05, 2021
An algorithm to reach a correlated equilibrium in multiplayer games.

Correlatedpy: a python library for distributed learning of correlated equilibrium in multiplayer strategic games. View Demo · Report Bug · Request Fea

Omar Boufous 2 Feb 01, 2022
BitBot - A simple shooter game

BitBot BitBot - A simple shooter game This project can be discontinued anytime I want, as it is not a "MAJOR" project for me. Which Game Engine does i

whmsft 1 Jan 04, 2022
Python codes for the classic Hang Man game

Python codes for the classic Hang Man game. The user will be assigned a random word to guess, one character at a time. If the user gets everything right, the program says Well Done!, but if the user

p.katekomol 1 Jan 25, 2022
Flappy Bird clone utilizing facial recognition to move the

Flappy Face Flappy Bird clone utilizing facial recognition to move the "bird" How it works Flappy Face uses Facial Recognition to detect your face's p

Brady McDermott 1 Jan 11, 2022
Guess The Random Number - A sample Random Number Guessing Game Python Program

Guess_The_Random_Number This repo contains a simple "Random Number Guessing Game

Pramod Kumar 3 Feb 09, 2022