{"action":"created","comment":{"url":"https://api.github.com/repos/Kotlin-Polytech/KotlinAsFirst2016/pulls/comments/90193712","pull_request_review_id":10711846,"id":90193712,"diff_hunk":"@@ -182,7 +298,65 @@ fun kingTrajectory(start: Square, end: Square): List<Square> = TODO()\n  * Пример: knightMoveNumber(Square(3, 1), Square(6, 3)) = 3.\n  * Конь может последовательно пройти через клетки (5, 2) и (4, 4) к клетке (6, 3).\n  */\n-fun knightMoveNumber(start: Square, end: Square): Int = TODO()\n+\n+//СОЗДАЕМ ГРАФ С ХОДАМИ КОНЯ\n+fun chessGraph(): Graph {\n+    val chessGraph = Graph()\n+    //СОЗДАЕМ ШАХМАТНУЮ ДОСКУ\n+    for (row in 8 downTo 1) {\n+        for (column in 'a'..'h') {\n+            chessGraph.addVertex(\"$column$row\")\n+        }\n+    }\n+    //СОЕДИНЯЕМ ВСЕ КЛЕТКИ ШАХМАТНОЙ ДОСКИ С ВОЗМОЖНЫМИ ХОДАМИ КОНЯ\n+    for (row in 8 downTo 1) {\n+        for (column in 'a'..'h') {\n+\n+            val rowOne = row - 1\n+            val rowTwo = row - 2\n+            //ДЛЯ СТРОК ОТ 3 ДО 8\n+            if (row > 2) {\n+                //УЧИТЫВАЕМ ГРАНИЦЫ СПРАВА\n+                if (column < 'h') {\n+                    val column2 = column + 1\n+                    chessGraph.connect(\"$column$row\", \"$column2$rowTwo\")\n+                    if (column < 'g') {\n+                        val column3 = column + 2\n+                        chessGraph.connect(\"$column$row\", \"$column3$rowOne\")\n+                    }\n+                }\n+                //УЧИТЫВАЕМ ГРАНИЦЫ СЛЕВА\n+                if (column > 'a') {\n+                    val column4 = column - 1\n+                    chessGraph.connect(\"$column$row\", \"$column4$rowTwo\")\n+                    if (column > 'b') {\n+                        val column5 = column - 2\n+                        chessGraph.connect(\"$column$row\", \"$column5$rowOne\")\n+                    }\n+                }\n+            }\n+            //ДЛЯ ВТОРОГО РЯДА\n+            if (row == 2) {\n+                if (column < 'g') {\n+                    val column3 = column + 2\n+                    chessGraph.connect(\"$column$row\", \"$column3$rowOne\")\n+                }\n+                if (column > 'b') {\n+                    val column5 = column - 2\n+                    chessGraph.connect(\"$column$row\", \"$column5$rowOne\")\n+                }\n+            }\n+        }\n+    }\n+    return chessGraph","path":"src/lesson6/task2/Chess.kt","position":260,"original_position":260,"commit_id":"462f2cc642d3d23db57b2a8e5642c99c7b96972d","original_commit_id":"462f2cc642d3d23db57b2a8e5642c99c7b96972d","user":{"login":"mglukhikh","id":1127631,"avatar_url":"https://avatars.githubusercontent.com/u/1127631?v=3","gravatar_id":"","url":"https://api.github.com/users/mglukhikh","html_url":"https://github.com/mglukhikh","followers_url":"https://api.github.com/users/mglukhikh/followers","following_url":"https://api.github.com/users/mglukhikh/following{/other_user}","gists_url":"https://api.github.com/users/mglukhikh/gists{/gist_id}","starred_url":"https://api.github.com/users/mglukhikh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mglukhikh/subscriptions","organizations_url":"https://api.github.com/users/mglukhikh/orgs","repos_url":"https://api.github.com/users/mglukhikh/repos","events_url":"https://api.github.com/users/mglukhikh/events{/privacy}","received_events_url":"https://api.github.com/users/mglukhikh/received_events","type":"User","site_admin":false},"body":"Вы сумели здесь использовать готовый класс `Graph`. По-своему это хорошо, но обращаю внимание на то, что поиск траектории в этом классе не реализован. Так что для решения `knightTrajectory` -- если соберётесь -- вам придётся либо расширить класс `Graph`, либо реализовать уже свой вариант BFS-алгоритма","created_at":"2016-11-30T09:18:01Z","updated_at":"2016-11-30T09:18:01Z","html_url":"https://github.com/Kotlin-Polytech/KotlinAsFirst2016/pull/229#discussion_r90193712","pull_request_url":"https://api.github.com/repos/Kotlin-Polytech/KotlinAsFirst2016/pulls/229","_links":{"self":{"href":"https://api.github.com/repos/Kotlin-Polytech/KotlinAsFirst2016/pulls/comments/90193712"},"html":{"href":"https://github.com/Kotlin-Polytech/KotlinAsFirst2016/pull/229#discussion_r90193712"},"pull_request":{"href":"https://api.github.com/repos/Kotlin-Polytech/KotlinAsFirst2016/pulls/229"}}},"pull_request":{"url":"https://api.github.com/repos/Kotlin-Polytech/KotlinAsFirst2016/pulls/229","id":95012990,"html_url":"https://github.com/Kotlin-Polytech/KotlinAsFirst2016/pull/229","diff_url":"https://github.com/Kotlin-Polytech/KotlinAsFirst2016/pull/229.diff","patch_url":"https://github.com/Kotlin-Polytech/KotlinAsFirst2016/pull/229.patch","issue_url":"https://api.github.com/repos/Kotlin-Polytech/KotlinAsFirst2016/issues/229","number":229,"state":"open","locked":false,"title":"Lesson6.task2 Hiraev Malik","user":{"login":"Hiraev","id":6796753,"avatar_url":"https://avatars.githubusercontent.com/u/6796753?v=3","gravatar_id":"","url":"https://api.github.com/users/Hiraev","html_url":"https://github.com/Hiraev","followers_url":"https://api.github.com/users/Hiraev/followers","following_url":"https://api.github.com/users/Hiraev/following{/other_user}","gists_url":"https://api.github.com/users/Hiraev/gists{/gist_id}","starred_url":"https://api.github.com/users/Hiraev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Hiraev/subscriptions","organizations_url":"https://api.github.com/users/Hiraev/orgs","repos_url":"https://api.github.com/users/Hiraev/repos","events_url":"https://api.github.com/users/Hiraev/events{/privacy}","received_events_url":"https://api.github.com/users/Hiraev/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-11-23T14:27:26Z","updated_at":"2016-11-30T09:20:40Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2f313846442b08d1be3d40afc54eb0fd7f9c0e71","assignee":{"login":"mglukhikh","id":1127631,"avatar_url":"https://avatars.githubusercontent.com/u/1127631?v=3","gravatar_id":"","url":"https://api.github.com/users/mglukhikh","html_url":"https://github.com/mglukhikh","followers_url":"https://api.github.com/users/mglukhikh/followers","following_url":"https://api.github.com/users/mglukhikh/following{/other_user}","gists_url":"https://api.github.com/users/mglukhikh/gists{/gist_id}","starred_url":"https://api.github.com/users/mglukhikh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mglukhikh/subscriptions","organizations_url":"https://api.github.com/users/mglukhikh/orgs","repos_url":"https://api.github.com/users/mglukhikh/repos","events_url":"https://api.github.com/users/mglukhikh/events{/privacy}","received_events_url":"https://api.github.com/users/mglukhikh/received_events","type":"User","site_admin":false},"assignees":[{"login":"mglukhikh","id":1127631,"avatar_url":"https://avatars.githubusercontent.com/u/1127631?v=3","gravatar_id":"","url":"https://api.github.com/users/mglukhikh","html_url":"https://github.com/mglukhikh","followers_url":"https://api.github.com/users/mglukhikh/followers","following_url":"https://api.github.com/users/mglukhikh/following{/other_user}","gists_url":"https://api.github.com/users/mglukhikh/gists{/gist_id}","starred_url":"https://api.github.com/users/mglukhikh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mglukhikh/subscriptions","organizations_url":"https://api.github.com/users/mglukhikh/orgs","repos_url":"https://api.github.com/users/mglukhikh/repos","events_url":"https://api.github.com/users/mglukhikh/events{/privacy}","received_events_url":"https://api.github.com/users/mglukhikh/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/Kotlin-Polytech/KotlinAsFirst2016/pulls/229/commits","review_comments_url":"https://api.github.com/repos/Kotlin-Polytech/KotlinAsFirst2016/pulls/229/comments","review_comment_url":"https://api.github.com/repos/Kotlin-Polytech/KotlinAsFirst2016/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Kotlin-Polytech/KotlinAsFirst2016/issues/229/comments","statuses_url":"https://api.github.com/repos/Kotlin-Polytech/KotlinAsFirst2016/statuses/462f2cc642d3d23db57b2a8e5642c99c7b96972d","head":{"label":"Hiraev:master","ref":"master","sha":"462f2cc642d3d23db57b2a8e5642c99c7b96972d","user":{"login":"Hiraev","id":6796753,"avatar_url":"https://avatars.githubusercontent.com/u/6796753?v=3","gravatar_id":"","url":"https://api.github.com/users/Hiraev","html_url":"https://github.com/Hiraev","followers_url":"https://api.github.com/users/Hiraev/followers","following_url":"https://api.github.com/users/Hiraev/following{/other_user}","gists_url":"https://api.github.com/users/Hiraev/gists{/gist_id}","starred_url":"https://api.github.com/users/Hiraev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Hiraev/subscriptions","organizations_url":"https://api.github.com/users/Hiraev/orgs","repos_url":"https://api.github.com/users/Hiraev/repos","events_url":"https://api.github.com/users/Hiraev/events{/privacy}","received_events_url":"https://api.github.com/users/Hiraev/received_events","type":"User","site_admin":false},"repo":{"id":67544089,"name":"KotlinAsFirst2016","full_name":"Hiraev/KotlinAsFirst2016","owner":{"login":"Hiraev","id":6796753,"avatar_url":"https://avatars.githubusercontent.com/u/6796753?v=3","gravatar_id":"","url":"https://api.github.com/users/Hiraev","html_url":"https://github.com/Hiraev","followers_url":"https://api.github.com/users/Hiraev/followers","following_url":"https://api.github.com/users/Hiraev/following{/other_user}","gists_url":"https://api.github.com/users/Hiraev/gists{/gist_id}","starred_url":"https://api.github.com/users/Hiraev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Hiraev/subscriptions","organizations_url":"https://api.github.com/users/Hiraev/orgs","repos_url":"https://api.github.com/users/Hiraev/repos","events_url":"https://api.github.com/users/Hiraev/events{/privacy}","received_events_url":"https://api.github.com/users/Hiraev/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Hiraev/KotlinAsFirst2016","description":null,"fork":true,"url":"https://api.github.com/repos/Hiraev/KotlinAsFirst2016","forks_url":"https://api.github.com/repos/Hiraev/KotlinAsFirst2016/forks","keys_url":"https://api.github.com/repos/Hiraev/KotlinAsFirst2016/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Hiraev/KotlinAsFirst2016/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Hiraev/KotlinAsFirst2016/teams","hooks_url":"https://api.github.com/repos/Hiraev/KotlinAsFirst2016/hooks","issue_events_url":"https://api.github.com/repos/Hiraev/KotlinAsFirst2016/issues/events{/number}","events_url":"https://api.github.com/repos/Hiraev/KotlinAsFirst2016/events","assignees_url":"https://api.github.com/repos/Hiraev/KotlinAsFirst2016/assignees{/user}","branches_url":"https://api.github.com/repos/Hiraev/KotlinAsFirst2016/branches{/branch}","tags_url":"https://api.github.com/repos/Hiraev/KotlinAsFirst2016/tags","blobs_url":"https://api.github.com/repos/Hiraev/KotlinAsFirst2016/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Hiraev/KotlinAsFirst2016/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Hiraev/KotlinAsFirst2016/git/refs{/sha}","trees_url":"https://api.github.com/repos/Hiraev/KotlinAsFirst2016/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Hiraev/KotlinAsFirst2016/statuses/{sha}","languages_url":"https://api.github.com/repos/Hiraev/KotlinAsFirst2016/languages","stargazers_url":"https://api.github.com/repos/Hiraev/KotlinAsFirst2016/stargazers","contributors_url":"https://api.github.com/repos/Hiraev/KotlinAsFirst2016/contributors","subscribers_url":"https://api.github.com/repos/Hiraev/KotlinAsFirst2016/subscribers","subscription_url":"https://api.github.com/repos/Hiraev/KotlinAsFirst2016/subscription","commits_url":"https://api.github.com/repos/Hiraev/KotlinAsFirst2016/commits{/sha}","git_commits_url":"https://api.github.com/repos/Hiraev/KotlinAsFirst2016/git/commits{/sha}","comments_url":"https://api.github.com/repos/Hiraev/KotlinAsFirst2016/comments{/number}","issue_comment_url":"https://api.github.com/repos/Hiraev/KotlinAsFirst2016/issues/comments{/number}","contents_url":"https://api.github.com/repos/Hiraev/KotlinAsFirst2016/contents/{+path}","compare_url":"https://api.github.com/repos/Hiraev/KotlinAsFirst2016/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Hiraev/KotlinAsFirst2016/merges","archive_url":"https://api.github.com/repos/Hiraev/KotlinAsFirst2016/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Hiraev/KotlinAsFirst2016/downloads","issues_url":"https://api.github.com/repos/Hiraev/KotlinAsFirst2016/issues{/number}","pulls_url":"https://api.github.com/repos/Hiraev/KotlinAsFirst2016/pulls{/number}","milestones_url":"https://api.github.com/repos/Hiraev/KotlinAsFirst2016/milestones{/number}","notifications_url":"https://api.github.com/repos/Hiraev/KotlinAsFirst2016/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Hiraev/KotlinAsFirst2016/labels{/name}","releases_url":"https://api.github.com/repos/Hiraev/KotlinAsFirst2016/releases{/id}","deployments_url":"https://api.github.com/repos/Hiraev/KotlinAsFirst2016/deployments","created_at":"2016-09-06T20:27:20Z","updated_at":"2016-09-06T20:27:22Z","pushed_at":"2016-11-30T00:03:48Z","git_url":"git://github.com/Hiraev/KotlinAsFirst2016.git","ssh_url":"git@github.com:Hiraev/KotlinAsFirst2016.git","clone_url":"https://github.com/Hiraev/KotlinAsFirst2016.git","svn_url":"https://github.com/Hiraev/KotlinAsFirst2016","homepage":null,"size":449,"stargazers_count":0,"watchers_count":0,"language":"Kotlin","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"Kotlin-Polytech:master","ref":"master","sha":"9d8f9b04aa0b19af6418546d16db452ec336da98","user":{"login":"Kotlin-Polytech","id":20967488,"avatar_url":"https://avatars.githubusercontent.com/u/20967488?v=3","gravatar_id":"","url":"https://api.github.com/users/Kotlin-Polytech","html_url":"https://github.com/Kotlin-Polytech","followers_url":"https://api.github.com/users/Kotlin-Polytech/followers","following_url":"https://api.github.com/users/Kotlin-Polytech/following{/other_user}","gists_url":"https://api.github.com/users/Kotlin-Polytech/gists{/gist_id}","starred_url":"https://api.github.com/users/Kotlin-Polytech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kotlin-Polytech/subscriptions","organizations_url":"https://api.github.com/users/Kotlin-Polytech/orgs","repos_url":"https://api.github.com/users/Kotlin-Polytech/repos","events_url":"https://api.github.com/users/Kotlin-Polytech/events{/privacy}","received_events_url":"https://api.github.com/users/Kotlin-Polytech/received_events","type":"Organization","site_admin":false},"repo":{"id":67405509,"name":"KotlinAsFirst2016","full_name":"Kotlin-Polytech/KotlinAsFirst2016","owner":{"login":"Kotlin-Polytech","id":20967488,"avatar_url":"https://avatars.githubusercontent.com/u/20967488?v=3","gravatar_id":"","url":"https://api.github.com/users/Kotlin-Polytech","html_url":"https://github.com/Kotlin-Polytech","followers_url":"https://api.github.com/users/Kotlin-Polytech/followers","following_url":"https://api.github.com/users/Kotlin-Polytech/following{/other_user}","gists_url":"https://api.github.com/users/Kotlin-Polytech/gists{/gist_id}","starred_url":"https://api.github.com/users/Kotlin-Polytech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kotlin-Polytech/subscriptions","organizations_url":"https://api.github.com/users/Kotlin-Polytech/orgs","repos_url":"https://api.github.com/users/Kotlin-Polytech/repos","events_url":"https://api.github.com/users/Kotlin-Polytech/events{/privacy}","received_events_url":"https://api.github.com/users/Kotlin-Polytech/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Kotlin-Polytech/KotlinAsFirst2016","description":null,"fork":false,"url":"https://api.github.com/repos/Kotlin-Polytech/KotlinAsFirst2016","forks_url":"https://api.github.com/repos/Kotlin-Polytech/KotlinAsFirst2016/forks","keys_url":"https://api.github.com/repos/Kotlin-Polytech/KotlinAsFirst2016/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Kotlin-Polytech/KotlinAsFirst2016/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Kotlin-Polytech/KotlinAsFirst2016/teams","hooks_url":"https://api.github.com/repos/Kotlin-Polytech/KotlinAsFirst2016/hooks","issue_events_url":"https://api.github.com/repos/Kotlin-Polytech/KotlinAsFirst2016/issues/events{/number}","events_url":"https://api.github.com/repos/Kotlin-Polytech/KotlinAsFirst2016/events","assignees_url":"https://api.github.com/repos/Kotlin-Polytech/KotlinAsFirst2016/assignees{/user}","branches_url":"https://api.github.com/repos/Kotlin-Polytech/KotlinAsFirst2016/branches{/branch}","tags_url":"https://api.github.com/repos/Kotlin-Polytech/KotlinAsFirst2016/tags","blobs_url":"https://api.github.com/repos/Kotlin-Polytech/KotlinAsFirst2016/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Kotlin-Polytech/KotlinAsFirst2016/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Kotlin-Polytech/KotlinAsFirst2016/git/refs{/sha}","trees_url":"https://api.github.com/repos/Kotlin-Polytech/KotlinAsFirst2016/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Kotlin-Polytech/KotlinAsFirst2016/statuses/{sha}","languages_url":"https://api.github.com/repos/Kotlin-Polytech/KotlinAsFirst2016/languages","stargazers_url":"https://api.github.com/repos/Kotlin-Polytech/KotlinAsFirst2016/stargazers","contributors_url":"https://api.github.com/repos/Kotlin-Polytech/KotlinAsFirst2016/contributors","subscribers_url":"https://api.github.com/repos/Kotlin-Polytech/KotlinAsFirst2016/subscribers","subscription_url":"https://api.github.com/repos/Kotlin-Polytech/KotlinAsFirst2016/subscription","commits_url":"https://api.github.com/repos/Kotlin-Polytech/KotlinAsFirst2016/commits{/sha}","git_commits_url":"https://api.github.com/repos/Kotlin-Polytech/KotlinAsFirst2016/git/commits{/sha}","comments_url":"https://api.github.com/repos/Kotlin-Polytech/KotlinAsFirst2016/comments{/number}","issue_comment_url":"https://api.github.com/repos/Kotlin-Polytech/KotlinAsFirst2016/issues/comments{/number}","contents_url":"https://api.github.com/repos/Kotlin-Polytech/KotlinAsFirst2016/contents/{+path}","compare_url":"https://api.github.com/repos/Kotlin-Polytech/KotlinAsFirst2016/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Kotlin-Polytech/KotlinAsFirst2016/merges","archive_url":"https://api.github.com/repos/Kotlin-Polytech/KotlinAsFirst2016/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Kotlin-Polytech/KotlinAsFirst2016/downloads","issues_url":"https://api.github.com/repos/Kotlin-Polytech/KotlinAsFirst2016/issues{/number}","pulls_url":"https://api.github.com/repos/Kotlin-Polytech/KotlinAsFirst2016/pulls{/number}","milestones_url":"https://api.github.com/repos/Kotlin-Polytech/KotlinAsFirst2016/milestones{/number}","notifications_url":"https://api.github.com/repos/Kotlin-Polytech/KotlinAsFirst2016/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Kotlin-Polytech/KotlinAsFirst2016/labels{/name}","releases_url":"https://api.github.com/repos/Kotlin-Polytech/KotlinAsFirst2016/releases{/id}","deployments_url":"https://api.github.com/repos/Kotlin-Polytech/KotlinAsFirst2016/deployments","created_at":"2016-09-05T09:06:26Z","updated_at":"2016-11-27T20:27:53Z","pushed_at":"2016-11-30T09:22:59Z","git_url":"git://github.com/Kotlin-Polytech/KotlinAsFirst2016.git","ssh_url":"git@github.com:Kotlin-Polytech/KotlinAsFirst2016.git","clone_url":"https://github.com/Kotlin-Polytech/KotlinAsFirst2016.git","svn_url":"https://github.com/Kotlin-Polytech/KotlinAsFirst2016","homepage":null,"size":28473,"stargazers_count":18,"watchers_count":18,"language":"Kotlin","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":100,"mirror_url":null,"open_issues_count":82,"forks":100,"open_issues":82,"watchers":18,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Kotlin-Polytech/KotlinAsFirst2016/pulls/229"},"html":{"href":"https://github.com/Kotlin-Polytech/KotlinAsFirst2016/pull/229"},"issue":{"href":"https://api.github.com/repos/Kotlin-Polytech/KotlinAsFirst2016/issues/229"},"comments":{"href":"https://api.github.com/repos/Kotlin-Polytech/KotlinAsFirst2016/issues/229/comments"},"review_comments":{"href":"https://api.github.com/repos/Kotlin-Polytech/KotlinAsFirst2016/pulls/229/comments"},"review_comment":{"href":"https://api.github.com/repos/Kotlin-Polytech/KotlinAsFirst2016/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Kotlin-Polytech/KotlinAsFirst2016/pulls/229/commits"},"statuses":{"href":"https://api.github.com/repos/Kotlin-Polytech/KotlinAsFirst2016/statuses/462f2cc642d3d23db57b2a8e5642c99c7b96972d"}}}}
{"actor":{"display_login":"mglukhikh"}}