Work JavaScript / Alpha-beta pruning

Multi Connect Four

A harder Connect Four variant where the player has to survive four boards at once. If the AI wins on any board, the whole match is lost.

Game Logic

The opponent uses minimax with alpha-beta pruning. The evaluation favors center control, threat blocking, and immediate winning opportunities, while pruning cuts branches that cannot affect the final decision.

Implementation

  • Vanilla JavaScript with separated game, AI, and UI layers.
  • Four simultaneous boards with automatic active-board switching.
  • Mouse controls and keyboard shortcuts for columns 1-7.
  • Small responsive interface built for quick experimentation.