Ok, so I am trying to make an engine to calculate chess moves. I've already got the chess game, so the first step for the engine would be calculating all possible moves. So, i did that, but each time i run my program, it gives a different output. I've spent the whole day trying to debug this, but i cant. Here are some of my observations:
- Some moves always show 0 for how many moves there are down the line, such as h2h4
- Others just float around the expected number, sometimes a bit lower, sometimes on the expected number. It increases or decreases by around 20, indicating some branches are probably being cutoff
- when I try to debug something by, say, only generating the moves down the line for h2h4, it magically works and outputs the expected number
I am 99.9% sure the problem is in the search.rs file, but i dont even know anymore.
The project is available at https://github.com/LeandroVandari/Chess.git
Any help would be much appreciated, even if it is a suggestion on why i should scrape and rewrite the whole thing :p, i just wanna get this solved