mvanthoor wrote: ↑Fri Feb 05, 2021 8:37 amEven though bitboards are harder to implement (and with regard to magic bitboards, harder to wrap your head around), they really prove their return when you need to check stuff on the board. For example, the square_attacked() function needs to loop over the rays of the rook and the bishop, to find rooks, bishops and the queen, and then has to check against the other king, knights, and pawns. This is a seriously expensive operating. When using bitboards, this function boils down to one (massive) OR-statement.
But that is just a poor mailbox implementation, comparable to a bitboard implementation where you would extract the bits by shifting and testing them one by one, rather than using bit-scan forward. It is always possible to make crappy implementations of any technique. This is why I am of the opposit opinion as Joost. When my mailbox engine Inferno has to do IsSquareAttacked, it just tests whether the entry for that square in the attack map is zero or not. No looping over rays of the board, no massive OR statements. Just a single array access.
If you are familiar with bitwise operations like & | ^ >> << etc, then I would recommend Olithink.
Trying to learn to write a chess program from Stockfish is like trying to learn how to build a log cabin from examination of the empire state building.
Taking ideas is not a vice, it is a virtue. We have another word for this. It is called learning.
But sharing ideas is an even greater virtue. We have another word for this. It is called teaching.
Dann Corbit wrote: ↑Fri Feb 05, 2021 8:06 pm
If you are familiar with bitwise operations like & | ^ >> << etc, then I would recommend Olithink.
Trying to learn to write a chess program from Stockfish is like trying to learn how to build a log cabin from examination of the empire state building.
Yes, I spent many years with assembler, C & C++ twiddling bits :) I've decided to stick with a mailbox engine for this first version, but that doesn't mean I'm opposed to auxiliary bitboards to speed some things up. My engine just beat a 1,900 human player, but it was with me doing all the time management by adjusting the think time appropriately :) When I just played it myself earlier today, I was able to beat it by concentrating, and I'm only 1,650, so I still have plenty of work to do. I also have an idea of its weaknesses which isn't fair :) Engine was playing black - Stockfish says black move 26 was a blunder:
xr_a_y wrote: ↑Thu Feb 04, 2021 10:19 am
Dumb is very simple and instructive.
Merci pour le compliment.
I just updated a new version of it. Dumb is a minimalist chess program (about 1200 lines of code) but quite strong (last version should reach 2650-2700 Elo on CCRL). I abuse my coding style to make the code more concise, but I hope it is still very readable and to be a very direct translation of the algorithms without too much distracting code.