Connect four is a two-player connection game in which the players first choose a color and then take turns dropping colored discs from the top into a seven-column, six-row vertically suspended grid. The pieces fall straight down, occupying the next available space within the column.
The objective of the game is to be the first to form a horizontal, vertical, or diagonal line of four of one's own discs. Connect Four is a solved game. The first player can always win by playing the right moves.
Details: https://en.wikipedia.org/wiki/Connect_Four
- Connect four of your checkers in a row while preventing your opponent from doing the same.
- The two players take turns dropping checkers into a vertical board.
- The checkers fall all the way down to the bottom of the column they are put in Core.
- Basic game implementation with the rules described above.
- Can click a button to start a new game.
- Can play against another human or a random computer opponent (the AI just does random moves, but they have to be valid).
- Must use a combination of HTML, CSS and JavaScript.
How to run the game: open the file index.html in a modern browser
If you want to run the tests I wrote for this game please execute the following commands (npm needs to be installed in your system):
npm install # installs dependencies npm install # runs the tests
Code licensed by GNU GENERAL PUBLIC LICENSE Version 3.
Text licensed by Creative Commons Attribution-ShareAlike 4.0 International.