Considering the following help to develop search function:
[ ] The function should probably have a signature like: chess.search({maxDepth: 5, maxTime: 5.0}) or something similar.
[ ] A time-based search will need to use iterative deepening to find the best move at shallower depths first.
[ ] We need a piece/square scoring matrix. Right now the engine would probably end up playing something like 1. Nf3 ... 2. Rg1 ... 3. Rh1 ... 4. Rg1 .... Maybe one for king safety and one for all the other pieces? I'd like to avoid bloating the codebase by have one for each piece type.
[ ] Move ordering is critical for maximizing cut-offs in alphabeta, so we'll need to investigate. Most Valuable Victim - Least Valuable Attacker (MVV/LVA) is common approach.
[ ] The search doesn't handle mate or stalemates.
[ ] We'll need a qsearch to keep it from making terrible capture sequences that are beyond the search horizon.
[ ] You can simplify and combine the logic for white and black by negating and swapping the window values during the recursive call to alphabeta (e.g. -alphabeta(depth - 1, -beta, -alpha)). There are some examples of this online.
To get started we'll need the items above! @jhlywa I want to do these items, even if it takes some time.
Considering the following help to develop search function:
chess.search({maxDepth: 5, maxTime: 5.0})
or something similar.1. Nf3 ... 2. Rg1 ... 3. Rh1 ... 4. Rg1 ...
. Maybe one for king safety and one for all the other pieces? I'd like to avoid bloating the codebase by have one for each piece type.-alphabeta(depth - 1, -beta, -alpha)
). There are some examples of this online.To get started we'll need the items above! @jhlywa I want to do these items, even if it takes some time.