-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Alexander Gusakov
committed
Jul 22, 2020
0 parents
commit 567cacc
Showing
31 changed files
with
3,300 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,129 @@ | ||
# Byte-compiled / optimized / DLL files | ||
__pycache__/ | ||
*.py[cod] | ||
*$py.class | ||
|
||
# C extensions | ||
*.so | ||
|
||
# Distribution / packaging | ||
.Python | ||
build/ | ||
develop-eggs/ | ||
dist/ | ||
downloads/ | ||
eggs/ | ||
.eggs/ | ||
lib/ | ||
lib64/ | ||
parts/ | ||
sdist/ | ||
var/ | ||
wheels/ | ||
pip-wheel-metadata/ | ||
share/python-wheels/ | ||
*.egg-info/ | ||
.installed.cfg | ||
*.egg | ||
MANIFEST | ||
|
||
# PyInstaller | ||
# Usually these files are written by a python script from a template | ||
# before PyInstaller builds the exe, so as to inject date/other infos into it. | ||
*.manifest | ||
*.spec | ||
|
||
# Installer logs | ||
pip-log.txt | ||
pip-delete-this-directory.txt | ||
|
||
# Unit test / coverage reports | ||
htmlcov/ | ||
.tox/ | ||
.nox/ | ||
.coverage | ||
.coverage.* | ||
.cache | ||
nosetests.xml | ||
coverage.xml | ||
*.cover | ||
*.py,cover | ||
.hypothesis/ | ||
.pytest_cache/ | ||
|
||
# Translations | ||
*.mo | ||
*.pot | ||
|
||
# Django stuff: | ||
*.log | ||
local_settings.py | ||
db.sqlite3 | ||
db.sqlite3-journal | ||
|
||
# Flask stuff: | ||
instance/ | ||
.webassets-cache | ||
|
||
# Scrapy stuff: | ||
.scrapy | ||
|
||
# Sphinx documentation | ||
docs/_build/ | ||
|
||
# PyBuilder | ||
target/ | ||
|
||
# Jupyter Notebook | ||
.ipynb_checkpoints | ||
|
||
# IPython | ||
profile_default/ | ||
ipython_config.py | ||
|
||
# pyenv | ||
.python-version | ||
|
||
# pipenv | ||
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. | ||
# However, in case of collaboration, if having platform-specific dependencies or dependencies | ||
# having no cross-platform support, pipenv may install dependencies that don't work, or not | ||
# install all needed dependencies. | ||
#Pipfile.lock | ||
|
||
# PEP 582; used by e.g. github.com/David-OConnor/pyflow | ||
__pypackages__/ | ||
|
||
# Celery stuff | ||
celerybeat-schedule | ||
celerybeat.pid | ||
|
||
# SageMath parsed files | ||
*.sage.py | ||
|
||
# Environments | ||
.env | ||
.venv | ||
env/ | ||
venv/ | ||
ENV/ | ||
env.bak/ | ||
venv.bak/ | ||
|
||
# Spyder project settings | ||
.spyderproject | ||
.spyproject | ||
|
||
# Rope project settings | ||
.ropeproject | ||
|
||
# mkdocs documentation | ||
/site | ||
|
||
# mypy | ||
.mypy_cache/ | ||
.dmypy.json | ||
dmypy.json | ||
|
||
# Pyre type checker | ||
.pyre/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
language: python | ||
|
||
dist: bionic | ||
|
||
python: | ||
- "3.8" | ||
|
||
install: | ||
- pip install poetry | ||
- poetry install | ||
|
||
script: | ||
- pytest -s | ||
- flake8 snake_project | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2020 Alexander Gusakov | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
``` | ||
:'######::'##::: ##::::'###::::'##:::'##:'########:::::::'##::::'#######::'########::'#######:: | ||
'##... ##: ###:: ##:::'## ##::: ##::'##:: ##.....::::::'####:::'##.... ##: ##.. ##:'##.... ##: | ||
##:::..:: ####: ##::'##:. ##:: ##:'##::: ##:::::::::::.. ##::: ##:::: ##:..:: ##::: ##::::..:: | ||
. ######:: ## ## ##:'##:::. ##: #####:::: ######::::::::: ##:::: ########:::: ##:::: ########:: | ||
:..... ##: ##. ####: #########: ##. ##::: ##...:::::::::: ##::::...... ##::: ##::::: ##.... ##: | ||
'##::: ##: ##:. ###: ##.... ##: ##:. ##:: ##::::::::::::: ##:::'##:::: ##::: ##::::: ##:::: ##: | ||
. ######:: ##::. ##: ##:::: ##: ##::. ##: ########:::::'######:. #######:::: ##:::::. #######:: | ||
:......:::..::::..::..:::::..::..::::..::........::::::......:::.......:::::..:::::::.......::: | ||
``` | ||
|
||
[![Build Status](https://travis-ci.org/GonnaFlyMethod/snake1976.svg?branch=master)](https://travis-ci.org/github/GonnaFlyMethod/snake1976) | ||
[![flake8 Status](https://img.shields.io/badge/flake8-enabled-green)](https://github.com/GonnaFlyMethod/snake1976/blob/master/setup.cfg) | ||
[![Supporting OS](https://img.shields.io/badge/OS-Linux%20%7C%20Windows-blue)](https://github.com/GonnaFlyMethod/snake1976) | ||
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/GonnaFlyMethod/snake1976/blob/master/LICENSE) | ||
[![Join the chat at https://gitter.im/snake1976/community](https://badges.gitter.im/snake1976/community.svg)](https://gitter.im/snake1976/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) | ||
|
||
--- | ||
|
||
Snake 1976 is a console game that follows the logic of the classic snake.The game also contains some new game modes and features. Enjoy the game! :snake: | ||
|
||
## Getting Started | ||
|
||
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. | ||
|
||
## Requirements | ||
|
||
``` | ||
Python (3.8), pip, poetry | ||
``` | ||
|
||
## Installing | ||
|
||
### Clone the project to your local machine | ||
|
||
``` | ||
git clone https://github.com/GonnaFlyMethod/snake1976 | ||
``` | ||
|
||
### Install poetry | ||
|
||
``` | ||
pip install poetry | ||
``` | ||
|
||
### Install all dependencies | ||
|
||
You need to get to the directory with project 'snake1976' and then write in the console: | ||
|
||
``` | ||
poetry install | ||
``` | ||
### Install flake8 pre-commit hook | ||
|
||
``` | ||
flake8 --install-hook git | ||
git config --bool flake8.strict true | ||
``` | ||
Now flake8 will respond to each of your commits. It's necessary to make your code cleaner. | ||
If you see errors then make sure that you write these commands while you are in 'snake1976' folder. | ||
|
||
## Running the game | ||
|
||
You should be in the 'snake_project' folder, then the game can be started: | ||
|
||
``` | ||
python snake_game.py | ||
``` | ||
|
||
## Before commit | ||
|
||
### Delete your game results | ||
|
||
Before commit you need to make sure that there are 3 files in the 'records' folder and they are all empty: | ||
|
||
``` | ||
snake_project/extra/game_environment/score_files/records/date_n_time.txt | ||
snake_project/extra/game_environment/score_files/records/players.txt | ||
snake_project/extra/game_environment/score_files/records/scores.txt | ||
``` | ||
|
||
These files were generated in order to store player's name, his score, date and time when he played. | ||
Of course, if you wanna save your results before removal then you can copy them to another place on you PC. | ||
|
||
### Running the tests | ||
|
||
When you get to the directory 'snake1976' just run the command: | ||
|
||
``` | ||
pytest -s | ||
``` | ||
|
||
## Authors | ||
|
||
* **Alexander Gusakov** - *Initial work* - [GonnaFlyMethod](https://github.com/GonnaFlyMethod) | ||
|
||
See also the list of [contributors](https://github.com/GonnaFlyMethod/snake1976-win/graphs/contributors/) who participated in this project. | ||
|
||
## License | ||
|
||
This project is licensed under the MIT License - see the [LICENSE.md](https://github.com/GonnaFlyMethod/snake1976-win/blob/master/LICENSE) file for details |
Oops, something went wrong.