I've decided to rewrite my chess engine from scratch (more or less), and since blogging is so popular these days I decided to write about my progress.
From scratch to the engine beating me. Let's see if I can do it. 🙂
Feel free to drop by and point out all the errors I'm making.
http://mediocrechess.blogspot.com/
It sounds like an intersting project, I wish you luck in it. I wrote a chess program about 12 years ago in Pascal, while at university, after months of work I had a program that worked, could play some basic chess but couldn't checkmate you. Some would say the perfect opponent!
I really should dig it out and have a look at it again!
One common problem with chess engines not being able to mate is they don't recognize that a mate in 1 move is better than a mate in 3 moves.
As long as the mate is within the horizon it can't see the difference between the mates, so it just moves back and forth.
I'll put a in a post about that when I get to the evaluation part.
Originally posted by ZlaireYou can stop that by scoring mate in one slightly higher than mate in 2 and so on, which is going to be easiest to implement by scoring checkmate as (327 + ply_depth_of_search) pawns and subtracting 1 (adding 1) to the score if it is over 326 (beneath -326) just before you return from the alpha-beta function, this way the function treats quicker checkmates as better scoring. Alternatively start iterative deepening from 1 ply.
One common problem with chess engines not being able to mate is they don't recognize that a mate in 1 move is better than a mate in 3 moves.
As long as the mate is within the horizon it can't see the difference between the mates, so it just moves back and forth.
I'll put a in a post about that when I get to the evaluation part.
Originally posted by ZlaireExcellent ...I've always wanted to know how to start creating a chess engine, so good on ya mate, I'll be looking forward to this post and your blog!
I've decided to rewrite my chess engine from scratch (more or less), and since blogging is so popular these days I decided to write about my progress.
From scratch to the engine beating me. Let's see if I can do it. 🙂
Feel free to drop by and point out all the errors I'm making.
http://mediocrechess.blogspot.com/
Yeah I know bitboards has its advantages, but not only is the basic implementation quite complicated, they are also a whole other way of thinking in terms of move generation etc.
Most programmers starting a chess engine would first think of a basic array to represent the board, and the 0x88 scheme is an extension to that. Bitboards are a whole other deal.
So for my engine (being a source of learning as well) I think 0x88-representation is more suited.
Perhaps I'll move on to a bitboard engine after this... 🙂