@Rishan001 sorry idk what you mean by without revealing anything in my answer, but basically how it works is it generates a list of legal moves. Then loops through that list, making and undoing each move. Before undoing however the function calls itself again recursively. This goes until a certain preset depth. Then with all those possibilities, it calculates each position's value (mostly in material) and decides what move is best assuming both players try to maximize their own material advantage.
This is legit! How did you do it, without revealing anything in your answer?
@Rishan001 sorry idk what you mean by without revealing anything in my answer, but basically how it works is it generates a list of legal moves. Then loops through that list, making and undoing each move. Before undoing however the function calls itself again recursively. This goes until a certain preset depth. Then with all those possibilities, it calculates each position's value (mostly in material) and decides what move is best assuming both players try to maximize their own material advantage.