Howuhh / chess_minimax

minimax algorithm for chess with alpha-beta pruning

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Chess Minimax

I've decided to continue my adventure after minimax implementation for tic tac toe.

"ex_play"

Implemented

  • board state evaluation based on pieces weights (pretty base solution)
  • minimax search algorithm for best move/optional depth
  • alpha-beta search tree pruning
  • game class for games with different players
  • game result stats

Problems

  • Bots don't know how to end a game, so it almost always ends in a draw. Possible solution: endgame tablebase.
  • Minimax for depth > 4 execution takes forever even with alpha-beta pruning and move sorting by pieces importance. Possible solution: tree caching, better heuristic, parallelization (oh that's hard), build tree only for some promising moves (for example in some range from the opponent).

TODO:

  • player class & methods for human play
  • game loop for random player & human player
  • simple func for game generations and saving result stats
  • add minimax method for simple eval by pieces weigths
  • different weights for board eval -> stats bot vs bot
  • alpha-beta pruning
  • too long - sort possible moves by pieces: more weight at first -> better pruning
  • caching (???)

Inspiration:

About

minimax algorithm for chess with alpha-beta pruning

License:MIT License


Languages

Language:Jupyter Notebook 76.9%Language:Python 23.1%