INVENT WITH PYTHON
  • Read for Free
    • Automate the Boring Stuff with Python
    • The Recursive Book of Recursion
    • Python Programming Exercises, Gently Explained
    • The Big Book of Small Python Projects
    • Beyond the Basic Stuff with Python
    • Coding with Minecraft
    • Invent Your Own Computer Games with Python
    • Scratch 3 Programming Playground
    • Making Games with Python & Pygame
  • Buy Books
    • Automate the Boring Stuff with Python
    • The Recursive Book of Recursion
    • Python Programming Exercises, Gently Explained
    • The Big Book of Small Python Projects
    • Beyond the Basic Stuff with Python
    • Coding with Minecraft
    • Cracking Codes with Python
    • Invent Your Own Computer Games with Python
    • Scratch 3 Programming Playground
    • Making Games with Python & Pygame
  • Video Courses
    • Automate the Boring Stuff with Python
    • Beyond the Basic Stuff with Python
    • Scratch
  • Social Links
    • Patreon
    • GitHub
    • Mastodon
    • Bluesky
    • Twitch
    • LinkedIn
    • YouTube
    • Amazon Author
  • Blog
  • Donate
Fri 10 June 2011

New Game Source Code: Four in a Row

Posted by Al Sweigart in misc   

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.

LGBT Rainbow Flag
BLACK LIVES MATTER | TRANS RIGHTS ARE HUMAN RIGHTS | TAX THE RICH | LEARN AMERICAN HISTORY

Site built using Pelican