{"action":"created","comment":{"url":"https://api.github.com/repos/Kotlin-Polytech/KotlinAsFirst2016/pulls/comments/90508051","pull_request_review_id":11027099,"id":90508051,"diff_hunk":"@@ -38,21 +41,92 @@ interface Matrix<E> {\n  * height = высота, width = ширина, e = чем заполнить элементы.\n  * Бросить исключение IllegalArgumentException, если height или width <= 0.\n  */\n-fun <E> createMatrix(height: Int, width: Int, e: E): Matrix<E> = TODO()\n+fun <E> createMatrix(height: Int, width: Int, e: E): Matrix<E> {\n+    if ((width <= 0) || (height <= 0)) throw IllegalArgumentException()\n+    else return MatrixImpl<E>(height, width, e)\n+}\n \n /**\n  * Средняя сложность\n  *\n  * Реализация интерфейса \"матрица\"\n  */\n-class MatrixImpl<E> : Matrix<E> {\n+class MatrixImpl<E>(override val height: Int,\n+                    override val width: Int,\n+                    e: E) : Matrix<E> {\n+\n+    private val map = mutableMapOf<Cell, E>()\n+    init {\n+        for (i in 0..height - 1) {\n+            for (z in 0..width - 1) {\n+                map[Cell(i, z)] = e\n+            }\n+        }\n+    }\n+\n+\n+    val Cell.exist: Boolean\n+        get() = ((this.row <= height) && (this.column <= width))\n+    fun exist(row: Int, column: Int) = ((row <= height) && (column <= width))\n+\n+    override fun get(row: Int, column: Int): E {\n+        if (Cell(row, column).exist)","path":"src/lesson7/task1/Matrix.kt","position":57,"original_position":57,"commit_id":"6a17ec82c0c0b83e7dcb6579dec8fb3dbd2278c3","original_commit_id":"6a17ec82c0c0b83e7dcb6579dec8fb3dbd2278c3","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":"Вы меня здесь не вполне поняли. Оно кидается в вашем собственном коде: \r\n```\r\nreturn map[cell] ?: throw IllegalArgumentException()\r\n```\r\n\r\nMap возвращает `null`, если элемента нет, а ваш элвис-оператор вместо него бросает исключение","created_at":"2016-12-01T18:32:45Z","updated_at":"2016-12-01T18:32:45Z","html_url":"https://github.com/Kotlin-Polytech/KotlinAsFirst2016/pull/234#discussion_r90508051","pull_request_url":"https://api.github.com/repos/Kotlin-Polytech/KotlinAsFirst2016/pulls/234","_links":{"self":{"href":"https://api.github.com/repos/Kotlin-Polytech/KotlinAsFirst2016/pulls/comments/90508051"},"html":{"href":"https://github.com/Kotlin-Polytech/KotlinAsFirst2016/pull/234#discussion_r90508051"},"pull_request":{"href":"https://api.github.com/repos/Kotlin-Polytech/KotlinAsFirst2016/pulls/234"}}},"pull_request":{"url":"https://api.github.com/repos/Kotlin-Polytech/KotlinAsFirst2016/pulls/234","id":95235032,"html_url":"https://github.com/Kotlin-Polytech/KotlinAsFirst2016/pull/234","diff_url":"https://github.com/Kotlin-Polytech/KotlinAsFirst2016/pull/234.diff","patch_url":"https://github.com/Kotlin-Polytech/KotlinAsFirst2016/pull/234.patch","issue_url":"https://api.github.com/repos/Kotlin-Polytech/KotlinAsFirst2016/issues/234","number":234,"state":"open","locked":false,"title":"Lesson6.task1","user":{"login":"avightclav","id":17088276,"avatar_url":"https://avatars.githubusercontent.com/u/17088276?v=3","gravatar_id":"","url":"https://api.github.com/users/avightclav","html_url":"https://github.com/avightclav","followers_url":"https://api.github.com/users/avightclav/followers","following_url":"https://api.github.com/users/avightclav/following{/other_user}","gists_url":"https://api.github.com/users/avightclav/gists{/gist_id}","starred_url":"https://api.github.com/users/avightclav/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/avightclav/subscriptions","organizations_url":"https://api.github.com/users/avightclav/orgs","repos_url":"https://api.github.com/users/avightclav/repos","events_url":"https://api.github.com/users/avightclav/events{/privacy}","received_events_url":"https://api.github.com/users/avightclav/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-11-24T23:47:34Z","updated_at":"2016-12-01T18:32:45Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4baa83fbe21b4146c1127aa7a090d6baa1196c25","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/234/commits","review_comments_url":"https://api.github.com/repos/Kotlin-Polytech/KotlinAsFirst2016/pulls/234/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/234/comments","statuses_url":"https://api.github.com/repos/Kotlin-Polytech/KotlinAsFirst2016/statuses/6a17ec82c0c0b83e7dcb6579dec8fb3dbd2278c3","head":{"label":"avightclav:master","ref":"master","sha":"6a17ec82c0c0b83e7dcb6579dec8fb3dbd2278c3","user":{"login":"avightclav","id":17088276,"avatar_url":"https://avatars.githubusercontent.com/u/17088276?v=3","gravatar_id":"","url":"https://api.github.com/users/avightclav","html_url":"https://github.com/avightclav","followers_url":"https://api.github.com/users/avightclav/followers","following_url":"https://api.github.com/users/avightclav/following{/other_user}","gists_url":"https://api.github.com/users/avightclav/gists{/gist_id}","starred_url":"https://api.github.com/users/avightclav/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/avightclav/subscriptions","organizations_url":"https://api.github.com/users/avightclav/orgs","repos_url":"https://api.github.com/users/avightclav/repos","events_url":"https://api.github.com/users/avightclav/events{/privacy}","received_events_url":"https://api.github.com/users/avightclav/received_events","type":"User","site_admin":false},"repo":{"id":67636969,"name":"KotlinAsFirst2016","full_name":"avightclav/KotlinAsFirst2016","owner":{"login":"avightclav","id":17088276,"avatar_url":"https://avatars.githubusercontent.com/u/17088276?v=3","gravatar_id":"","url":"https://api.github.com/users/avightclav","html_url":"https://github.com/avightclav","followers_url":"https://api.github.com/users/avightclav/followers","following_url":"https://api.github.com/users/avightclav/following{/other_user}","gists_url":"https://api.github.com/users/avightclav/gists{/gist_id}","starred_url":"https://api.github.com/users/avightclav/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/avightclav/subscriptions","organizations_url":"https://api.github.com/users/avightclav/orgs","repos_url":"https://api.github.com/users/avightclav/repos","events_url":"https://api.github.com/users/avightclav/events{/privacy}","received_events_url":"https://api.github.com/users/avightclav/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/avightclav/KotlinAsFirst2016","description":null,"fork":true,"url":"https://api.github.com/repos/avightclav/KotlinAsFirst2016","forks_url":"https://api.github.com/repos/avightclav/KotlinAsFirst2016/forks","keys_url":"https://api.github.com/repos/avightclav/KotlinAsFirst2016/keys{/key_id}","collaborators_url":"https://api.github.com/repos/avightclav/KotlinAsFirst2016/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/avightclav/KotlinAsFirst2016/teams","hooks_url":"https://api.github.com/repos/avightclav/KotlinAsFirst2016/hooks","issue_events_url":"https://api.github.com/repos/avightclav/KotlinAsFirst2016/issues/events{/number}","events_url":"https://api.github.com/repos/avightclav/KotlinAsFirst2016/events","assignees_url":"https://api.github.com/repos/avightclav/KotlinAsFirst2016/assignees{/user}","branches_url":"https://api.github.com/repos/avightclav/KotlinAsFirst2016/branches{/branch}","tags_url":"https://api.github.com/repos/avightclav/KotlinAsFirst2016/tags","blobs_url":"https://api.github.com/repos/avightclav/KotlinAsFirst2016/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/avightclav/KotlinAsFirst2016/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/avightclav/KotlinAsFirst2016/git/refs{/sha}","trees_url":"https://api.github.com/repos/avightclav/KotlinAsFirst2016/git/trees{/sha}","statuses_url":"https://api.github.com/repos/avightclav/KotlinAsFirst2016/statuses/{sha}","languages_url":"https://api.github.com/repos/avightclav/KotlinAsFirst2016/languages","stargazers_url":"https://api.github.com/repos/avightclav/KotlinAsFirst2016/stargazers","contributors_url":"https://api.github.com/repos/avightclav/KotlinAsFirst2016/contributors","subscribers_url":"https://api.github.com/repos/avightclav/KotlinAsFirst2016/subscribers","subscription_url":"https://api.github.com/repos/avightclav/KotlinAsFirst2016/subscription","commits_url":"https://api.github.com/repos/avightclav/KotlinAsFirst2016/commits{/sha}","git_commits_url":"https://api.github.com/repos/avightclav/KotlinAsFirst2016/git/commits{/sha}","comments_url":"https://api.github.com/repos/avightclav/KotlinAsFirst2016/comments{/number}","issue_comment_url":"https://api.github.com/repos/avightclav/KotlinAsFirst2016/issues/comments{/number}","contents_url":"https://api.github.com/repos/avightclav/KotlinAsFirst2016/contents/{+path}","compare_url":"https://api.github.com/repos/avightclav/KotlinAsFirst2016/compare/{base}...{head}","merges_url":"https://api.github.com/repos/avightclav/KotlinAsFirst2016/merges","archive_url":"https://api.github.com/repos/avightclav/KotlinAsFirst2016/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/avightclav/KotlinAsFirst2016/downloads","issues_url":"https://api.github.com/repos/avightclav/KotlinAsFirst2016/issues{/number}","pulls_url":"https://api.github.com/repos/avightclav/KotlinAsFirst2016/pulls{/number}","milestones_url":"https://api.github.com/repos/avightclav/KotlinAsFirst2016/milestones{/number}","notifications_url":"https://api.github.com/repos/avightclav/KotlinAsFirst2016/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/avightclav/KotlinAsFirst2016/labels{/name}","releases_url":"https://api.github.com/repos/avightclav/KotlinAsFirst2016/releases{/id}","deployments_url":"https://api.github.com/repos/avightclav/KotlinAsFirst2016/deployments","created_at":"2016-09-07T19:28:16Z","updated_at":"2016-09-07T19:28:17Z","pushed_at":"2016-11-28T17:27:04Z","git_url":"git://github.com/avightclav/KotlinAsFirst2016.git","ssh_url":"git@github.com:avightclav/KotlinAsFirst2016.git","clone_url":"https://github.com/avightclav/KotlinAsFirst2016.git","svn_url":"https://github.com/avightclav/KotlinAsFirst2016","homepage":null,"size":3240,"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-12-01T17:15:46Z","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":28608,"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/234"},"html":{"href":"https://github.com/Kotlin-Polytech/KotlinAsFirst2016/pull/234"},"issue":{"href":"https://api.github.com/repos/Kotlin-Polytech/KotlinAsFirst2016/issues/234"},"comments":{"href":"https://api.github.com/repos/Kotlin-Polytech/KotlinAsFirst2016/issues/234/comments"},"review_comments":{"href":"https://api.github.com/repos/Kotlin-Polytech/KotlinAsFirst2016/pulls/234/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/234/commits"},"statuses":{"href":"https://api.github.com/repos/Kotlin-Polytech/KotlinAsFirst2016/statuses/6a17ec82c0c0b83e7dcb6579dec8fb3dbd2278c3"}}}}
{"actor":{"display_login":"mglukhikh"}}