Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how do you select the engine #8

Open
dax006 opened this issue Mar 14, 2019 · 1 comment
Open

how do you select the engine #8

dax006 opened this issue Mar 14, 2019 · 1 comment

Comments

@dax006
Copy link

dax006 commented Mar 14, 2019

I love the project! What I don't understand is how you hook it up to an engine (Selecting the engine in real time is really cool).

@jtiscione
Copy link
Owner

The engine is a web worker loaded from a separate JS file. They all work the same way- you send a UCI protocol command to it like "position startpos moves e2e4" using postMessage() and get a UCI response like "bestmove g8c6" or whatever in onMessage().
If you look in play.js you see how it's set up in a variable called "engine". If you select a different engine in the dropdown, the code near line 520 will shut down the current engine and set up the new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants