The Invent with Python Blog

Writings from the author of Automate the Boring Stuff.

New Game Source Code: Four in a Row

Fri 10 June 2011    Al Sweigart

I've made a Connect Four AI. You will need Python 3 (not Python 2) to play the games and Pygame.

In the graphical version, drag the red tokens over the top of the board to make a move.

Source Code and image files zipped.

Learn to program for free with my books for beginners:

Sign up for my "Automate the Boring Stuff with Python" online course with this discount link.

Email | Mastodon | Twitter | Twitch | YouTube | GitHub | Blog | Patreon | LinkedIn | Personal Site