Git Product home page Git Product logo

mancala-engine's Introduction

Mancala Engine

Overview

This program was created for the purpose of finding strong moves in the strategy board game Mancala.

It uses the minimax algorithm with alpha-beta pruning to search the tree of possible game states up to a certain depth (default 24) and return the best move along with an evaluation number. When this number is positive the engine is winning, and when it is negative the human player is winning.

Build Instructions

Make sure you have CMake and a C++ Compiler installed.

cd mancala-engine
mkdir build
cd build
cmake ..
cmake --build .
./MancalaEngine

Testing

This project uses the GoogleTest framework. After following the build commands above, you can simply run

ctest

while in the build directory.

Example Output

A snippet from a game against the engine.

Engine plays 2 (eval = 19)
-----------------------
|  00 06 00 09 01 00  |
|03                 19|
|  00 07 00 01 01 01  |
-----------------------
Human move (0-5): 1
Engine plays 5 (eval = 21)
Engine plays 4 (eval = 21)
-----------------------
|  01 00 00 09 01 00  |
|04                 20|
|  01 08 01 02 00 01  |
-----------------------
Human move (0-5): 0
-----------------------
|  00 00 00 09 01 00  |
|05                 20|
|  01 08 01 02 00 01  |
-----------------------
Human move (0-5): 3
Engine plays 5 (eval = 20)
Engine plays 3 (eval = 20)
Engine plays 5 (eval = 20)
Engine plays 4 (eval = 19)
Engine plays 5 (eval = 18)
Engine plays 2 (eval = 18)
-----------------------
|  01 01 01 00 00 00  |
|06                 27|
|  02 09 00 01 00 00  |
-----------------------

...

mancala-engine's People

Contributors

evanwild avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.