Oremiro / Stockfish.NET

Interloop with Stockfish chess engine in c# language on .net platform
MIT License
23 stars 15 forks source link

fixed isReady method #7

Closed floydian closed 3 years ago

floydian commented 3 years ago

The isReady method did not make use of MAX_TRIES and never incremented tries. There was no path that would allow the while loop to complete even one full iteration. Now, isReady will correctly try for the "readok" signal up to MAX_TRIES times. The function never returns false. It either returns true or throws a MaxTriesException.

A further change in the code would be beneficial: remove all of the if(!isReady()) conditionals and simply invoke isReady();. An exception will be thrown if not ready. Otherwise, code execution simply moves on to the next line.

Oremiro commented 3 years ago

Thank you for your participation, I am sorry I could not have revived PR earlier)

floydian commented 3 years ago

You're welcome. No worries about timing. There was no rush!

On Thu, Aug 12, 2021 at 8:27 AM, Yaroslav @.***> wrote:

Thank you for your participation, I am sorry I could not have revived PR earlier)

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.