Alpha Zero-like AI for Connect 4

Before we begin working on the AI that plays Connect4, let's briefly understand the game and its dynamics. Connect 4, also sometimes known as Four in a row, Four in a line, Four up, and so on, is one of the most popular board games among children all over the world. We can also understand it as a more advanced version of the Tic-Tac-Toe game, where you have to place three markers of the same type either horizontally, vertically, or diagonally. The board is generally a 6x7 grid, and two players play with a marker each.

The rules of Connect 4 can vary, so let's lay down some concrete rules for the version of the rules that our AI will learn to play:

  • The game is simulated as being played on a vertical board ...

Get Mobile Deep Learning with TensorFlow Lite, ML Kit and Flutter now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.