Skip to content
/ c4 Public

πŸ”΄πŸ”΅ Connect Four game in JS + Canvas

License

Notifications You must be signed in to change notification settings

kenrick95/c4

Folders and files

NameName
Last commit message
Last commit date
Jun 27, 2024
Jun 27, 2024
Apr 12, 2025
Apr 12, 2025
Apr 12, 2025
Aug 27, 2022
Apr 11, 2020
Aug 27, 2022
Nov 24, 2018
Apr 11, 2020
Jun 27, 2024
Nov 5, 2023
Apr 21, 2023
Mar 7, 2024
Apr 21, 2023
Apr 26, 2023
Jun 27, 2024
Apr 12, 2025

Repository files navigation

c4

Test Deploy

c4, stands for Connect Four, is a browser game written in TypeScript and utilizes HTML's canvas. Player is playing against an AI that uses Minimax algorithm and alpha-beta pruning. The evaluation function is hard-coded, and hence the AI may not be moving using the most optimal move.

Play

Gameplay

Screenshot 2024-03-07 202120

Objective

Connect four of your game pieces vertically, horizontally, or diagonally before the other player do so.

How to move?

At each turn, player will drop a game piece in one of the seven columns by clicking on the chosen column.

More info

Read Wikipedia page on Connect Four

Browser compatibility

Should be good in latest Firefox, Edge, Chrome, and Safari.

Contributing

Contributions are welcome! I'm happy to accept any kind of contributions, pull requests, or bug reports.

Developing

  1. Fork and clone this repository
  2. Install dependencies
yarn install
  1. Start local development server
yarn start
  1. Make your changes at either browser/, core/, or server/
  2. Test it out at http://localhost:5173/
  3. After you are happy with your changes, please submit your Pull Request!

License

This work is licensed under MIT License.