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
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
Utility.py - a utility that offerres cool cli tools and games.

Utilty.py Utility.py is a utility that offerres cool cli tools and games. Currently the offerd games/items are: get the number, countdown, random name

bee-micizi 1 Dec 08, 2021
Lutris desktop client in Python / PyGObject

Lutris Lutris is an open source gaming platform that makes gaming on Linux easier by managing, installing and providing optimal settings for games. Lu

Lutris 6.1k Dec 30, 2022
Automatically prepare your Minecraft maps for release

map-prepare Automatically prepare Mineraft map for release. Current state: kinda works Make sure you have backups for your world before running this p

11 Oct 11, 2022
Termordle - a terminal based wordle clone in python

Termordle - a terminal based wordle clone in python

2 Feb 08, 2022
Cheats for shooter games

Cheats Cheats for shooter games Download Trigger Bot trigger.exe // trigger.sha256 Download Certify Bot certify.exe // certify.sha256 Note: Check sha2

Emin Muhammadi 1 Nov 26, 2021
The DOS game from the 80s re-written in Python from Scratch!

Drugwars The DOS game from the 80s re-written in Python from Scratch! Play in your browser Here Installation Recommended: Using pip pip3 install drugw

Max Bridgland 45 Jan 03, 2023
AI based assitant for minecarft

Minecraft_AI_assistant AI-based assistant for Minecraft There are 4 steps to build 1-I'm using collecting_data.png as a structure to take shots with c

Murat Ali Avcu 13 Oct 16, 2022
Multi minecraft server helper for python

呐 Yuki 您的群组服操作小助手。 使用Python3编写。使用 .yaml 配置文件记录子服,配合Screen管理Linux系统上的Minecraft子服,支持MCDR子服与非MCDR子服。 功能: 开启所有子服 关闭所有子服 重载所有子服MCDR 重载所有子服ChatBridge 使用方法:

3 Mar 17, 2022
Ghdl-interactive-sim - Interactive GHDL simulation of a VHDL adder using Python, Cocotb, and pygame

GHDL Interactive Simulation This is an interactive test bench for a simple VHDL adder. It uses GHDL to elaborate/run the simulation. It is coded in Py

Chuck Benedict 2 Aug 11, 2022
An implementation of John Conway's Game of Life.

This is an implementation of John Conway's Game of Life in Python, and a very basic and straightforward one at that.

Mae 3 Feb 11, 2022
This is a good project to train your logic game with python language

JO-KEN-PÔ!!! | Description | basic. I make this game only to train. This is a good project to train your logic game with python language. This game is

Elianderson Silva 1 Jan 24, 2022
Solo CLF project about the creation of the FlickColor game in Python with very precise instructions.

Solo CLF project about the creation of the FlickColor game in Python with very precise instructions.

COZAX 1 Dec 09, 2022
Pyout - A little Krakout clone called Pyout written in Python 3

Pyout My little Krakout clone called Pyout written in Python 3

Jan Karger ツ ☀ 4 Feb 20, 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
My first Minecraft CPU. Created in collaboration with Peer Carnes as a final project in CS 281: Architecture and Assembly at the University of Puget Sound

Minecraft CPU This is my first ever Minecraft CPU, created in collaboration with Peer Carnes. We created a custom assembly language, including an asse

Andy Chamberlain 4 Oct 10, 2022
Chess GUI

Lucas Chess Lucas Chess is a GUI of chess: To learn to play chess. To play chess against engines. Dependencies Python 2.7 PyQt4 PyAudio psutil Python

Lucas 322 Dec 20, 2022
This is a repository created to run a workshop on Game Theory using the programming language Python and more specifically an open-source software called the Axelrod Python library

Game-Theory-and-Python This is a repository created to run a workshop on Game Theory using the programming language Python and more specifically an op

Nikoleta Glynatsi 136 Dec 01, 2022
A pure python implementation of a solver for the popular game wordle.

A pure python implementation of a solver for the popular game wordle.

1 Oct 06, 2022
Atari2600 Training / Evaluation with RLlib

Training Atari2600 by Reinforcement Learning Train Atari2600 and check how it works! How to Setup You can setup packages on your local env. $ make set

Jinwoo Park (Curt) 1 Dec 12, 2021