{"id":21921405,"url":"https://github.com/hamishivi/connect4","last_synced_at":"2025-03-22T10:42:40.161Z","repository":{"id":74330751,"uuid":"126846330","full_name":"hamishivi/Connect4","owner":"hamishivi","description":"Connect4 AI with basic frontend","archived":false,"fork":false,"pushed_at":"2023-05-01T21:14:22.000Z","size":30,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-27T10:25:08.161Z","etag":null,"topics":["connect4","cpp","minimax"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hamishivi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-03-26T15:03:31.000Z","updated_at":"2019-08-20T08:51:45.000Z","dependencies_parsed_at":null,"dependency_job_id":"b322af41-3729-4f5b-b652-694cceb28ef4","html_url":"https://github.com/hamishivi/Connect4","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hamishivi%2FConnect4","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hamishivi%2FConnect4/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hamishivi%2FConnect4/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hamishivi%2FConnect4/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hamishivi","download_url":"https://codeload.github.com/hamishivi/Connect4/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244945594,"owners_count":20536295,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["connect4","cpp","minimax"],"created_at":"2024-11-28T20:24:40.491Z","updated_at":"2025-03-22T10:42:40.141Z","avatar_url":"https://github.com/hamishivi.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Connect 4 AI + Frontend\n\nThis is a little website I built around a connect4 AI I wrote as part of a university assignment. You can check it out [here](https://c4hamish.herokuapp.com/). The frontend isn't the best (it's a work in progress). The main constraint on this AI was that it had run within around 1 second, so it's fast but doesn't always do the absolutely best move! However, it does do the best it can. You can interact with it via the website, or compile and run the code yourself - just compile ```Connect4Tournament.cpp``` and read the instructions below.\n\n## Connect4Tournament.cpp\n\nMinimax AI built for an university assignment. It takes in one turn at a time (yes, clunky, but thats how it went). To use, compile and run as:\n\n```\n./connect4 \u003cboard\u003e \u003ccolour\u003e\n```\n\nThe board should a single string representing the state of the board as \"row0,row1,row2,row3,row4,row5\", where each row contains 7 characters ('.' for an empty cell, 'r' for a red cell, and 'y' for a yellow cell). The colour can be 'red' or 'yellow' to define who is going to play next. Originally you could also control search depth and toggle alpha-beta pruning as well, but the current iteration has infinite depth and alpha-beta on at all times, since this gives optimal results. An example input is below:\n\n```\n./connect4 ..rr...,...y...,.......,.......,.......,....... yellow\n```\n\nFor the assignment, 'not making a move' was considering legal and so passing your turn is allowed. In this case, the program will not output anything.\n\nThe code isn't very neat or structured, but hopefully the comments are enough to help in understanding. This was more written as a quick script than a full properly-structured program.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhamishivi%2Fconnect4","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhamishivi%2Fconnect4","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhamishivi%2Fconnect4/lists"}