ConnectKing

ConnectKing is a lightweight Connect-4 AI assistant that pairs a C++ backend with a Tampermonkey userscript. The userscript forwards board states from your browser to the local server which responds with the best move.

Year 2025
Website GitHub

Gameplay

It works by implementing a lightweight MiniMax AI algorithm in C++, and it exposes endpoints to call the API with a 8x8 board array object using 'X' '0' and '' to mark spots, it will then return the best move. This is then used with a simple userscript plugged into a connect4 website of your choice (I provide one for papergames.io) and it will communicate with the locally hosted server to send board states on moves and return the best move indicated visually on the board.

Note* I do not condone cheating in online games, this project was made mainly for learning about Web Servers, RPC protocols, simple AI algorithms and to mess around with friends.

Challenge

Create a webserver with simple endpoints allowing you to quickly retrieve optimal Connect4 moves

Features

  • C++17 server with simple MiniMax AI
  • Tampermonkey script to integrate with sites like papergames.io
  • Helper scripts for launching a compatible Chromium instance

Result

A fast API that offers quick lookups, search functionality and a customizable userscript experience for deploying on front-end websites.

GitHub Repository