{ "info": { "author": "Kartikei Mittal", "author_email": "kartikeimittal@gmail.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "# Connect-N\n\n![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)\n[![Build Status](https://travis-ci.org/Kartikei-12/Connect-N.svg?branch=master)](https://travis-ci.org/Kartikei-12/Connect-N)\n[![Codacy Badge](https://api.codacy.com/project/badge/Grade/4a053ff3c19247958b88183242723d23)](https://www.codacy.com/app/Kartikei-12/Connect-N?utm_source=github.com&utm_medium=referral&utm_content=Kartikei-12/Connect-N&utm_campaign=Badge_Grade)\n![Codecov](https://img.shields.io/codecov/c/github/Kartikei-12/Connect-N.svg)\n![Code Style](https://img.shields.io/badge/code%20style-black-000000.svg)\n
\n\n## Introduction\n\nA simple modified version of Connect Four Game implemented with AI in Python using PyGame.\n\n## Project Description\n\n* This repositry contains a simple game made in **python** similar to **Connect 4**.\n* A bit modified to work with any connect length for any board size.\n* Currently supports for variable number of players on a two dimentional board.\n* Only **three** players supported in GUI mode.\n* For more players add new colours `COLOR` variable in connect_n/pygame_utility.py file.\n* ID 1 is reserved for AI.\n* Currently only supports single AI player in a game.\n* Tests in python 3.7 on Windows OS(by developer).\n* API: used [flask](http://flask.pocoo.org/) for API development.\n* Using [flask-migrate](https://pypi.org/project/Flask-Migrate/) for database migration.\n* Using [httpie](https://pypi.org/project/httpie/) for API calls and testing, similar to postman.\n\n## Installation\n\n### Windows\n\n git clone https://github.com/Kartikei-12/Connect-N\n cd Connect-N-master\n python -m venv venv\n ./venv/Scripts/activate\n pip install -r requirements.txt\n python -m unittest discover --verbose\n\n### Linux based OS\n\n git clone https://github.com/Kartikei-12/Connect-N\n cd Connect-N-master\n python3 -m venv venv\n source venv/bin/activate\n pip3 install -r requirements.txt\n python -m unittest discover --verbose\n\n## Direct Usage\n\nFor simple example,\n\nRun main.py as `python main.py` on **windows** with virtual environment(`./venv/Scripts/activate`).\n\nRun main.py as `python3 main.py` on **Ubuntu/Linux** with virtual environment(`source /venv/Scripts/activate`).\n\n## API\n\n### API Setup(One time)\n\n git clone https://github.com/Kartikei-12/Connect-N\n cd Connect-N-master\n python -m venv venv\n ./venv/Scripts/activate\n pip install -r requirements.txt\n cd connect_n/api/\n pip install -r requirements.txt\n flask db init\n flask db migrate -m \"Initial migration\"\n flask db upgrade\n cd ../../\n\n### API Usage\n\nRun server with `flask run` in `Connect-N/connect_n/api` directory.\n\nAPI Call: In new terminal do `http GET http://127.0.0.1:5000/test`\n\n## System Requirements\n\n* [Python 3](https://www.python.org/)\n* [Pip](https://pypi.org/) usually pre-installed with python, check with `pip3 --version`.\n* Python module [PyGame](https://pypi.org/project/pygame/) installable via pip.\n\n## Documentation\n\n[docs](https://kartikei-12.github.io/Connect-N/html/index.html)\n\n## Limitation\n\nGUI **NOT** working inside docker, because no support for pygame inside Docker.\n**Workaround**: Code automatically switches to command line interface without raising error connect_n/connect_n.py.\n\n## Contributer(s)\n\n[@Kartikei Mittal](https://github.com/Kartikei-12)\n\n## Help Needed\n\n* Looking for any algorithm which may be useful for designing AI for turn based games with more than two players.\n* Looking for a front end developer for making API front end for web and android.\n\n## Additional Resources\n\n* Flask Totorial:\n * [Youtube](https://www.youtube.com/watch?v=Z1RJmh_OqeA)\n * [Miguel Grinberg](https://blog.miguelgrinberg.com/post/the-flask-mega-tutorial-part-i-hello-world)\n* freecodecamp [tutorial](https://www.youtube.com/watch?v=8392NJjj8s0)\n\n## Acknowledgment\n\n* Thanks to [Miguel Grinberg](https://github.com/miguelgrinberg) for excelent resource on flask and how to learn it.\n* Thanks to [freecodecamp](https://www.freecodecamp.org/) for the great beginning boost.\n\n\n\n\n\n\n\n Test Report\n \n \n \n\n\n
\n
\n
\n

Test Report

\n

Start Time: 2019-08-11 19:14:05

\n

Duration: 51.73 s

\n

Summary: Total: 26, Pass: 26

\n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
test_ai.AITestsStatus
test_get_move\n Pass\n \n
test_greedy\n Pass\n \n
test_horizontal_score\n Pass\n \n
test_negative_digonal_score\n Pass\n \n
test_positive_digonal_score\n Pass\n \n
test_string_score\n Pass\n \n
test_vertical_score\n Pass\n \n
\n Total: 7, Pass: 7 -- Duration: 105 ms\n
\n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
test_api_utility.APIUtilityStatus
test_compile_response\n Pass\n \n
\n Total: 1, Pass: 1 -- Duration: 0 ms\n
\n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
test_connect_n.ConnectNTestsStatus
test_add_player\n Pass\n \n
test_get_strings\n Pass\n \n
test_get_valid_moves\n Pass\n \n
test_horizontal_winning_move\n Pass\n \n
test_is_valid_move\n Pass\n \n
test_make_move\n Pass\n \n
test_negative_digonal_winning_move\n Pass\n \n
test_positive_digonal_winning_move\n Pass\n \n
test_simulate\n Pass\n \n
test_version\n Pass\n \n
test_vertical_winning_move\n Pass\n \n
\n Total: 11, Pass: 11 -- Duration: 1 ms\n
\n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
test_dataset_generate.GenerateDataTestsStatus
test_generate_save\n Pass\n \n
test_load\n Pass\n \n
\n Total: 2, Pass: 2 -- Duration: 25.66 s\n
\n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
test_db_user_model.UserModelCaseStatus
test_check_token\n Pass\n \n
test_password_hashing\n Pass\n \n
test_to_dict\n Pass\n \n
test_token_expiration\n Pass\n \n
\n Total: 4, Pass: 4 -- Duration: 2.58 s\n
\n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
test_pygame_utility.PygameUtilityTestsStatus
test_play\n Pass\n \n \n

pygame 1.9.6\nHello from the pygame community. https://www.pygame.org/contribute.html\n

\n
\n Total: 1, Pass: 1 -- Duration: 23.39 s\n
\n
\n
\n
\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/Kartikei-12/Connect-N", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "connect-n", "package_url": "https://pypi.org/project/connect-n/", "platform": "", "project_url": "https://pypi.org/project/connect-n/", "project_urls": { "Homepage": "https://github.com/Kartikei-12/Connect-N" }, "release_url": "https://pypi.org/project/connect-n/0.0.5/", "requires_dist": [ "numpy", "loguru", "pygame", "html-testRunner" ], "requires_python": "", "summary": "A modified version of Connect-4 game implemented with AI using PyGame.", "version": "0.0.5" }, "last_serial": 5732443, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "521d3bb7277ad9dcf7260b4264528454", "sha256": "2eb2581cadd0eceb56f300017230e0c7823fe593dd24c618201894e5fb7fd377" }, "downloads": -1, "filename": "connect_n-0.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "521d3bb7277ad9dcf7260b4264528454", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 38436, "upload_time": "2019-08-26T16:33:43", "url": "https://files.pythonhosted.org/packages/87/5a/6c1ebca7d4a01934a76550229c0fabdccdda23e6915669495c561170751e/connect_n-0.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "e66cc9dbf6ebb85265a8fed74ce161ac", "sha256": "3bc013a3c4fc831eb4f23b9b2202ea3d28e74670db96752f9af64456b0ef5d73" }, "downloads": -1, "filename": "connect-n-0.0.1.tar.gz", "has_sig": false, "md5_digest": "e66cc9dbf6ebb85265a8fed74ce161ac", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19096, "upload_time": "2019-08-26T16:33:49", "url": "https://files.pythonhosted.org/packages/a0/87/f81344a231c1dd1bc673a3e46d4b289c1d24d5ab444a451fd6cd47a7fd11/connect-n-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "304c483100dfcb997a6c19339ed5e4d7", "sha256": "ef8199d53e5bba2364348e967d55a2b0c9403d31d1ce8715b1cf59f10d6cd994" }, "downloads": -1, "filename": "connect_n-0.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "304c483100dfcb997a6c19339ed5e4d7", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 38440, "upload_time": "2019-08-26T16:33:47", "url": "https://files.pythonhosted.org/packages/7f/b5/8d2578e1c87356d0876c1bc5554190a9a0b53a778f62d3c8d3bea6688f9f/connect_n-0.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "8d4f3c5e261d6b040f144d3e7dd39500", "sha256": "4058f396000262fc658e93cfb1bc7548dd649aa03d9a3408e40668f495576a7a" }, "downloads": -1, "filename": "connect-n-0.0.2.tar.gz", "has_sig": false, "md5_digest": "8d4f3c5e261d6b040f144d3e7dd39500", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19093, "upload_time": "2019-08-26T16:33:54", "url": "https://files.pythonhosted.org/packages/6e/ba/a8931a58f72217b07dd478349ecf97c6a5351b938c4b2b5a8a6570e26abc/connect-n-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "6c3a8957348a3a450d5cdb6f5abe8299", "sha256": "97e6dd0f4842a03c678c40095c1f90b19faa4295976833a3d62e2d84a69988b8" }, "downloads": -1, "filename": "connect_n-0.0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "6c3a8957348a3a450d5cdb6f5abe8299", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 38767, "upload_time": "2019-08-26T16:52:44", "url": "https://files.pythonhosted.org/packages/34/14/6f6da7a0ef9bc0fc2f77ff15bcf05f10cfba1c3173dab79ecdda6c381f61/connect_n-0.0.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "8e466934bf189a64b23aef2c55039e39", "sha256": "6d843735efdd03180eb86e94075abf0bf6aa04cc98a4f5732cde2211aae598df" }, "downloads": -1, "filename": "connect-n-0.0.3.tar.gz", "has_sig": false, "md5_digest": "8e466934bf189a64b23aef2c55039e39", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19230, "upload_time": "2019-08-26T16:52:48", "url": "https://files.pythonhosted.org/packages/91/96/d35458979715476b5c11b5fc878f6f3b9f5793a22133883e9e99ec10f8f6/connect-n-0.0.3.tar.gz" } ], "0.0.4": [ { "comment_text": "", "digests": { "md5": "43a3c8cf840ece4d2d722878b5317040", "sha256": "1f876d74a48acb29121ee3f4dfe26484d5735a9c3635f1b779560e472698e983" }, "downloads": -1, "filename": "connect_n-0.0.4-py3-none-any.whl", "has_sig": false, "md5_digest": "43a3c8cf840ece4d2d722878b5317040", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 38759, "upload_time": "2019-08-26T17:00:58", "url": "https://files.pythonhosted.org/packages/5c/4f/7ed1ec42a8fdc9ea6513a75e3e10ab3cc52d15ec16725d81e16c110be1df/connect_n-0.0.4-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "136053b2e9aab8561287dcb8561327ce", "sha256": "6f4fec066fda0288b1141f514558dc718af0d91ed8b151b37df34e5a53b22526" }, "downloads": -1, "filename": "connect-n-0.0.4.tar.gz", "has_sig": false, "md5_digest": "136053b2e9aab8561287dcb8561327ce", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19249, "upload_time": "2019-08-26T17:01:02", "url": "https://files.pythonhosted.org/packages/9a/10/26fac6ecaa02d5123477f63ffbaf667c403d85a264636d3e70a6a349d6a4/connect-n-0.0.4.tar.gz" } ], "0.0.5": [ { "comment_text": "", "digests": { "md5": "57001fb7714489fc83b17dba5f9c084b", "sha256": "263a8b7d77f8226b95cda21b3bf40d55eabf29c9da9e0c30c33f021840797c56" }, "downloads": -1, "filename": "connect_n-0.0.5-py3-none-any.whl", "has_sig": false, "md5_digest": "57001fb7714489fc83b17dba5f9c084b", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 34607, "upload_time": "2019-08-26T18:37:23", "url": "https://files.pythonhosted.org/packages/41/b7/adc54ce046b7d6e6865b83ba54fb707b7dd3d83dedb9116004a48730b8e8/connect_n-0.0.5-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "2389d611303fe159c2f78d16e68ab606", "sha256": "3bc9c00caf328953ae5472d9ffe12e3178e8245315e62f894a4b49f1bc91df88" }, "downloads": -1, "filename": "connect-n-0.0.5.tar.gz", "has_sig": false, "md5_digest": "2389d611303fe159c2f78d16e68ab606", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17142, "upload_time": "2019-08-26T18:37:24", "url": "https://files.pythonhosted.org/packages/96/33/6243ea0698da3b09fceca1bd8f1119b9b0c3b0eb1fad8cdc98d1617dca82/connect-n-0.0.5.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "57001fb7714489fc83b17dba5f9c084b", "sha256": "263a8b7d77f8226b95cda21b3bf40d55eabf29c9da9e0c30c33f021840797c56" }, "downloads": -1, "filename": "connect_n-0.0.5-py3-none-any.whl", "has_sig": false, "md5_digest": "57001fb7714489fc83b17dba5f9c084b", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 34607, "upload_time": "2019-08-26T18:37:23", "url": "https://files.pythonhosted.org/packages/41/b7/adc54ce046b7d6e6865b83ba54fb707b7dd3d83dedb9116004a48730b8e8/connect_n-0.0.5-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "2389d611303fe159c2f78d16e68ab606", "sha256": "3bc9c00caf328953ae5472d9ffe12e3178e8245315e62f894a4b49f1bc91df88" }, "downloads": -1, "filename": "connect-n-0.0.5.tar.gz", "has_sig": false, "md5_digest": "2389d611303fe159c2f78d16e68ab606", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17142, "upload_time": "2019-08-26T18:37:24", "url": "https://files.pythonhosted.org/packages/96/33/6243ea0698da3b09fceca1bd8f1119b9b0c3b0eb1fad8cdc98d1617dca82/connect-n-0.0.5.tar.gz" } ] }