Using stockfish for a chess program. It gives the same moves every time for any position. It even opens with the same moves.
I'm using the python-chess library for communicating with stockfish I'm not sure if that's where the issue lies or if it's something else.
engine = chess.engine.SimpleEngine.popen_uci(
r"engine/stockfish_14.1_win_x64_popcnt/stockfish_14.1_win_x64_popcnt.exe")
About the OP's comment
" chess engines that players play against like on chess.com play various moves, especially in the opening. I realize that this may not be an inbuilt feature of the engine itself, is there a good way to implement this? "
You could pass
multipv
option, likemaybe eliminate blunders (set e.g.
thresh = 100
and decrese to make engine play stronger)and pick a move at random
This way you wouldn't have to mess with opening books and you can throttle the strength of the engine a bit :)
Ok, I'm going to test it now, to see what value of
thresh
I can beat ...