{"id":43455110,"url":"https://github.com/caleb531/connect-four","last_synced_at":"2026-02-03T03:00:56.265Z","repository":{"id":14874089,"uuid":"76981674","full_name":"caleb531/connect-four","owner":"caleb531","description":"The slickest way to get 4-in-a-row, written using HTML5, JS, and Mithril (like React). Features an AI player, online multiplayer capability, and a smooth user interface","archived":false,"fork":false,"pushed_at":"2025-07-18T20:41:31.000Z","size":3510,"stargazers_count":30,"open_issues_count":0,"forks_count":10,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-09-09T21:26:53.361Z","etag":null,"topics":["connect-four","game","html5","javascript","minimax","mithril"],"latest_commit_sha":null,"homepage":"https://connectfour.calebevans.me/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/caleb531.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2016-12-20T18:30:07.000Z","updated_at":"2025-07-18T20:41:36.000Z","dependencies_parsed_at":"2024-08-03T18:52:59.282Z","dependency_job_id":"d6dbc7c2-694c-40ba-81dc-3af5f607c938","html_url":"https://github.com/caleb531/connect-four","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/caleb531/connect-four","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caleb531%2Fconnect-four","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caleb531%2Fconnect-four/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caleb531%2Fconnect-four/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caleb531%2Fconnect-four/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/caleb531","download_url":"https://codeload.github.com/caleb531/connect-four/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caleb531%2Fconnect-four/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29029760,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-03T02:28:16.591Z","status":"ssl_error","status_checked_at":"2026-02-03T02:27:48.904Z","response_time":96,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["connect-four","game","html5","javascript","minimax","mithril"],"created_at":"2026-02-03T03:00:40.826Z","updated_at":"2026-02-03T03:00:56.252Z","avatar_url":"https://github.com/caleb531.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Connect Four\n\n_Copyright 2016-2025 Caleb Evans_  \n_Released under the MIT License_\n\n[![tests](https://github.com/caleb531/connect-four/actions/workflows/tests.yml/badge.svg)](https://github.com/caleb531/connect-four/actions/workflows/tests.yml)\n\n\u003c!-- [![Coverage Status](https://coveralls.io/repos/github/caleb531/connect-four/badge.svg?branch=main)](https://coveralls.io/github/caleb531/connect-four?branch=main) --\u003e\n\nThis is the slickest Connect Four app around, written using HTML5, JavaScript,\nand Mithril (a React-like framework). You can play on your phone or computer,\nwith a friend or against Mr. A.I.\n\nYou can play the app online at:  \nhttps://connectfour.calebevans.me/\n\n## Implementation\n\n### User interface\n\nThe entire app UI is constructed and managed in JavaScript using\n[Mithril][mithril]. Chip transitions are handled by CSS to maximize performance\nand smoothness. The grid layout is styled with CSS Flexbox to enable the\nstacking of grid elements from the bottom up.\n\n[mithril]: http://mithril.js.org/\n\n### AI Player\n\nLike many traditional board game AIs, my Connect Four AI uses the\n[minimax][minimax] algorithm. For my particular implementation, I've chosen to\nuse a maximum search depth of three (meaning the AI examines possibilities up to\nthree turns into the future). This is combined with [alpha-beta pruning][abp] to\ndramatically reduce the number of possibilities evaluated.\n\nMy scoring heuristic works by counting connections of chips that intersect with\nan empty slot, giving exponentially more weight to larger connections. For\nexample, every single chip touching an empty slot is worth four points, a\nconnect-two is worth nine points, a connect-three is worth sixteen points, and\nso on. A winning connection of four or more chips is given the maximum/minimum\nscore.\n\nIn the app, the AI player is lovingly referred to as \"Mr. AI\".\n\n[minimax]: https://en.wikipedia.org/wiki/Minimax\n[abp]: https://en.wikipedia.org/wiki/Alpha%E2%80%93beta_pruning\n\n## Run the project locally\n\n### 1. Install global dependencies\n\nThe project requires Node (\u003e= 18), so make sure you have that installed.\n\n### 2. Install project dependencies\n\n### Install packages\n\nThis project uses [pnpm][pnpm] (instead of npm) for package installation and\nmanagement. From the cloned project directory, run:\n\n[pnpm]: https://pnpm.io/\n\n```bash\nnpm install -g pnpm\npnpm install\n```\n\n### 3. Serve app locally\n\nTo serve the app locally, run:\n\n```bash\npnpm dev\n```\n\nYou will then be able to view the app at `http://localhost:8080`. Any app files\nwill be recompiled automatically when you make changes to them (as long as `pnpm dev` is still running).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcaleb531%2Fconnect-four","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcaleb531%2Fconnect-four","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcaleb531%2Fconnect-four/lists"}