{"action":"created","comment":{"url":"https://api.github.com/repos/Kotlin-Polytech/KotlinAsFirst2016/pulls/comments/79316226","id":79316226,"diff_hunk":"@@ -89,4 +118,10 @@ fun triangleKind(a: Double, b: Double, c: Double): Int = TODO()\n  * Найти длину пересечения отрезков AB и CD.\n  * Если пересечения нет, вернуть -1.\n  */\n-fun segmentLength(a: Int, b: Int, c: Int, d: Int): Int = TODO()\n\\ No newline at end of file\n+fun segmentLength(a: Int, b: Int, c: Int, d: Int): Int  {\n+    if(c<=b&&c>=a&&d>=b) return (Math.abs(b-c))\n+    else if (c<=a&&d<=b&&d>=a)return (Math.abs(d-a))\n+    else if (d<=b&&d>=a&&c<=b&&c>=a)return (Math.abs(d-c))\n+    else if (b<=d&&b>=c&&a<=d&&a>=c)return (Math.abs(b-a))\n+    else return (-1)","path":"src/lesson2/task1/IfElse.kt","position":85,"original_position":85,"commit_id":"31ffe5cb217a9b4f4b123fdb631872a9eaa4812f","original_commit_id":"31ffe5cb217a9b4f4b123fdb631872a9eaa4812f","user":{"login":"maximpetrov","id":2346982,"avatar_url":"https://avatars.githubusercontent.com/u/2346982?v=3","gravatar_id":"","url":"https://api.github.com/users/maximpetrov","html_url":"https://github.com/maximpetrov","followers_url":"https://api.github.com/users/maximpetrov/followers","following_url":"https://api.github.com/users/maximpetrov/following{/other_user}","gists_url":"https://api.github.com/users/maximpetrov/gists{/gist_id}","starred_url":"https://api.github.com/users/maximpetrov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maximpetrov/subscriptions","organizations_url":"https://api.github.com/users/maximpetrov/orgs","repos_url":"https://api.github.com/users/maximpetrov/repos","events_url":"https://api.github.com/users/maximpetrov/events{/privacy}","received_events_url":"https://api.github.com/users/maximpetrov/received_events","type":"User","site_admin":false},"body":"- Модуль от разности брать нет необходимости, ведь итак известно, какая из точек правее, а какая левее.\r\n- Возвращаемое значение не нужно заключать в скобки.","created_at":"2016-09-18T22:12:34Z","updated_at":"2016-09-18T22:12:34Z","html_url":"https://github.com/Kotlin-Polytech/KotlinAsFirst2016/pull/80#discussion_r79316226","pull_request_url":"https://api.github.com/repos/Kotlin-Polytech/KotlinAsFirst2016/pulls/80","_links":{"self":{"href":"https://api.github.com/repos/Kotlin-Polytech/KotlinAsFirst2016/pulls/comments/79316226"},"html":{"href":"https://github.com/Kotlin-Polytech/KotlinAsFirst2016/pull/80#discussion_r79316226"},"pull_request":{"href":"https://api.github.com/repos/Kotlin-Polytech/KotlinAsFirst2016/pulls/80"}}},"pull_request":{"url":"https://api.github.com/repos/Kotlin-Polytech/KotlinAsFirst2016/pulls/80","id":85685845,"html_url":"https://github.com/Kotlin-Polytech/KotlinAsFirst2016/pull/80","diff_url":"https://github.com/Kotlin-Polytech/KotlinAsFirst2016/pull/80.diff","patch_url":"https://github.com/Kotlin-Polytech/KotlinAsFirst2016/pull/80.patch","issue_url":"https://api.github.com/repos/Kotlin-Polytech/KotlinAsFirst2016/issues/80","number":80,"state":"open","locked":false,"title":"Lesson1,2_Task1","user":{"login":"AlexanderKuptsov","id":22057988,"avatar_url":"https://avatars.githubusercontent.com/u/22057988?v=3","gravatar_id":"","url":"https://api.github.com/users/AlexanderKuptsov","html_url":"https://github.com/AlexanderKuptsov","followers_url":"https://api.github.com/users/AlexanderKuptsov/followers","following_url":"https://api.github.com/users/AlexanderKuptsov/following{/other_user}","gists_url":"https://api.github.com/users/AlexanderKuptsov/gists{/gist_id}","starred_url":"https://api.github.com/users/AlexanderKuptsov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlexanderKuptsov/subscriptions","organizations_url":"https://api.github.com/users/AlexanderKuptsov/orgs","repos_url":"https://api.github.com/users/AlexanderKuptsov/repos","events_url":"https://api.github.com/users/AlexanderKuptsov/events{/privacy}","received_events_url":"https://api.github.com/users/AlexanderKuptsov/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-09-17T20:18:32Z","updated_at":"2016-09-18T22:40:09Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a50089d67878128a92b0786427830515a067fe3c","assignee":{"login":"maximpetrov","id":2346982,"avatar_url":"https://avatars.githubusercontent.com/u/2346982?v=3","gravatar_id":"","url":"https://api.github.com/users/maximpetrov","html_url":"https://github.com/maximpetrov","followers_url":"https://api.github.com/users/maximpetrov/followers","following_url":"https://api.github.com/users/maximpetrov/following{/other_user}","gists_url":"https://api.github.com/users/maximpetrov/gists{/gist_id}","starred_url":"https://api.github.com/users/maximpetrov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maximpetrov/subscriptions","organizations_url":"https://api.github.com/users/maximpetrov/orgs","repos_url":"https://api.github.com/users/maximpetrov/repos","events_url":"https://api.github.com/users/maximpetrov/events{/privacy}","received_events_url":"https://api.github.com/users/maximpetrov/received_events","type":"User","site_admin":false},"assignees":[{"login":"maximpetrov","id":2346982,"avatar_url":"https://avatars.githubusercontent.com/u/2346982?v=3","gravatar_id":"","url":"https://api.github.com/users/maximpetrov","html_url":"https://github.com/maximpetrov","followers_url":"https://api.github.com/users/maximpetrov/followers","following_url":"https://api.github.com/users/maximpetrov/following{/other_user}","gists_url":"https://api.github.com/users/maximpetrov/gists{/gist_id}","starred_url":"https://api.github.com/users/maximpetrov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maximpetrov/subscriptions","organizations_url":"https://api.github.com/users/maximpetrov/orgs","repos_url":"https://api.github.com/users/maximpetrov/repos","events_url":"https://api.github.com/users/maximpetrov/events{/privacy}","received_events_url":"https://api.github.com/users/maximpetrov/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/Kotlin-Polytech/KotlinAsFirst2016/pulls/80/commits","review_comments_url":"https://api.github.com/repos/Kotlin-Polytech/KotlinAsFirst2016/pulls/80/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/80/comments","statuses_url":"https://api.github.com/repos/Kotlin-Polytech/KotlinAsFirst2016/statuses/31ffe5cb217a9b4f4b123fdb631872a9eaa4812f","head":{"label":"AlexanderKuptsov:master","ref":"master","sha":"31ffe5cb217a9b4f4b123fdb631872a9eaa4812f","user":{"login":"AlexanderKuptsov","id":22057988,"avatar_url":"https://avatars.githubusercontent.com/u/22057988?v=3","gravatar_id":"","url":"https://api.github.com/users/AlexanderKuptsov","html_url":"https://github.com/AlexanderKuptsov","followers_url":"https://api.github.com/users/AlexanderKuptsov/followers","following_url":"https://api.github.com/users/AlexanderKuptsov/following{/other_user}","gists_url":"https://api.github.com/users/AlexanderKuptsov/gists{/gist_id}","starred_url":"https://api.github.com/users/AlexanderKuptsov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlexanderKuptsov/subscriptions","organizations_url":"https://api.github.com/users/AlexanderKuptsov/orgs","repos_url":"https://api.github.com/users/AlexanderKuptsov/repos","events_url":"https://api.github.com/users/AlexanderKuptsov/events{/privacy}","received_events_url":"https://api.github.com/users/AlexanderKuptsov/received_events","type":"User","site_admin":false},"repo":{"id":67636281,"name":"KotlinAsFirst2016","full_name":"AlexanderKuptsov/KotlinAsFirst2016","owner":{"login":"AlexanderKuptsov","id":22057988,"avatar_url":"https://avatars.githubusercontent.com/u/22057988?v=3","gravatar_id":"","url":"https://api.github.com/users/AlexanderKuptsov","html_url":"https://github.com/AlexanderKuptsov","followers_url":"https://api.github.com/users/AlexanderKuptsov/followers","following_url":"https://api.github.com/users/AlexanderKuptsov/following{/other_user}","gists_url":"https://api.github.com/users/AlexanderKuptsov/gists{/gist_id}","starred_url":"https://api.github.com/users/AlexanderKuptsov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlexanderKuptsov/subscriptions","organizations_url":"https://api.github.com/users/AlexanderKuptsov/orgs","repos_url":"https://api.github.com/users/AlexanderKuptsov/repos","events_url":"https://api.github.com/users/AlexanderKuptsov/events{/privacy}","received_events_url":"https://api.github.com/users/AlexanderKuptsov/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/AlexanderKuptsov/KotlinAsFirst2016","description":null,"fork":true,"url":"https://api.github.com/repos/AlexanderKuptsov/KotlinAsFirst2016","forks_url":"https://api.github.com/repos/AlexanderKuptsov/KotlinAsFirst2016/forks","keys_url":"https://api.github.com/repos/AlexanderKuptsov/KotlinAsFirst2016/keys{/key_id}","collaborators_url":"https://api.github.com/repos/AlexanderKuptsov/KotlinAsFirst2016/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/AlexanderKuptsov/KotlinAsFirst2016/teams","hooks_url":"https://api.github.com/repos/AlexanderKuptsov/KotlinAsFirst2016/hooks","issue_events_url":"https://api.github.com/repos/AlexanderKuptsov/KotlinAsFirst2016/issues/events{/number}","events_url":"https://api.github.com/repos/AlexanderKuptsov/KotlinAsFirst2016/events","assignees_url":"https://api.github.com/repos/AlexanderKuptsov/KotlinAsFirst2016/assignees{/user}","branches_url":"https://api.github.com/repos/AlexanderKuptsov/KotlinAsFirst2016/branches{/branch}","tags_url":"https://api.github.com/repos/AlexanderKuptsov/KotlinAsFirst2016/tags","blobs_url":"https://api.github.com/repos/AlexanderKuptsov/KotlinAsFirst2016/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/AlexanderKuptsov/KotlinAsFirst2016/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/AlexanderKuptsov/KotlinAsFirst2016/git/refs{/sha}","trees_url":"https://api.github.com/repos/AlexanderKuptsov/KotlinAsFirst2016/git/trees{/sha}","statuses_url":"https://api.github.com/repos/AlexanderKuptsov/KotlinAsFirst2016/statuses/{sha}","languages_url":"https://api.github.com/repos/AlexanderKuptsov/KotlinAsFirst2016/languages","stargazers_url":"https://api.github.com/repos/AlexanderKuptsov/KotlinAsFirst2016/stargazers","contributors_url":"https://api.github.com/repos/AlexanderKuptsov/KotlinAsFirst2016/contributors","subscribers_url":"https://api.github.com/repos/AlexanderKuptsov/KotlinAsFirst2016/subscribers","subscription_url":"https://api.github.com/repos/AlexanderKuptsov/KotlinAsFirst2016/subscription","commits_url":"https://api.github.com/repos/AlexanderKuptsov/KotlinAsFirst2016/commits{/sha}","git_commits_url":"https://api.github.com/repos/AlexanderKuptsov/KotlinAsFirst2016/git/commits{/sha}","comments_url":"https://api.github.com/repos/AlexanderKuptsov/KotlinAsFirst2016/comments{/number}","issue_comment_url":"https://api.github.com/repos/AlexanderKuptsov/KotlinAsFirst2016/issues/comments{/number}","contents_url":"https://api.github.com/repos/AlexanderKuptsov/KotlinAsFirst2016/contents/{+path}","compare_url":"https://api.github.com/repos/AlexanderKuptsov/KotlinAsFirst2016/compare/{base}...{head}","merges_url":"https://api.github.com/repos/AlexanderKuptsov/KotlinAsFirst2016/merges","archive_url":"https://api.github.com/repos/AlexanderKuptsov/KotlinAsFirst2016/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/AlexanderKuptsov/KotlinAsFirst2016/downloads","issues_url":"https://api.github.com/repos/AlexanderKuptsov/KotlinAsFirst2016/issues{/number}","pulls_url":"https://api.github.com/repos/AlexanderKuptsov/KotlinAsFirst2016/pulls{/number}","milestones_url":"https://api.github.com/repos/AlexanderKuptsov/KotlinAsFirst2016/milestones{/number}","notifications_url":"https://api.github.com/repos/AlexanderKuptsov/KotlinAsFirst2016/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/AlexanderKuptsov/KotlinAsFirst2016/labels{/name}","releases_url":"https://api.github.com/repos/AlexanderKuptsov/KotlinAsFirst2016/releases{/id}","deployments_url":"https://api.github.com/repos/AlexanderKuptsov/KotlinAsFirst2016/deployments","created_at":"2016-09-07T19:17:48Z","updated_at":"2016-09-07T19:17:50Z","pushed_at":"2016-09-18T14:59:32Z","git_url":"git://github.com/AlexanderKuptsov/KotlinAsFirst2016.git","ssh_url":"git@github.com:AlexanderKuptsov/KotlinAsFirst2016.git","clone_url":"https://github.com/AlexanderKuptsov/KotlinAsFirst2016.git","svn_url":"https://github.com/AlexanderKuptsov/KotlinAsFirst2016","homepage":null,"size":3065,"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":"24241ff0f5c1f03f8650d0e75de6dd0c3366d86c","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-09-18T20:47:07Z","pushed_at":"2016-09-18T20:18:58Z","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":4475,"stargazers_count":8,"watchers_count":8,"language":"Kotlin","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":86,"mirror_url":null,"open_issues_count":28,"forks":86,"open_issues":28,"watchers":8,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Kotlin-Polytech/KotlinAsFirst2016/pulls/80"},"html":{"href":"https://github.com/Kotlin-Polytech/KotlinAsFirst2016/pull/80"},"issue":{"href":"https://api.github.com/repos/Kotlin-Polytech/KotlinAsFirst2016/issues/80"},"comments":{"href":"https://api.github.com/repos/Kotlin-Polytech/KotlinAsFirst2016/issues/80/comments"},"review_comments":{"href":"https://api.github.com/repos/Kotlin-Polytech/KotlinAsFirst2016/pulls/80/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/80/commits"},"statuses":{"href":"https://api.github.com/repos/Kotlin-Polytech/KotlinAsFirst2016/statuses/31ffe5cb217a9b4f4b123fdb631872a9eaa4812f"}}}}
{"actor":{"display_login":"maximpetrov"}}