Skip to content

cnsuhao/c4

 
 

Repository files navigation

c4

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

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

  • Require browser that supports ES2015's Promise.
  • Should be good in latest Firefox, Edge, Chrome, Opera, Safari, and IE.

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. Make your changes at src/
  2. Generate dist/ folder:
yarn build
  1. Open index.html in your browser
  2. After you are happy with your changes, please submit your Pull Request!

License

This work is licensed under MIT License.

About

Connect Four game in Javascript using HTML5 features

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 89.3%
  • CSS 5.9%
  • HTML 4.8%