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
Game-of-life - A simple python program to simulate and visualise the Conway's Game of life

Conway's game of life A simple python program to simulate and visualise the Conw

Dhravya Shah 3 Feb 20, 2022
A two-player strategy game played on a rectangular grid made up of smaller square cells of chocolate 🍫 or cookies 🍪

Chomp Game ©️ Chomp is a two-player strategy game played on a rectangular grid made up of smaller square cells of chocolate ?? or cookies ?? , which c

Farivar Tabatabaei 2 Feb 2, 2022
Simple python program to simulate Conway's game of life with custom variables.

ConwaysGameOfLife Simple python program to simulate Conway's game of life with custom variables. Custom Variables Grid-size : Change the size of the p

davidgasinski 1 Oct 28, 2021
A small fun project to simulate Conway's Game of Life, created in Python.

A small fun project to simulate Conway's Game of Life, created in Python. Conway's Game of Life simulates a grid of cells, where the state of each cell consists of whether the cell is alive or dead.

Harrison Verrios 1 Jun 19, 2022
Play a game of Phazed with a bot or with other players or watch bots play with each other

Phazed Game and Player play a game of Phazed with a bot or with other players or watch bots play with each other Live Demo hosted on repl.it (makes su

Xin Yu 0 Aug 28, 2021
Blender Game Engine Game Type Templates Logic Bricks (and Python script) based Game Templates for Blender

Blender-Game-Engine-Templates Blender Game Engine Game Type Templates Logic Bric

null 3 Oct 25, 2022
Mandaw 2 Mar 1, 2022
Snake game mixed with Conway's Game of Life

SnakeOfLife Snake game mixed with Conway's Game of Life The rules are the same than a normal snake game but you have to avoid cells created by Conway'

Aidan 5 May 26, 2022
Lint game data metafiles against GTA5.xsd for Rockstar's game engine (RAGE)

rage-lint Lint RAGE (only GTA5 at the moment) meta/XML files for validity based off of the GTA5.xsd generated from game code. This script accepts a se

GoatGeek 11 Sep 18, 2022
HTTP API for FGO game data. Transform the raw game data into something a bit more manageable.

FGO game data API HTTP API for FGO game data. Transform the raw game data into something a bit more manageable. View the API documentation here: https

Atlas Academy 51 Dec 26, 2022
A near-exact clone of google chrome's no internet game, or the "google dinosaur game", with some additions and extras.

dinoGame A near-exact clone of google chrome's no internet game, or the "google dinosaur game", with some additions and extras. Installation Download

null 1 Oct 26, 2021
Quantum version of the classical Nim game. An automatic opponent allows to game to not be as easy as it seems.

Nim game Running the game To run the program just launch : python3 game.py Rules This game is inspiring from the Nim game. You are 2 players face to f

Michaël 1 Jan 8, 2022
Average Clicker Game (AVG) is a Python made game using tkinter

Average-Clicker-Game Average Clicker Game (AVG) is a Python clicker game not made with pygame but with tkinter, it has worker, worker upgrades, times

Zacky2613 1 Dec 21, 2021
Ice-Walker-Game - This repository is about the Ice Walker game made in Python.

Ice-Walker-Game Ce dépot contient le jeu Ice Walker programmé en Python. Les différentes grilles du jeu sont contenues dans le sous-dossier datas. Vou

Mohamed Amine SABIL 1 Jan 2, 2022
Deal Or No Deal was a very popular game show. Even now, for a family party, it's a fun game to pass time

Deal Or No Deal was a very popular game show. Even now, for a family party, it's a fun game to pass time. I made a code to play the game right in your terminal/console. This isn't made to be a game which can be installed by everyone and played, I just made it as a fun project as I just started out with python. So if you have python installed and wanna have some fun, or just curious to see how I did this, feel free to check the code out!

null 1 Feb 15, 2022
Mastermind-Game - A game to test programming and logical skills

Bem vindo ao jogo Mastermind! O jogo consiste em adivinhar uma senha que será ge

Marcelo Daros 0 Jan 27, 2022
Quiz Game: answering questions naturally with a friendly UI to enjoy the game

About Quiz Game : The Game is about answering questions naturally with a friendl

null 4 Jan 19, 2022
This is a simple telegram bot for the game Pyal, a word guessing game inspired by Wordle

Pyal Telegram Bot This is a simple telegram bot for the game Pyal, a word guessing game inspired by Wordle. How does it work? Differently from the ori

Rafael Omiya 4 Oct 6, 2022
Adventure-Game - Adventure Game which is created using Python

Adventure Game ?? This is a Adventure Game which is created using Python. Featur

ArinjoyTheDev 1 Mar 19, 2022