{"action":"created","issue":{"url":"https://api.github.com/repos/andrewjmeier/TableTop.JS/issues/92","repository_url":"https://api.github.com/repos/andrewjmeier/TableTop.JS","labels_url":"https://api.github.com/repos/andrewjmeier/TableTop.JS/issues/92/labels{/name}","comments_url":"https://api.github.com/repos/andrewjmeier/TableTop.JS/issues/92/comments","events_url":"https://api.github.com/repos/andrewjmeier/TableTop.JS/issues/92/events","html_url":"https://github.com/andrewjmeier/TableTop.JS/pull/92","id":135594071,"number":92,"title":"Ai","user":{"login":"konnorbeard","id":831834,"avatar_url":"https://avatars.githubusercontent.com/u/831834?v=3","gravatar_id":"","url":"https://api.github.com/users/konnorbeard","html_url":"https://github.com/konnorbeard","followers_url":"https://api.github.com/users/konnorbeard/followers","following_url":"https://api.github.com/users/konnorbeard/following{/other_user}","gists_url":"https://api.github.com/users/konnorbeard/gists{/gist_id}","starred_url":"https://api.github.com/users/konnorbeard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/konnorbeard/subscriptions","organizations_url":"https://api.github.com/users/konnorbeard/orgs","repos_url":"https://api.github.com/users/konnorbeard/repos","events_url":"https://api.github.com/users/konnorbeard/events{/privacy}","received_events_url":"https://api.github.com/users/konnorbeard/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-02-23T01:02:18Z","updated_at":"2016-02-23T01:37:13Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/andrewjmeier/TableTop.JS/pulls/92","html_url":"https://github.com/andrewjmeier/TableTop.JS/pull/92","diff_url":"https://github.com/andrewjmeier/TableTop.JS/pull/92.diff","patch_url":"https://github.com/andrewjmeier/TableTop.JS/pull/92.patch"},"body":"Basic AI package. Currently only works with manualTurn and moveTypeManual. \r\n\r\nHow it works: User enters \"AI\" as one of the player names. When it's AI's turn, we copy the game (cleverly, can't just do a raw copy because object references will still exist, and we can't do a raw JSON create object because we have circular references). Then we iterate through all possible moves and grab the legal ones, then evaluate them on copies of the game object. We then pick the best move, based on a user-defined \"scoreBoard\" function that should live in their game object. \r\n\r\nTodo: \r\n- AI should look > 1 move into future, should prune \r\n- Add different difficulties \r\n- Make it work with placeToken game types\r\n- Test array board type (i tried to generalize but there's probably some bugs in there) \r\n- Display error messages, fail better (ie. if user is using graph board or something we should fail cleaner, not even sure what would happen now, might blow up) \r\n- Add documentation/tutorial on how to use, what limitations are, how to extend \r\n\r\n@andrewjmeier cr "},"comment":{"url":"https://api.github.com/repos/andrewjmeier/TableTop.JS/issues/comments/187466721","html_url":"https://github.com/andrewjmeier/TableTop.JS/pull/92#issuecomment-187466721","issue_url":"https://api.github.com/repos/andrewjmeier/TableTop.JS/issues/92","id":187466721,"user":{"login":"konnorbeard","id":831834,"avatar_url":"https://avatars.githubusercontent.com/u/831834?v=3","gravatar_id":"","url":"https://api.github.com/users/konnorbeard","html_url":"https://github.com/konnorbeard","followers_url":"https://api.github.com/users/konnorbeard/followers","following_url":"https://api.github.com/users/konnorbeard/following{/other_user}","gists_url":"https://api.github.com/users/konnorbeard/gists{/gist_id}","starred_url":"https://api.github.com/users/konnorbeard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/konnorbeard/subscriptions","organizations_url":"https://api.github.com/users/konnorbeard/orgs","repos_url":"https://api.github.com/users/konnorbeard/repos","events_url":"https://api.github.com/users/konnorbeard/events{/privacy}","received_events_url":"https://api.github.com/users/konnorbeard/received_events","type":"User","site_admin":false},"created_at":"2016-02-23T01:37:13Z","updated_at":"2016-02-23T01:37:13Z","body":"weird. do you know what the error was when it crashed? or was it just looping? \r\n\r\nmaybe if it's not manualMove or placeToken then we just have the user hand us a list of proposed moves. that could work nicely. "}}