{"action":"created","comment":{"url":"https://api.github.com/repos/mglukhikh/kilosophers/pulls/comments/189875019","pull_request_review_id":122136314,"id":189875019,"diff_hunk":"@@ -0,0 +1,35 @@\n+package com.github.servb.kotlin.kilosophers\n+\n+fun main(args: Array<String>) {\n+    val n = 5\n+    val eatStat = IntArray(n, { 0 })\n+    var table = Table(n)\n+\n+    var tick = 0\n+    while (true) {\n+        for (i in table.kilosophers.indices) {\n+            val nowKilosopher = table.kilosophers[i]\n+            nowKilosopher.act(100)\n+\n+            if (nowKilosopher.state == MyKilosopher.State.EATS) {\n+                ++eatStat[i]\n+                println(\"$tick: $i eats! Stats: ${eatStat.joinToString(\" \")}.\")\n+            }\n+        }\n+\n+        if (table.isLocked) {\n+            if (tick == 1) {  // TODO: Fix this workaround\n+                table = Table(n)\n+                tick = 0\n+            } else {\n+                throw IllegalStateException(\"Have a lock: everybody waits. Tick: $tick.\")\n+            }\n+        }\n+\n+        Thread.sleep(500)","path":"src/main/kotlin/com/github/servb/kotlin/kilosophers/Runner.kt","position":null,"original_position":29,"commit_id":"8b35317c049c589692bff38a3c6ec692bcea2c1e","original_commit_id":"ff10d14b02e54be4de3f9a6b2a2a72b3acf7d62f","user":{"login":"SerVB","id":20105593,"avatar_url":"https://avatars2.githubusercontent.com/u/20105593?v=4","gravatar_id":"","url":"https://api.github.com/users/SerVB","html_url":"https://github.com/SerVB","followers_url":"https://api.github.com/users/SerVB/followers","following_url":"https://api.github.com/users/SerVB/following{/other_user}","gists_url":"https://api.github.com/users/SerVB/gists{/gist_id}","starred_url":"https://api.github.com/users/SerVB/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SerVB/subscriptions","organizations_url":"https://api.github.com/users/SerVB/orgs","repos_url":"https://api.github.com/users/SerVB/repos","events_url":"https://api.github.com/users/SerVB/events{/privacy}","received_events_url":"https://api.github.com/users/SerVB/received_events","type":"User","site_admin":false},"body":"Вы имеете в виду, что надо просто убрать эту строку?","created_at":"2018-05-22T12:05:41Z","updated_at":"2018-05-22T12:05:41Z","html_url":"https://github.com/mglukhikh/kilosophers/pull/1#discussion_r189875019","pull_request_url":"https://api.github.com/repos/mglukhikh/kilosophers/pulls/1","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/mglukhikh/kilosophers/pulls/comments/189875019"},"html":{"href":"https://github.com/mglukhikh/kilosophers/pull/1#discussion_r189875019"},"pull_request":{"href":"https://api.github.com/repos/mglukhikh/kilosophers/pulls/1"}},"in_reply_to_id":189460797},"pull_request":{"url":"https://api.github.com/repos/mglukhikh/kilosophers/pulls/1","id":188872371,"html_url":"https://github.com/mglukhikh/kilosophers/pull/1","diff_url":"https://github.com/mglukhikh/kilosophers/pull/1.diff","patch_url":"https://github.com/mglukhikh/kilosophers/pull/1.patch","issue_url":"https://api.github.com/repos/mglukhikh/kilosophers/issues/1","number":1,"state":"open","locked":false,"title":"Реализация алгоритма с официантом","user":{"login":"SerVB","id":20105593,"avatar_url":"https://avatars2.githubusercontent.com/u/20105593?v=4","gravatar_id":"","url":"https://api.github.com/users/SerVB","html_url":"https://github.com/SerVB","followers_url":"https://api.github.com/users/SerVB/followers","following_url":"https://api.github.com/users/SerVB/following{/other_user}","gists_url":"https://api.github.com/users/SerVB/gists{/gist_id}","starred_url":"https://api.github.com/users/SerVB/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SerVB/subscriptions","organizations_url":"https://api.github.com/users/SerVB/orgs","repos_url":"https://api.github.com/users/SerVB/repos","events_url":"https://api.github.com/users/SerVB/events{/privacy}","received_events_url":"https://api.github.com/users/SerVB/received_events","type":"User","site_admin":false},"body":"Простое решение проблемы с помощью официанта.","created_at":"2018-05-17T21:57:14Z","updated_at":"2018-05-22T12:05:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"59c19360df9770b5ae44e3d9b5b6f1da62c90a8b","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/mglukhikh/kilosophers/pulls/1/commits","review_comments_url":"https://api.github.com/repos/mglukhikh/kilosophers/pulls/1/comments","review_comment_url":"https://api.github.com/repos/mglukhikh/kilosophers/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mglukhikh/kilosophers/issues/1/comments","statuses_url":"https://api.github.com/repos/mglukhikh/kilosophers/statuses/8b35317c049c589692bff38a3c6ec692bcea2c1e","head":{"label":"SerVB:first-solution","ref":"first-solution","sha":"8b35317c049c589692bff38a3c6ec692bcea2c1e","user":{"login":"SerVB","id":20105593,"avatar_url":"https://avatars2.githubusercontent.com/u/20105593?v=4","gravatar_id":"","url":"https://api.github.com/users/SerVB","html_url":"https://github.com/SerVB","followers_url":"https://api.github.com/users/SerVB/followers","following_url":"https://api.github.com/users/SerVB/following{/other_user}","gists_url":"https://api.github.com/users/SerVB/gists{/gist_id}","starred_url":"https://api.github.com/users/SerVB/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SerVB/subscriptions","organizations_url":"https://api.github.com/users/SerVB/orgs","repos_url":"https://api.github.com/users/SerVB/repos","events_url":"https://api.github.com/users/SerVB/events{/privacy}","received_events_url":"https://api.github.com/users/SerVB/received_events","type":"User","site_admin":false},"repo":{"id":133868417,"name":"kilosophers","full_name":"SerVB/kilosophers","owner":{"login":"SerVB","id":20105593,"avatar_url":"https://avatars2.githubusercontent.com/u/20105593?v=4","gravatar_id":"","url":"https://api.github.com/users/SerVB","html_url":"https://github.com/SerVB","followers_url":"https://api.github.com/users/SerVB/followers","following_url":"https://api.github.com/users/SerVB/following{/other_user}","gists_url":"https://api.github.com/users/SerVB/gists{/gist_id}","starred_url":"https://api.github.com/users/SerVB/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SerVB/subscriptions","organizations_url":"https://api.github.com/users/SerVB/orgs","repos_url":"https://api.github.com/users/SerVB/repos","events_url":"https://api.github.com/users/SerVB/events{/privacy}","received_events_url":"https://api.github.com/users/SerVB/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/SerVB/kilosophers","description":null,"fork":true,"url":"https://api.github.com/repos/SerVB/kilosophers","forks_url":"https://api.github.com/repos/SerVB/kilosophers/forks","keys_url":"https://api.github.com/repos/SerVB/kilosophers/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SerVB/kilosophers/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SerVB/kilosophers/teams","hooks_url":"https://api.github.com/repos/SerVB/kilosophers/hooks","issue_events_url":"https://api.github.com/repos/SerVB/kilosophers/issues/events{/number}","events_url":"https://api.github.com/repos/SerVB/kilosophers/events","assignees_url":"https://api.github.com/repos/SerVB/kilosophers/assignees{/user}","branches_url":"https://api.github.com/repos/SerVB/kilosophers/branches{/branch}","tags_url":"https://api.github.com/repos/SerVB/kilosophers/tags","blobs_url":"https://api.github.com/repos/SerVB/kilosophers/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SerVB/kilosophers/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SerVB/kilosophers/git/refs{/sha}","trees_url":"https://api.github.com/repos/SerVB/kilosophers/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SerVB/kilosophers/statuses/{sha}","languages_url":"https://api.github.com/repos/SerVB/kilosophers/languages","stargazers_url":"https://api.github.com/repos/SerVB/kilosophers/stargazers","contributors_url":"https://api.github.com/repos/SerVB/kilosophers/contributors","subscribers_url":"https://api.github.com/repos/SerVB/kilosophers/subscribers","subscription_url":"https://api.github.com/repos/SerVB/kilosophers/subscription","commits_url":"https://api.github.com/repos/SerVB/kilosophers/commits{/sha}","git_commits_url":"https://api.github.com/repos/SerVB/kilosophers/git/commits{/sha}","comments_url":"https://api.github.com/repos/SerVB/kilosophers/comments{/number}","issue_comment_url":"https://api.github.com/repos/SerVB/kilosophers/issues/comments{/number}","contents_url":"https://api.github.com/repos/SerVB/kilosophers/contents/{+path}","compare_url":"https://api.github.com/repos/SerVB/kilosophers/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SerVB/kilosophers/merges","archive_url":"https://api.github.com/repos/SerVB/kilosophers/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SerVB/kilosophers/downloads","issues_url":"https://api.github.com/repos/SerVB/kilosophers/issues{/number}","pulls_url":"https://api.github.com/repos/SerVB/kilosophers/pulls{/number}","milestones_url":"https://api.github.com/repos/SerVB/kilosophers/milestones{/number}","notifications_url":"https://api.github.com/repos/SerVB/kilosophers/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SerVB/kilosophers/labels{/name}","releases_url":"https://api.github.com/repos/SerVB/kilosophers/releases{/id}","deployments_url":"https://api.github.com/repos/SerVB/kilosophers/deployments","created_at":"2018-05-17T21:06:17Z","updated_at":"2018-05-17T21:06:19Z","pushed_at":"2018-05-22T12:04:20Z","git_url":"git://github.com/SerVB/kilosophers.git","ssh_url":"git@github.com:SerVB/kilosophers.git","clone_url":"https://github.com/SerVB/kilosophers.git","svn_url":"https://github.com/SerVB/kilosophers","homepage":null,"size":71,"stargazers_count":0,"watchers_count":0,"language":"Kotlin","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"mglukhikh:master","ref":"master","sha":"c0086dd86e9e0d90f95c7e6a024a2327a002536d","user":{"login":"mglukhikh","id":1127631,"avatar_url":"https://avatars2.githubusercontent.com/u/1127631?v=4","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},"repo":{"id":131398506,"name":"kilosophers","full_name":"mglukhikh/kilosophers","owner":{"login":"mglukhikh","id":1127631,"avatar_url":"https://avatars2.githubusercontent.com/u/1127631?v=4","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},"private":false,"html_url":"https://github.com/mglukhikh/kilosophers","description":null,"fork":false,"url":"https://api.github.com/repos/mglukhikh/kilosophers","forks_url":"https://api.github.com/repos/mglukhikh/kilosophers/forks","keys_url":"https://api.github.com/repos/mglukhikh/kilosophers/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mglukhikh/kilosophers/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mglukhikh/kilosophers/teams","hooks_url":"https://api.github.com/repos/mglukhikh/kilosophers/hooks","issue_events_url":"https://api.github.com/repos/mglukhikh/kilosophers/issues/events{/number}","events_url":"https://api.github.com/repos/mglukhikh/kilosophers/events","assignees_url":"https://api.github.com/repos/mglukhikh/kilosophers/assignees{/user}","branches_url":"https://api.github.com/repos/mglukhikh/kilosophers/branches{/branch}","tags_url":"https://api.github.com/repos/mglukhikh/kilosophers/tags","blobs_url":"https://api.github.com/repos/mglukhikh/kilosophers/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mglukhikh/kilosophers/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mglukhikh/kilosophers/git/refs{/sha}","trees_url":"https://api.github.com/repos/mglukhikh/kilosophers/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mglukhikh/kilosophers/statuses/{sha}","languages_url":"https://api.github.com/repos/mglukhikh/kilosophers/languages","stargazers_url":"https://api.github.com/repos/mglukhikh/kilosophers/stargazers","contributors_url":"https://api.github.com/repos/mglukhikh/kilosophers/contributors","subscribers_url":"https://api.github.com/repos/mglukhikh/kilosophers/subscribers","subscription_url":"https://api.github.com/repos/mglukhikh/kilosophers/subscription","commits_url":"https://api.github.com/repos/mglukhikh/kilosophers/commits{/sha}","git_commits_url":"https://api.github.com/repos/mglukhikh/kilosophers/git/commits{/sha}","comments_url":"https://api.github.com/repos/mglukhikh/kilosophers/comments{/number}","issue_comment_url":"https://api.github.com/repos/mglukhikh/kilosophers/issues/comments{/number}","contents_url":"https://api.github.com/repos/mglukhikh/kilosophers/contents/{+path}","compare_url":"https://api.github.com/repos/mglukhikh/kilosophers/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mglukhikh/kilosophers/merges","archive_url":"https://api.github.com/repos/mglukhikh/kilosophers/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mglukhikh/kilosophers/downloads","issues_url":"https://api.github.com/repos/mglukhikh/kilosophers/issues{/number}","pulls_url":"https://api.github.com/repos/mglukhikh/kilosophers/pulls{/number}","milestones_url":"https://api.github.com/repos/mglukhikh/kilosophers/milestones{/number}","notifications_url":"https://api.github.com/repos/mglukhikh/kilosophers/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mglukhikh/kilosophers/labels{/name}","releases_url":"https://api.github.com/repos/mglukhikh/kilosophers/releases{/id}","deployments_url":"https://api.github.com/repos/mglukhikh/kilosophers/deployments","created_at":"2018-04-28T10:08:20Z","updated_at":"2018-04-30T11:28:45Z","pushed_at":"2018-05-22T12:04:21Z","git_url":"git://github.com/mglukhikh/kilosophers.git","ssh_url":"git@github.com:mglukhikh/kilosophers.git","clone_url":"https://github.com/mglukhikh/kilosophers.git","svn_url":"https://github.com/mglukhikh/kilosophers","homepage":null,"size":64,"stargazers_count":1,"watchers_count":1,"language":"Kotlin","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":1,"license":null,"forks":1,"open_issues":1,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mglukhikh/kilosophers/pulls/1"},"html":{"href":"https://github.com/mglukhikh/kilosophers/pull/1"},"issue":{"href":"https://api.github.com/repos/mglukhikh/kilosophers/issues/1"},"comments":{"href":"https://api.github.com/repos/mglukhikh/kilosophers/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/mglukhikh/kilosophers/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/mglukhikh/kilosophers/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mglukhikh/kilosophers/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/mglukhikh/kilosophers/statuses/8b35317c049c589692bff38a3c6ec692bcea2c1e"}},"author_association":"NONE"}}
{"actor":{"display_login":"SerVB"}}