Skip to content

Latest commit

 

History

History
70 lines (38 loc) · 2.36 KB

README.md

File metadata and controls

70 lines (38 loc) · 2.36 KB

Chess-AI

  The program is able to play Chess at an ELO rating of 1300 points.
  It is based on a brute-force search with a few optimisations applied (Alpha-Beta Pruning, position hashing, move ordering and others).
  It uses bitboards for faster moves generation.
  A lot of logical operations and instructions were used.

How to use the program:

  First, the program asks what color the player and the A.I. will be. It will also ask for the maximum depth of the move search. It is recommended to choose a search depth of 4 or 5 (5 still takes 15 seconds for each move on my computer).


  When the application is running, the font size in the executable must be set to 8, otherwise the board will be too large for the executable screen.


  To perform a move, type the id of piece to be moved, its start position and its end position.
For example, for a white rook from e2 to e4, we will type "Re2e4" and then press enter. For a black queen from 7f to 8f, we will type "q7f8f" and press enter.


  Pieces IDs:


  • P / p = white / black pawn
  • R / r = white / black rook
  • N / n = white / black knight
  • B / b = white / black bishop
  • Q / q = white / black queen
  • K / k = white / black king

  This is how most moves work. There are only a few exceptions:


  If we make an en passant, then a "+" must be typed after the usual 5 characters.
  If we promote a pawn, then we also type r / n / b / q for black and R / N / B / Q for white, to specify what the respective pawn turns into.


  The program stops itself if there is a draw or checkmate for someone.


  The player can set from which perspective to see the pieces: from that of white (white down) or black (black down).


  The application interface communicates with the player, since it tells him at any moment whose turn it is, if someone is in chess, if there is a draw or if there is a checkmate for someone.


  The code can be easily modified to allow playing Chess between 2 people, not between the person and the A.I..