{"action":"created","issue":{"url":"https://api.github.com/repos/sfleischman105/Pleco/issues/28","repository_url":"https://api.github.com/repos/sfleischman105/Pleco","labels_url":"https://api.github.com/repos/sfleischman105/Pleco/issues/28/labels{/name}","comments_url":"https://api.github.com/repos/sfleischman105/Pleco/issues/28/comments","events_url":"https://api.github.com/repos/sfleischman105/Pleco/issues/28/events","html_url":"https://github.com/sfleischman105/Pleco/issues/28","id":250187838,"number":28,"title":"Universal Chess Interface support and associated `UCISearcher` Trait.","user":{"login":"sfleischman105","id":27741276,"avatar_url":"https://avatars2.githubusercontent.com/u/27741276?v=4","gravatar_id":"","url":"https://api.github.com/users/sfleischman105","html_url":"https://github.com/sfleischman105","followers_url":"https://api.github.com/users/sfleischman105/followers","following_url":"https://api.github.com/users/sfleischman105/following{/other_user}","gists_url":"https://api.github.com/users/sfleischman105/gists{/gist_id}","starred_url":"https://api.github.com/users/sfleischman105/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sfleischman105/subscriptions","organizations_url":"https://api.github.com/users/sfleischman105/orgs","repos_url":"https://api.github.com/users/sfleischman105/repos","events_url":"https://api.github.com/users/sfleischman105/events{/privacy}","received_events_url":"https://api.github.com/users/sfleischman105/received_events","type":"User","site_admin":false},"labels":[{"id":603397617,"url":"https://api.github.com/repos/sfleischman105/Pleco/labels/enhancement","name":"enhancement","color":"84b6eb","default":true},{"id":603397618,"url":"https://api.github.com/repos/sfleischman105/Pleco/labels/help%20wanted","name":"help wanted","color":"128A0C","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-08-15T00:09:15Z","updated_at":"2017-08-19T06:05:19Z","closed_at":null,"body":"In order to be considered a modern chess engine, Pleco _needs_ to support the Universal Chess Interface (shorthand is UCI) inside of both the engine, as well as the primary searcher. More information about UCI can be found [here](http://wbec-ridderkerk.nl/html/UCIProtocol.html).\r\n\r\nThere are four parts I would like to outline for implementing this.\r\n\r\n### 1) main.rs args\r\nWhen given the command \"uci\" as an argument (or stdin after load), `Engine::uci(...)` should be called, letting the Engine handle it from there.\r\n\r\n### 2) Engine \r\nThe Engine must contain a `Engine::uci(...)` method to allow for communication to and from the GUI. Communication uses stdin and stdout to pass commands back and forth. The command \"isready\" should allow the engine the opportunity to get both a UCI compatible Searcher (more on this later) and a `Board` object ready. The GUI can send in options to the Engine before the game actually begins, starting with the \"setoption\" command. All commands leading up to \"go\" (which starts the game) can be implemented with a simple IO loop.\r\n\r\n### 3) Mid Game Message sending to / from UCI Searcher \r\nWhen the Searcher is in the midst of searching, the Engine must act as an intermediary between the GUI and the Searcher. Mid-search, the GUI should only be able to send the command \"stop\" to the Searcher, which should within reasonable time stop the Search and return the best move found so good. \r\n\r\nSome problems that need to be dealt with in concern of this:\r\n-  How do we allow stdin to be scanned in a separate thread, but without impacting search performance?\r\n-  What type of structure do we need to pass into the UCI Searcher that allows for checking when to stop? \r\n\r\nFurthermore, the Engine needs to be able to do the opposite: Await information from the UCI Searcher and relay that information to the GUI.\r\n\r\n### 4) Implementing the UCISearcher Trait\r\nThe UCISearcher Trait should mark specific Searchers as UCI compatible. Currently, the UCISearcher implementation is the following:\r\n\r\n```\r\npub trait UCISearcher: Searcher {\r\n   fn uci_move(board: Board, timer: &Timer, rx: Arc<Mutex<Option<GuiToEngine>>>) -> BitMove where Self: Sized;\r\n}\r\n```\r\n\r\nSome notes on this:\r\n- Receiver needs to be solidified in uci_move as determined by item 3.\r\n- A Sender needs to be given in somewhere, to allow the chess board to communicate back.\r\n- `fn configuration()' or similar function should allow easily setting up options.\r\n\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/sfleischman105/Pleco/issues/comments/323503486","html_url":"https://github.com/sfleischman105/Pleco/issues/28#issuecomment-323503486","issue_url":"https://api.github.com/repos/sfleischman105/Pleco/issues/28","id":323503486,"user":{"login":"sfleischman105","id":27741276,"avatar_url":"https://avatars2.githubusercontent.com/u/27741276?v=4","gravatar_id":"","url":"https://api.github.com/users/sfleischman105","html_url":"https://github.com/sfleischman105","followers_url":"https://api.github.com/users/sfleischman105/followers","following_url":"https://api.github.com/users/sfleischman105/following{/other_user}","gists_url":"https://api.github.com/users/sfleischman105/gists{/gist_id}","starred_url":"https://api.github.com/users/sfleischman105/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sfleischman105/subscriptions","organizations_url":"https://api.github.com/users/sfleischman105/orgs","repos_url":"https://api.github.com/users/sfleischman105/repos","events_url":"https://api.github.com/users/sfleischman105/events{/privacy}","received_events_url":"https://api.github.com/users/sfleischman105/received_events","type":"User","site_admin":false},"created_at":"2017-08-19T06:05:19Z","updated_at":"2017-08-19T06:05:19Z","body":"Any and all help is appreciated @jbg ! And good idea, I just added an MIT license to the Repo."}}
{"actor":{"display_login":"sfleischman105"}}