Giter Club home page Giter Club logo

parallelchessai's Introduction

Parallel Chess AI

This is a Chess AI that has 6 different AI strategies implemented.

Screenshot

My move: g8f6

  8 ♜ ♞ ♝ ♛ ♚ ♝ ♞ ♜
  7 ♟ ♟ ♟ ♟ ♟ ♟ ♟ ♟
  6 · · · · · · · ·
  5 · · · · · · · ·
  4 · · · · · · · ·
  3 · · · · · · · ·
  2 ♙ ♙ ♙ ♙ ♙ ♙ ♙ ♙
  1 ♖ ♘ ♗ ♕ ♔ ♗ ♘ ♖
    a b c d e f g h


Your move:

Run it!

To use the program, clone this repository. Enter the cloned folder in your terminal, and run the command python sunfish.py to use the program with default options. You can also specify options such as the AI strategy, the depth at which to evaluate the minimax tree, and the number of threads to run the strategy if it is one that is parallelized. The strategy can be specified with the flag --strategy (or -s for short) followed by an integer in the following mapping:

  • 1 for Serial Minimax
  • 2 for Parallel Top Level Minimax
  • 3 for Serial Alpha Beta
  • 4 for Parallel Bottom Level Alpha Beta
  • 5 for Parallel Top Level Alpha Beta
  • 6 for PVSplit

The depth can be specified with the flag --depth (or -d) followed by a positive integer. The number of threads can be specified with the flag --threads (or -t) followed by a positive integer. By default, we have the program run the Serial Minimax at a depth of 3 with, of course, 1 thread.

If we wanted to run the program with, for example, the Parallel Top Level Alpha Beta strategy at a depth of 5 with 4 threads, we would run the following command: python sunfish.py --strategy 5 --depth 5 --threads 4 or python sunfish.py -s 5 -d 5 -t 4 for short.

You can also view the options and their descriptions by running python sunfish.py -h. Running this command will return the following descriptions:

Screen Shot 2015-12-09 at 8.37.08 PM

Once you get the program running, a board will be returned. You (the human) are playing against the computer, and will enter the first move.

Screen Shot 2015-12-09 at 8.51.14 PM

The move will take the format e2e4, where e4 is the place you want to move the piece at e2 to. Once you enter a valid move, the program will return a new board with the move you entered applied:

Screen Shot 2015-12-09 at 9.08.50 PM

The computer will then respond with its move, as well as information on the response, such as the number of board states it explored and the time it took to find an optimal move:

Screen Shot 2015-12-09 at 9.02.10 PM

You can continue playing the computer until there is a winner. Good luck!

parallelchessai's People

Contributors

thomasahle avatar rohitahuja avatar adilosa avatar boarpig avatar verhovsky avatar george-qi avatar jthemphill avatar michaelmior avatar ugoertz avatar willpapper avatar illagrenan 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.