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
Practice the use of the random library to get the user guess the result.

Guessing Game Practice the use of the random library to get the user guess the result. Additional description about the project and its features. Buil

Herbert Orellana 1 Dec 13, 2021
A Neural Network based chess engine and GUI made with Python and Tensorflow/Keras.

Haxaw-Chess Haxaw: Haxaw is the Neural Network based chess engine made with Python and Tensorflow/Keras. Also uses the python-chess library. (WIP: Imp

Sarthak Bharadwaj 8 Dec 10, 2022
Bingo game now in python play as much you want :) no need to give me credit it's open as fuck

Bingo-py-game A game coded with Python Introduction This is a Terminal-based game currently in its initial stage. I am working on adding more efficien

Frey 5 Aug 12, 2021
Multiple hacks that breaks the game

Blooket-Hack All of the cheats are based on a game mode.

glizzz_y 484 Feb 25, 2022
A Pygame game made in 48 hours

Flappuccino Flappuccino is a game created in 48 hours for the PyGame Community New Years Jam using Python with Pygame. Screenshots Background Informat

PolyMars 242 Jan 02, 2023
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 w

1 Feb 15, 2022
For educational purposes, a simple script that assists in solving the word game Wordle.

WordleSolver For educational purposes, a simple script that assists in solving the word game Wordle. Instructions Pick your first word from the sugges

Christian De Leon 2 Mar 25, 2022
Minecraft Script to Tellraw Datapack Generator

Minecraft Script to Tellraw Datapack Geneator (STDG) can generate a chain of tellraw command in datapack from script.

1 Jan 28, 2022
A minecraft bedrock server software written in python (3.X)

Podrum README also available in: English 🇺🇸 Français 🇫🇷 Deutsch 🇩🇪 Español 🇪🇸 Tiếng Việt 🇻🇳 Italiana 🇮🇹 Русский 🇷🇺 中文 🇨🇳 Is a Minecraf

Podrum 53 Nov 11, 2022
Bingo game with python

bingo-game-with-python type of plays possible player vs computer player vs player computer vs computer game is built with 4 objects classes 1.game 2.b

1 Nov 27, 2021
A Game of Life implementation in Python

Game of Life in Python (Golipy) Golipy is a simulator of John H. Conway's Game of Life, developed in Python based on the Pygame library. This is a toy

Alber 2 Dec 10, 2021
Useful guides, tutorials, and FAQs related to LEGO Universe and Darkflame Universe.

Awesome Lego Universe A curated list of awesome things related to LEGO Universe. LEGO Universe was a kid-friendly massively-multiplayer online role pl

Eric Myllyoja 33 Dec 12, 2022
A shooter game.

Screenshots Installation GNU/Linux Go to the Releases tab. Download InfiniteShooter.flatpak from the latest version of InfiniteShooter Open the termin

PastThePixels 13 Dec 01, 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
This is a simple game made using pygame.

Ball breaker This is a simple game made using pygame game view The game view have been updated wait for the new view to be uploaded Game_show.mp4 Lear

Rishikesh Kumar 3 Nov 05, 2021
Building a Mario-like, classic platformer game in Python using the PyGame Library

Building a Mario-like, classic platformer game in Python using the PyGame Library

Clarence Vinzcent Reyes 1 Feb 06, 2022
XO game with server, client and visualizer for AI bots.

XO game with server, client and visualizer for AI bots.

Ali 4 Jul 14, 2022
What games should I design next quarter?

Project1_Next-Quarter-Game-Design-Prediction What games should I design next quarter? 상황 : 게임회사 데이터팀 합류 문제 : '다음 분기에 어떤 게임을 설계해야할까' Data Description N

Jayden Lee(JaeHo Lee) 1 Jul 04, 2022
Disables the chat in League of Legends for Windows.

Disables the chat in League of Legends for Windows. If you simply can't stop yourself from typing LeagueStop will play KEKW.mp3 each time you try. The sound will stack & becomes horribly annoying.

1 Nov 24, 2021
Flappy bird using Pygames

flappy-bird Esse é um jogo que eu fiz utilizando a biblioteca de jogos do Python

Leandro Henrique 2 Jan 05, 2022