A small ludo simulator
Project description
This repository contains code to create a simple ludo simulator in Python to settle a bet between Pip and Anna.
The root folder contains this README.md
, a LICENSE.MD
file containing an open-source license, a TermsOfBet.md
file outlining the terms of the bet, an image (StandardLudoBoard.png
) containing the standard ludo board used and the positions favored by Anna and Pip for the bet, a __init__.py
file for marking this repository as a package and initializing the package when importing, a ludoSim_env.yml
file for setting a virtual environment in which to use this package, a setup.py
file for configuring this repository as a distributable package, a ClassOrganization.txt
file containing early-stage notes on source code organization, and the source code (Board.py
, Player.py
, Piece.py
) that executes when running the ludo simulator.
The analysis
folder contains code (in analysis/gameAnalysis.py
) that is used to run 10000 games of ludo in order to determine the outcome of the bet. Running the analysis/gameAnalysis.py
script to run 10000 games and display results took less than a minute on a Windows10 PC with an Intel core i5-6500 CPU with 16 GB DDR4-2133 RAM. Saved data from running that script exists in the analysis/gamesResults.out
file. The data from that file can be loaded by following the instructions at the bottom of the analysis/gameAnalysis.py
file. The analysis
folder also contains saved figures showing results from that data.
The tests
folder contains the tests/test_ludo.py
file which contains unit and integration tests for confirming the source code is functioning as expected. (These tests are to be run in the pytest package testing framework: to run these tests, follow the instructions in the runTest.py
file.)
The dist
folder contains wheel distributions for this package generated from the setup.py
file.
To run a game of ludo, navigate to the local folder where you have cloned or installed this repository, launch python, and run:
from ludoSim import *
b = Board() # look at the optional input args to set the board however you'd like
b.playGame()
Note, this package was created using the Anaconda (5.3) package manager distribution (running Python 3.7), and imports some packages native to Anaconda. For best results, download and install Anaconda, navigate to the local folder where you have cloned or installed this ludoSim repository, and in your conda terminal run:
conda activate ludoSim_env
to activate the environment with the appropriate package dependencies which were used at the time this package was created
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for ludoSim_jaib1-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0922f2ddd10bc8b5b600702ac29561bd7fb8c0e995dde45a046c4abce895873b |
|
MD5 | 862aee0b289e015b63c2005b6887ea80 |
|
BLAKE2b-256 | a0059f97793f7e0417fe6694b986d6dfbf2ab4bad25055c388db2a4d21f729ee |