Skip to content
 
 

Repository files navigation

pi_contest

Educational game to estimate Greek π using "Monte Carlo" Method.

How to use

With pip

Install requirements

pip3 install -r requirements.txt

Run

./pi_contest

With poetry

poetry is a useful Python build system and package manager. If you don't have it, you can install it with:

pip install poetry

Install requirements

poetry install

Run

poetry run ./pi_contest

With docker

Alternatively, you can build a docker container using the provided Dockerfile with:

docker build . -t pi_contest

Run

docker run -it --rm \
    -e DISPLAY=${DISPLAY} \
    --volume="${HOME}/.Xauthority:/root/.Xauthority:rw" \
    --volume=/tmp/.X11-unix:/tmp/.X11-unix \
    --device /dev/input/event13 \
    --device /dev/input/event11 \
    pi_contest

If it doesn't work, you may need to run

xhost +local:docker

How to update dependencies

Currently, the dependencies of this project are mainly managed with poetry, which is also used to generate a requirements.txt file for pip. First, regenerate the dependencies in the poetry.lock file with:

poetry update

Then, regenerate the requirements.txt file with:

poetry export -f requirements.txt -o requirements.txt

About

Educational game to estimate Greek π using "Monte Carlo" Method

Resources

Stars

2 stars

Watchers

1 watching

Forks

Contributors

Languages