Skip to content

minimax algorithm for chess with alpha-beta pruning

License

Notifications You must be signed in to change notification settings

Howuhh/chess_minimax

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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: