Skip to content

Five in a row python game with AI created using the minimax algorithm with alpha-beta pruning.

Notifications You must be signed in to change notification settings

Stephanie0829/Gomoku

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

54 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Gomoku

Details:

Python game based on gomoku (5 in a row) with human vs. human and human vs. AI options.
Minimax algorithm used for AI, and pygame used for the GUI.

Preview:

Gameplay Against AI

Gomoku-demo.mov

Layout

Home Screen
User selection of different gaming modes, and option to quit.
Screen Shot 2021-08-30 at 6 52 36 PM

Human vs. Human Mode
Live user competition (switches player within the window). Note: requires two users to use the same device.
Screen Shot 2021-08-30 at 7 21 56 PM Screen Shot 2021-08-30 at 7 22 05 PM

Human vs. AI Mode
User competition with AI that uses the minimax algorithm. AI will automatically play after player 1's move.
Screen Shot 2021-08-30 at 7 22 57 PM Screen Shot 2021-08-30 at 7 23 14 PM

After Clicking Refresh Button
Option to clear the board and restart.
Screen Shot 2021-08-30 at 6 53 12 PM

Installation instructions:

  1. Download zip file or clone repository
  2. Open code in IDE of your choosing
  3. Install libraries (pygame, math, numpy, pygame-menu, button)
  4. Run code

Other details

  • Pieces and home screen image created using figma (c)
  • Used a connect four tutorial as inspiriation during the learning/brainstorming process. Linked: https://www.youtube.com/watch?v=8392NJjj8s0&ab_channel=freeCodeCamp.org
  • Future thoughts/improvements:
    • Use neural networks (reinforcement learning) to improve the speed and accuracy of algorithm (minimax is limited by computer power)
    • Add a database for keeping the highest user score and other data
    • Create an easier access such as making it web based or deployed on a hosting site

About

Five in a row python game with AI created using the minimax algorithm with alpha-beta pruning.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%