Skip to content

VictorXjoeY/Minimax

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Minimax

Generic Minimax algorithm for 2 player games of Perfect Information. These are the games that are currently implemented:

Instructions

I am using C++17 so your g++ version should be at least 7.0!

Linux/Mac

Prerequisites

  1. Install g++:
sudo apt-get install g++
  1. Install make:
sudo apt-get install make

Build

make

Run

make run

Windows

Prerequisites

  1. Install g++ (MinGW): http://www.mingw.org/
  2. Open your Command Prompt and run this to ensure that g++ is properly installed:
g++ --version

Build

  • Run build.bat.

Run

  • Run run.bat.

Known Issues

  • On Windows Subsystem for Linux (WSL) the AI will play as soon as possible.
  • Don't run it on Windows if you want to have colorful prints!

Notes

  • Works for any 2 player games implemented as a derived class from Game<StateType, MoveType>.
  • Works for games with cycles.
  • Works for games that can tie.
  • Takes the shortest path for the win, but the longest path for the loss.
  • The AI takes at least TIMEOUT milliseconds to play.
  • It currently does not work for games with imperfect information or chance elements (dice/card games). I'll probably code that in another project.

About

Generic Minimax algorithm for 2 player games

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages