Package: connect-n
Connect-NIntroductionA simple modified version of Connect Four Game implemented with AI in Python using PyGame.Project DescriptionThis repositry contains a simple game made inpythonsimilar toConnect 4.A bit modified to work with any connect length for any board size.Currently supports for variable number of players on a two dimentional board.Onlythreeplayers supported in GUI mode.For more players add new coloursCOLORvariable in connect_n/pygame_utility.py file.ID 1 is reserved for AI.Currently only supports single AI player in a game.Tests in python 3.7 on Windows OS(by developer).API: usedflaskfor API development.Usingflask-migratefor database migration.Usinghttpiefor API calls and testing, similar to postman.InstallationWindowsgit clone https://github.com/Kartikei-12/Connect-N
cd Connect-N-master
python -m venv venv
./venv/Scripts/activate
pip install -r requirements.txt
python -m unittest discover --verboseLinux based OSgit clone https://github.com/Kartikei-12/Connect-N
cd Connect-N-master
python3 -m venv venv
source venv/bin/activate
pip3 install -r requirements.txt
python -m unittest discover --verboseDirect UsageFor simple example,Run main.py aspython main.pyonwindowswith virtual environment(./venv/Scripts/activate).Run main.py aspython3 main.pyonUbuntu/Linuxwith virtual environment(source /venv/Scripts/activate).APIAPI Setup(One time)git clone https://github.com/Kartikei-12/Connect-N
cd Connect-N-master
python -m venv venv
./venv/Scripts/activate
pip install -r requirements.txt
cd connect_n/api/
pip install -r requirements.txt
flask db init
flask db migrate -m "Initial migration"
flask db upgrade
cd ../../API UsageRun server withflask runinConnect-N/connect_n/apidirectory.API Call: In new terminal dohttp GET http://127.0.0.1:5000/testSystem RequirementsPython 3Pipusually pre-installed with python, check withpip3 --version.Python modulePyGameinstallable via pip.DocumentationdocsLimitationGUINOTworking inside docker, because no support for pygame inside Docker.Workaround: Code automatically switches to command line interface without raising error connect_n/connect_n.py.Contributer(s)@Kartikei MittalHelp NeededLooking for any algorithm which may be useful for designing AI for turn based games with more than two players.Looking for a front end developer for making API front end for web and android.Additional ResourcesFlask Totorial:YoutubeMiguel GrinbergfreecodecamptutorialAcknowledgmentThanks toMiguel Grinbergfor excelent resource on flask and how to learn it.Thanks tofreecodecampfor the great beginning boost.<title>Test Report</title>Test ReportStart Time:2019-08-11 19:14:05Duration:51.73 sSummary:Total: 26, Pass: 26test_ai.AITestsStatustest_get_movePasstest_greedyPasstest_horizontal_scorePasstest_negative_digonal_scorePasstest_positive_digonal_scorePasstest_string_scorePasstest_vertical_scorePassTotal: 7, Pass: 7 -- Duration: 105 mstest_api_utility.APIUtilityStatustest_compile_responsePassTotal: 1, Pass: 1 -- Duration: 0 mstest_connect_n.ConnectNTestsStatustest_add_playerPasstest_get_stringsPasstest_get_valid_movesPasstest_horizontal_winning_movePasstest_is_valid_movePasstest_make_movePasstest_negative_digonal_winning_movePasstest_positive_digonal_winning_movePasstest_simulatePasstest_versionPasstest_vertical_winning_movePassTotal: 11, Pass: 11 -- Duration: 1 mstest_dataset_generate.GenerateDataTestsStatustest_generate_savePasstest_loadPassTotal: 2, Pass: 2 -- Duration: 25.66 stest_db_user_model.UserModelCaseStatustest_check_tokenPasstest_password_hashingPasstest_to_dictPasstest_token_expirationPassTotal: 4, Pass: 4 -- Duration: 2.58 stest_pygame_utility.PygameUtilityTestsStatustest_playPassViewpygame 1.9.6
Hello from the pygame community. https://www.pygame.org/contribute.htmlTotal: 1, Pass: 1 -- Duration: 23.39 s