Skip to main content

How to write chess engines?

30 May 2022

night

  • how to write chess engines?
  • read some code
  • which language to choose?
    • python: easy, ready-made libraries, slow
    • js: almost same, nice gui
    • c++: hard, have to learn
    • c: hard and complex, hard to maintain, boring?

Comments

Popular posts from this blog

Making moves with the Negamax algorithm

  10 Sept 2022 after a loooonngg time!!! 4:50 am there's a lot to tell you, but firstly, i'm very happy now because i just teached my ai to capture pieces and guess what, it doesn't just look one move into the future. yes guys, i wrote the negamax algorithm!! it's much more fun to play with it now. but still it has to prioritize other things besides captures, like promotions, checks, pins etc. and obviously, mates! now i'm going to sleep as i got many works to do :(

Making engine fast

18 Dec 2022 2:40 am planning to make a major change in the codebase: using  enum  instead of  char  for pieces. This is to elude branching in code? added best move tester solved a small bug in move generation 5 am completed the change to  enum  for pieces maybe the engine is now faster? (because we can now access piece-square tables directly using index without branching)

Faster move generation, Mate in X tests

  24 Dec 2022 1:30 am better  uci  handling, using  istringstream  to parse commands better Mate Score output added Mate in 2, 3, and 4 tests (and they pass! but slow) inlined some functions (maybe faster now?) added Search Type:  Infinite ,  Fixed Depth ,  Time per Move ,  Time per Game ,  Ponder  and  Mate . Not all of them are working yet :') 3 am movelist.reserve(40) : doing this made move generation ~1.5x faster! Now reserving in all vectors. modularized move generation added  get_threats  function