Giter VIP home page Giter VIP logo

chess-engine's Introduction

Chess-Engine

C++ Chess Engine, UCI and XBoard/WinBoard compliant

Usage

To use the engine in console mode on linux

  1. Clone the repository
  2. Run 'make clean; 'make' ('make linux' puts the executable in bin/linux)
  3. Run the executable './ce'
  4. Type "console" into stdin
  5. Type "help" to pull up information on how to set up the board and make moves
  6. Enter moves to engine as follows
    • [target][dest][promotion]?
    • ex. a2a4, b7b8q

Linking with Arena

If you want to link the engine to the Arena Chess GUI then you will first need to download the latest version of Arena for your operating system here: http://www.playwitharena.com/

After downloading Arena, run the Arena executable select 'Engines' -> 'Install New Engine' and select the chess engine executable. Next go to 'Engines' -> 'Manage Engines' and make sure that the information for the engine is correct. Lastly go to 'Engines' -> 'Load Engine' and select the engine that you've added. You should now be able to play against the engine with a gui by making a move for white.

Board representation

  • Uses a 10x12 Board array
     -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
     -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
     -1,  0,  1,  2,  3,  4,  5,  6,  7, -1,
     -1,  8,  9, 10, 11, 12, 13, 14, 15, -1,
     -1, 16, 17, 18, 19, 20, 21, 22, 23, -1,
     -1, 24, 25, 26, 27, 28, 29, 30, 31, -1,
     -1, 32, 33, 34, 35, 36, 37, 38, 39, -1,
     -1, 40, 41, 42, 43, 44, 45, 46, 47, -1,
     -1, 48, 49, 50, 51, 52, 53, 54, 55, -1,
     -1, 56, 57, 58, 59, 60, 61, 62, 63, -1,
     -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
     -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
     
     -Negative numbers represent offboard squares

Move Representation

  • Represents moves using a 32-bit integer
  Internal representation of moves
  0000 0000 1 1111 1 1111 1111111 1111111 
            ^   ^  ^   ^      ^       ^
            1   2  3   4      5       6

    1. Castle
    2. Promoted piece
    3. EnPassant
    4. Captured piece
    5. To square
    6. From square

Search

  • Mini-max
  • Iterative Deepening
  • Alpha-beta pruning
  • Quiescence search

Move Ordering Improvements

  • Transposition Table
  • Polyglot opening book
  • Most Valuable Victim / Least Valuable Aggressor
  • Killer moves
  • Null Move Pruning

Evaluation

  • Material value
  • Piece Square tables
  • Mobility
  • Pawn structure
  • Special Bonuses
    • Bishop pair
    • Non-Isolated Pawns
    • Passed Pawns
    • King endgame positioning

Documentation

  • Documentation can be viewed either via Doxygen in the docs/ directory or directly in the *.h files located in the include/ directory

Resources

chess-engine's People

Contributors

michaellee4 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.