{"action":"created","comment":{"url":"https://api.github.com/repos/aleksamarkoni/paythonovci/pulls/comments/89674884","pull_request_review_id":10218064,"id":89674884,"diff_hunk":"@@ -0,0 +1,145 @@\n+#include <iostream>\r\n+#include <stdlib.h>\r\n+#include \"Josiphklasa.h\"\r\n+#include \"Vojnik.h\"\r\n+#include \"VojnikGS.h\"\r\n+\r\n+using namespace std;\r\n+\r\n+void Josiph::ispis() {\r\n+\tfor (int i = 0; i < z; i++) {\r\n+\t\tcout << \"(\" << krug[i].poz << \", \" << (krug[i].ziv?\"Ziv\":\"Mrtav\") << \")\";\r\n+  }\r\n+\tcout << \"\\n\" << endl;\r\n+}\r\n+\r\n+ostream &operator<<( ostream &output, const Vojnik &a ) {\r\n+\toutput << \"(\" << a.poz << \",\" << (a.ziv?\"Ziv\":\"Mrtav\") << \")\";\r\n+return output;\r\n+}\r\n+Josiph::Josiph() {\r\n+ z = 5;\r\n+ u = 5;\r\n+ krug = new Vojnik[u];\r\n+ for (int i = 0; i < z; i++) {\r\n+\t krug[i].poz = i+1;\r\n+\t}\r\n+}\r\n+\r\n+Josiph::Josiph(int koliko, int gp) {\r\n+\tu = koliko;\r\n+\tz = koliko;\r\n+\tkrug = new Vojnik[u];\r\n+  for (int i = 0; i < z; i++) {\r\n+\t  krug[i].poz = i+1;\r\n+  }\r\n+\t\tkrug[gp] = Glavonja();\r\n+}\r\n+\r\n+void Josiph::killThemAll(int m) {\r\n+  if ( m == 0 ) {\r\n+    m = 1;\r\n+  }\r\n+  for (int i = 0; i < z; i+=(m+1)) {\r\n+      krug[(i+m)%z].ziv = false;\r\n+  }\r\n+}\r\n+\r\n+void ubijVojnika() {\r\n+\tsrand (time(NULL));\r\n+\tint iSecret = rand() % 100 + 1;\r\n+\tif (ziv) {\r\n+\t\tif (iSecret <= 70)\r\n+\t\t\tbrojZivota--;\r\n+\t\t\tif (brojZivota == 0) {\r\n+\t\t\t\tziv = false;\r\n+\t\t\t\tcout << \"Glavonja Sreckovic je ubijen\" << endl;\r\n+\t\t} else {\r\n+\t\t\tcout << \"Glavonja Sreckovic zivi i ima jos \" << brojZivota << \" zivota\" << endl;\r\n+\t\t}\r\n+\t} else {\r\n+\t\tcout << \"Glavonja Sreckovic je vec mrtav\" << endl;\r\n+\t}\r\n+}\r\n+\r\n+Vojnik Josiph::LastStand(int m) {\r\n+\twhile(z > 1) {\r\n+  ispis();\r\n+  killThemAll(m);\r\n+  ispis();\r\n+  removeDeadSoldersInPlace2();\r\n+  }\r\n+  return krug[0];\r\n+ }\r\n+\r\n+void Josiph::removeDeadSoldiers() {\r\n+\tVojnik *krugZivih = new Vojnik[u];\r\n+\tint br = 0;\r\n+\tfor (int i = 0; i < z; i++) {\r\n+\t\tif (krug[i].ziv) {\r\n+\t\t\tkrugZivih[br++] = krug[i];\r\n+\t\t}\r\n+\t}\r\n+\tz = br;\r\n+\tdelete [] krug;\r\n+\tkrug = krugZivih;\r\n+\t}\r\n+\r\n+\tvoid Josiph::removeDeadSoldersInPlace() {\r\n+\t\tint br = 0;\r\n+\t\tfor (int i = 0; i < z; i++) {\r\n+\t\t\tif (krug[i].ziv) {\r\n+\t\t\t\tkrug[br++] = krug[i];\r\n+\t\t\t}\r\n+\t\t}\r\n+\t\tz = br;\r\n+\t}\r\n+\r\n+  void Josiph::removeDeadSoldersInPlace2() {\r\n+    int br = 0;\r\n+    u = z;\r\n+    for (int i = 0; i < u; i++) {\r\n+      if (krug[i].ziv) {\r\n+        krug[br++] = krug[i]; }\r\n+        else {\r\n+        z--; }\r\n+      }\r\n+    }\r\n+\r\n+\tostream &operator<<( ostream &output, const Josiph &a ) {\r\n+\t output << \"[\";\r\n+\t if (a.z > 0) {\r\n+\t\t int i = 0;\r\n+\t\t for (; i < a.z - 1; i++) {\r\n+\t\t\t output << a.krug[i] << \",\";\r\n+\t\t }\r\n+\t\t output << a.krug[i];\r\n+\t }\r\n+\t output << \"]\";\r\n+\t return output;\r\n+\t}\r\n+\r\n+Vojnik::Vojnik() {\r\n+\tziv = true;\r\n+}\r\n+\r\n+VojnikGS::Glavonja() {\r\n+\tziv = true;\r\n+\tbrojZivota = 3;\r\n+}\r","path":"Josiph/Josiph.cpp","position":129,"original_position":129,"commit_id":"f768756526b9c53d82b2c86855659389c1efed6b","original_commit_id":"f768756526b9c53d82b2c86855659389c1efed6b","user":{"login":"aleksamarkoni","id":5021541,"avatar_url":"https://avatars.githubusercontent.com/u/5021541?v=3","gravatar_id":"","url":"https://api.github.com/users/aleksamarkoni","html_url":"https://github.com/aleksamarkoni","followers_url":"https://api.github.com/users/aleksamarkoni/followers","following_url":"https://api.github.com/users/aleksamarkoni/following{/other_user}","gists_url":"https://api.github.com/users/aleksamarkoni/gists{/gist_id}","starred_url":"https://api.github.com/users/aleksamarkoni/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aleksamarkoni/subscriptions","organizations_url":"https://api.github.com/users/aleksamarkoni/orgs","repos_url":"https://api.github.com/users/aleksamarkoni/repos","events_url":"https://api.github.com/users/aleksamarkoni/events{/privacy}","received_events_url":"https://api.github.com/users/aleksamarkoni/received_events","type":"User","site_admin":false},"body":"ovo ide u VojnikGS.cpp","created_at":"2016-11-26T17:25:50Z","updated_at":"2016-11-26T17:25:50Z","html_url":"https://github.com/aleksamarkoni/paythonovci/pull/21#discussion_r89674884","pull_request_url":"https://api.github.com/repos/aleksamarkoni/paythonovci/pulls/21","_links":{"self":{"href":"https://api.github.com/repos/aleksamarkoni/paythonovci/pulls/comments/89674884"},"html":{"href":"https://github.com/aleksamarkoni/paythonovci/pull/21#discussion_r89674884"},"pull_request":{"href":"https://api.github.com/repos/aleksamarkoni/paythonovci/pulls/21"}}},"pull_request":{"url":"https://api.github.com/repos/aleksamarkoni/paythonovci/pulls/21","id":95376707,"html_url":"https://github.com/aleksamarkoni/paythonovci/pull/21","diff_url":"https://github.com/aleksamarkoni/paythonovci/pull/21.diff","patch_url":"https://github.com/aleksamarkoni/paythonovci/pull/21.patch","issue_url":"https://api.github.com/repos/aleksamarkoni/paythonovci/issues/21","number":21,"state":"open","locked":false,"title":"Cplusplus","user":{"login":"dusankojcic","id":21061089,"avatar_url":"https://avatars.githubusercontent.com/u/21061089?v=3","gravatar_id":"","url":"https://api.github.com/users/dusankojcic","html_url":"https://github.com/dusankojcic","followers_url":"https://api.github.com/users/dusankojcic/followers","following_url":"https://api.github.com/users/dusankojcic/following{/other_user}","gists_url":"https://api.github.com/users/dusankojcic/gists{/gist_id}","starred_url":"https://api.github.com/users/dusankojcic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dusankojcic/subscriptions","organizations_url":"https://api.github.com/users/dusankojcic/orgs","repos_url":"https://api.github.com/users/dusankojcic/repos","events_url":"https://api.github.com/users/dusankojcic/events{/privacy}","received_events_url":"https://api.github.com/users/dusankojcic/received_events","type":"User","site_admin":false},"body":"Sve smo sjebali pomozi nam :dagger:  :D","created_at":"2016-11-26T17:01:01Z","updated_at":"2016-11-26T17:25:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/aleksamarkoni/paythonovci/pulls/21/commits","review_comments_url":"https://api.github.com/repos/aleksamarkoni/paythonovci/pulls/21/comments","review_comment_url":"https://api.github.com/repos/aleksamarkoni/paythonovci/pulls/comments{/number}","comments_url":"https://api.github.com/repos/aleksamarkoni/paythonovci/issues/21/comments","statuses_url":"https://api.github.com/repos/aleksamarkoni/paythonovci/statuses/f768756526b9c53d82b2c86855659389c1efed6b","head":{"label":"aleksamarkoni:Cplusplus","ref":"Cplusplus","sha":"f768756526b9c53d82b2c86855659389c1efed6b","user":{"login":"aleksamarkoni","id":5021541,"avatar_url":"https://avatars.githubusercontent.com/u/5021541?v=3","gravatar_id":"","url":"https://api.github.com/users/aleksamarkoni","html_url":"https://github.com/aleksamarkoni","followers_url":"https://api.github.com/users/aleksamarkoni/followers","following_url":"https://api.github.com/users/aleksamarkoni/following{/other_user}","gists_url":"https://api.github.com/users/aleksamarkoni/gists{/gist_id}","starred_url":"https://api.github.com/users/aleksamarkoni/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aleksamarkoni/subscriptions","organizations_url":"https://api.github.com/users/aleksamarkoni/orgs","repos_url":"https://api.github.com/users/aleksamarkoni/repos","events_url":"https://api.github.com/users/aleksamarkoni/events{/privacy}","received_events_url":"https://api.github.com/users/aleksamarkoni/received_events","type":"User","site_admin":false},"repo":{"id":71377787,"name":"paythonovci","full_name":"aleksamarkoni/paythonovci","owner":{"login":"aleksamarkoni","id":5021541,"avatar_url":"https://avatars.githubusercontent.com/u/5021541?v=3","gravatar_id":"","url":"https://api.github.com/users/aleksamarkoni","html_url":"https://github.com/aleksamarkoni","followers_url":"https://api.github.com/users/aleksamarkoni/followers","following_url":"https://api.github.com/users/aleksamarkoni/following{/other_user}","gists_url":"https://api.github.com/users/aleksamarkoni/gists{/gist_id}","starred_url":"https://api.github.com/users/aleksamarkoni/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aleksamarkoni/subscriptions","organizations_url":"https://api.github.com/users/aleksamarkoni/orgs","repos_url":"https://api.github.com/users/aleksamarkoni/repos","events_url":"https://api.github.com/users/aleksamarkoni/events{/privacy}","received_events_url":"https://api.github.com/users/aleksamarkoni/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/aleksamarkoni/paythonovci","description":"Ovo je za slackere","fork":false,"url":"https://api.github.com/repos/aleksamarkoni/paythonovci","forks_url":"https://api.github.com/repos/aleksamarkoni/paythonovci/forks","keys_url":"https://api.github.com/repos/aleksamarkoni/paythonovci/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aleksamarkoni/paythonovci/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aleksamarkoni/paythonovci/teams","hooks_url":"https://api.github.com/repos/aleksamarkoni/paythonovci/hooks","issue_events_url":"https://api.github.com/repos/aleksamarkoni/paythonovci/issues/events{/number}","events_url":"https://api.github.com/repos/aleksamarkoni/paythonovci/events","assignees_url":"https://api.github.com/repos/aleksamarkoni/paythonovci/assignees{/user}","branches_url":"https://api.github.com/repos/aleksamarkoni/paythonovci/branches{/branch}","tags_url":"https://api.github.com/repos/aleksamarkoni/paythonovci/tags","blobs_url":"https://api.github.com/repos/aleksamarkoni/paythonovci/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aleksamarkoni/paythonovci/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aleksamarkoni/paythonovci/git/refs{/sha}","trees_url":"https://api.github.com/repos/aleksamarkoni/paythonovci/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aleksamarkoni/paythonovci/statuses/{sha}","languages_url":"https://api.github.com/repos/aleksamarkoni/paythonovci/languages","stargazers_url":"https://api.github.com/repos/aleksamarkoni/paythonovci/stargazers","contributors_url":"https://api.github.com/repos/aleksamarkoni/paythonovci/contributors","subscribers_url":"https://api.github.com/repos/aleksamarkoni/paythonovci/subscribers","subscription_url":"https://api.github.com/repos/aleksamarkoni/paythonovci/subscription","commits_url":"https://api.github.com/repos/aleksamarkoni/paythonovci/commits{/sha}","git_commits_url":"https://api.github.com/repos/aleksamarkoni/paythonovci/git/commits{/sha}","comments_url":"https://api.github.com/repos/aleksamarkoni/paythonovci/comments{/number}","issue_comment_url":"https://api.github.com/repos/aleksamarkoni/paythonovci/issues/comments{/number}","contents_url":"https://api.github.com/repos/aleksamarkoni/paythonovci/contents/{+path}","compare_url":"https://api.github.com/repos/aleksamarkoni/paythonovci/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aleksamarkoni/paythonovci/merges","archive_url":"https://api.github.com/repos/aleksamarkoni/paythonovci/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aleksamarkoni/paythonovci/downloads","issues_url":"https://api.github.com/repos/aleksamarkoni/paythonovci/issues{/number}","pulls_url":"https://api.github.com/repos/aleksamarkoni/paythonovci/pulls{/number}","milestones_url":"https://api.github.com/repos/aleksamarkoni/paythonovci/milestones{/number}","notifications_url":"https://api.github.com/repos/aleksamarkoni/paythonovci/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aleksamarkoni/paythonovci/labels{/name}","releases_url":"https://api.github.com/repos/aleksamarkoni/paythonovci/releases{/id}","deployments_url":"https://api.github.com/repos/aleksamarkoni/paythonovci/deployments","created_at":"2016-10-19T16:36:21Z","updated_at":"2016-11-15T19:00:50Z","pushed_at":"2016-11-26T17:01:04Z","git_url":"git://github.com/aleksamarkoni/paythonovci.git","ssh_url":"git@github.com:aleksamarkoni/paythonovci.git","clone_url":"https://github.com/aleksamarkoni/paythonovci.git","svn_url":"https://github.com/aleksamarkoni/paythonovci","homepage":null,"size":574,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":5,"forks":0,"open_issues":5,"watchers":0,"default_branch":"master"}},"base":{"label":"aleksamarkoni:master","ref":"master","sha":"37c49b643bfcf2f4becb5c5ef351640db76d75a8","user":{"login":"aleksamarkoni","id":5021541,"avatar_url":"https://avatars.githubusercontent.com/u/5021541?v=3","gravatar_id":"","url":"https://api.github.com/users/aleksamarkoni","html_url":"https://github.com/aleksamarkoni","followers_url":"https://api.github.com/users/aleksamarkoni/followers","following_url":"https://api.github.com/users/aleksamarkoni/following{/other_user}","gists_url":"https://api.github.com/users/aleksamarkoni/gists{/gist_id}","starred_url":"https://api.github.com/users/aleksamarkoni/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aleksamarkoni/subscriptions","organizations_url":"https://api.github.com/users/aleksamarkoni/orgs","repos_url":"https://api.github.com/users/aleksamarkoni/repos","events_url":"https://api.github.com/users/aleksamarkoni/events{/privacy}","received_events_url":"https://api.github.com/users/aleksamarkoni/received_events","type":"User","site_admin":false},"repo":{"id":71377787,"name":"paythonovci","full_name":"aleksamarkoni/paythonovci","owner":{"login":"aleksamarkoni","id":5021541,"avatar_url":"https://avatars.githubusercontent.com/u/5021541?v=3","gravatar_id":"","url":"https://api.github.com/users/aleksamarkoni","html_url":"https://github.com/aleksamarkoni","followers_url":"https://api.github.com/users/aleksamarkoni/followers","following_url":"https://api.github.com/users/aleksamarkoni/following{/other_user}","gists_url":"https://api.github.com/users/aleksamarkoni/gists{/gist_id}","starred_url":"https://api.github.com/users/aleksamarkoni/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aleksamarkoni/subscriptions","organizations_url":"https://api.github.com/users/aleksamarkoni/orgs","repos_url":"https://api.github.com/users/aleksamarkoni/repos","events_url":"https://api.github.com/users/aleksamarkoni/events{/privacy}","received_events_url":"https://api.github.com/users/aleksamarkoni/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/aleksamarkoni/paythonovci","description":"Ovo je za slackere","fork":false,"url":"https://api.github.com/repos/aleksamarkoni/paythonovci","forks_url":"https://api.github.com/repos/aleksamarkoni/paythonovci/forks","keys_url":"https://api.github.com/repos/aleksamarkoni/paythonovci/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aleksamarkoni/paythonovci/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aleksamarkoni/paythonovci/teams","hooks_url":"https://api.github.com/repos/aleksamarkoni/paythonovci/hooks","issue_events_url":"https://api.github.com/repos/aleksamarkoni/paythonovci/issues/events{/number}","events_url":"https://api.github.com/repos/aleksamarkoni/paythonovci/events","assignees_url":"https://api.github.com/repos/aleksamarkoni/paythonovci/assignees{/user}","branches_url":"https://api.github.com/repos/aleksamarkoni/paythonovci/branches{/branch}","tags_url":"https://api.github.com/repos/aleksamarkoni/paythonovci/tags","blobs_url":"https://api.github.com/repos/aleksamarkoni/paythonovci/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aleksamarkoni/paythonovci/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aleksamarkoni/paythonovci/git/refs{/sha}","trees_url":"https://api.github.com/repos/aleksamarkoni/paythonovci/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aleksamarkoni/paythonovci/statuses/{sha}","languages_url":"https://api.github.com/repos/aleksamarkoni/paythonovci/languages","stargazers_url":"https://api.github.com/repos/aleksamarkoni/paythonovci/stargazers","contributors_url":"https://api.github.com/repos/aleksamarkoni/paythonovci/contributors","subscribers_url":"https://api.github.com/repos/aleksamarkoni/paythonovci/subscribers","subscription_url":"https://api.github.com/repos/aleksamarkoni/paythonovci/subscription","commits_url":"https://api.github.com/repos/aleksamarkoni/paythonovci/commits{/sha}","git_commits_url":"https://api.github.com/repos/aleksamarkoni/paythonovci/git/commits{/sha}","comments_url":"https://api.github.com/repos/aleksamarkoni/paythonovci/comments{/number}","issue_comment_url":"https://api.github.com/repos/aleksamarkoni/paythonovci/issues/comments{/number}","contents_url":"https://api.github.com/repos/aleksamarkoni/paythonovci/contents/{+path}","compare_url":"https://api.github.com/repos/aleksamarkoni/paythonovci/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aleksamarkoni/paythonovci/merges","archive_url":"https://api.github.com/repos/aleksamarkoni/paythonovci/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aleksamarkoni/paythonovci/downloads","issues_url":"https://api.github.com/repos/aleksamarkoni/paythonovci/issues{/number}","pulls_url":"https://api.github.com/repos/aleksamarkoni/paythonovci/pulls{/number}","milestones_url":"https://api.github.com/repos/aleksamarkoni/paythonovci/milestones{/number}","notifications_url":"https://api.github.com/repos/aleksamarkoni/paythonovci/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aleksamarkoni/paythonovci/labels{/name}","releases_url":"https://api.github.com/repos/aleksamarkoni/paythonovci/releases{/id}","deployments_url":"https://api.github.com/repos/aleksamarkoni/paythonovci/deployments","created_at":"2016-10-19T16:36:21Z","updated_at":"2016-11-15T19:00:50Z","pushed_at":"2016-11-26T17:01:04Z","git_url":"git://github.com/aleksamarkoni/paythonovci.git","ssh_url":"git@github.com:aleksamarkoni/paythonovci.git","clone_url":"https://github.com/aleksamarkoni/paythonovci.git","svn_url":"https://github.com/aleksamarkoni/paythonovci","homepage":null,"size":574,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":5,"forks":0,"open_issues":5,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/aleksamarkoni/paythonovci/pulls/21"},"html":{"href":"https://github.com/aleksamarkoni/paythonovci/pull/21"},"issue":{"href":"https://api.github.com/repos/aleksamarkoni/paythonovci/issues/21"},"comments":{"href":"https://api.github.com/repos/aleksamarkoni/paythonovci/issues/21/comments"},"review_comments":{"href":"https://api.github.com/repos/aleksamarkoni/paythonovci/pulls/21/comments"},"review_comment":{"href":"https://api.github.com/repos/aleksamarkoni/paythonovci/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/aleksamarkoni/paythonovci/pulls/21/commits"},"statuses":{"href":"https://api.github.com/repos/aleksamarkoni/paythonovci/statuses/f768756526b9c53d82b2c86855659389c1efed6b"}}}}
{"actor":{"display_login":"aleksamarkoni"}}