A simple game of Battleship, written in Python.
This project requires Python 3.6 or newer. To prepare to work with it, pick one of these options:
Create and activate a virtual environment. This assumes python3 is already installed.
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
export PYTHONPATH=.
If you stop working on this project, close your shell, and return later, make
sure you run the source bin/venv/activate
command again.
Download and install Python 3.6 for Windows. Make sure python is on
your PATH
. Open a command prompt:
python -m venv venv
venv\Scripts\activate.bat
pip install -r requirements.txt
set PYTHONPATH=.
If you don't want to install anything Python-related on your system, you can run the game inside Docker instead.
docker build -t torpydo .
docker run -it --env PYTHONPATH=/torpydo -v ${PWD}:/torpydo torpydo bash
python -m torpydo
# alternatively:
python torpydo/battleship.py
nosetests --exe
behave
to run with coverage:
nosetests --cover-package torpydo --exe --with-coverage --cover-html
to run and store the test results for further examination (e.g. build pipeline)
nosetests --exe --with-xunit
behave --junit
Run behave tests with coverage:
https://stackoverflow.com/a/37447392/736079