{"action":"created","comment":{"url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/pulls/comments/46155003","id":46155003,"diff_hunk":"@@ -100,48 +112,110 @@ handle remainder_lc => sub {\n             $html .= '<span class=\"zci--dice-die\">' . join(' ', @output).'</span>'\n                     .'<span class=\"zci--dice-sum\">'.\" = \". $sum.'</span></br>';\n         }\n-        elsif ($_ =~ /^(\\d*)[d|w](\\d+)\\s?([+-])?\\s?(\\d+|[lh])?$/) {\n-            # ex. '2d8', '2w6 - l', '3d4 + 4', '3d4-l'\n+        else {\n+            # ex. '2d8', '2w6 - l', '3d4 + 4', '3d4-l', '1-4d7', '2+8d2'\n             # 'w' is the German form of 'd'\n             my (@rolls, $output);\n-            my $number_of_dice = set_num_dice($1, 1); # set number of dice, default 1\n-            # check that input is not greater than or equal to 99\n-            # check that input is not 0. ex. 'roll 0d3' should not return a value\n-            if( $number_of_dice >= 100 or $1 eq '0'){\n-                return; # do not continue if conditions not met\n-            }\n-            my $min = my $number_of_faces = $2; # set min and number_of_faces to max possible roll\n+            my $roll_output;\n+            my $number_of_dice = my $min = 0;\n+            my $number_of_faces;\n             my $max = my $sum = 0; # set max roll and sum to -\n-            for (1 .. $number_of_dice) { # for each die\n-                my $roll = roll_die( $number_of_faces ); # roll the die\n-                $min = $roll if $roll < $min; # record min roll\n-                $max = $roll if $roll > $max; # record max roll\n-                push @rolls, $roll; # add roll to array rolls\n+            my $subtractive_modifier = '0';\n+            my $param1 = my $param2 = my $param3 = my $param4 = '';","path":"lib/DDG/Goodie/Dice.pm","position":59,"original_position":59,"commit_id":"5f15df8124fc915c66d9effad185b0f062497f66","original_commit_id":"5f15df8124fc915c66d9effad185b0f062497f66","user":{"login":"moollaza","id":873785,"avatar_url":"https://avatars.githubusercontent.com/u/873785?v=3","gravatar_id":"","url":"https://api.github.com/users/moollaza","html_url":"https://github.com/moollaza","followers_url":"https://api.github.com/users/moollaza/followers","following_url":"https://api.github.com/users/moollaza/following{/other_user}","gists_url":"https://api.github.com/users/moollaza/gists{/gist_id}","starred_url":"https://api.github.com/users/moollaza/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/moollaza/subscriptions","organizations_url":"https://api.github.com/users/moollaza/orgs","repos_url":"https://api.github.com/users/moollaza/repos","events_url":"https://api.github.com/users/moollaza/events{/privacy}","received_events_url":"https://api.github.com/users/moollaza/received_events","type":"User","site_admin":false},"body":"My bad, I hadn't noticed https://github.com/duckduckgo/zeroclickinfo-goodies/pull/1831/files?diff=unified#diff-990763ee35db73d54d3b16763db188d1R122\r\n\r\nI've never seen anyone declare multiple variables like that in our code, or elsewhere -- I guess it's valid, just looks a little funny.","created_at":"2015-11-30T15:17:43Z","updated_at":"2015-11-30T15:17:43Z","html_url":"https://github.com/duckduckgo/zeroclickinfo-goodies/pull/1831#discussion_r46155003","pull_request_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/pulls/1831","_links":{"self":{"href":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/pulls/comments/46155003"},"html":{"href":"https://github.com/duckduckgo/zeroclickinfo-goodies/pull/1831#discussion_r46155003"},"pull_request":{"href":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/pulls/1831"}}},"pull_request":{"url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/pulls/1831","id":52085515,"html_url":"https://github.com/duckduckgo/zeroclickinfo-goodies/pull/1831","diff_url":"https://github.com/duckduckgo/zeroclickinfo-goodies/pull/1831.diff","patch_url":"https://github.com/duckduckgo/zeroclickinfo-goodies/pull/1831.patch","issue_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/issues/1831","number":1831,"state":"open","locked":false,"title":"Dice: Fixes #1742","user":{"login":"maxau","id":16066006,"avatar_url":"https://avatars.githubusercontent.com/u/16066006?v=3","gravatar_id":"","url":"https://api.github.com/users/maxau","html_url":"https://github.com/maxau","followers_url":"https://api.github.com/users/maxau/followers","following_url":"https://api.github.com/users/maxau/following{/other_user}","gists_url":"https://api.github.com/users/maxau/gists{/gist_id}","starred_url":"https://api.github.com/users/maxau/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maxau/subscriptions","organizations_url":"https://api.github.com/users/maxau/orgs","repos_url":"https://api.github.com/users/maxau/repos","events_url":"https://api.github.com/users/maxau/events{/privacy}","received_events_url":"https://api.github.com/users/maxau/received_events","type":"User","site_admin":false},"body":"![image](https://cloud.githubusercontent.com/assets/16066006/11463781/b953ec0a-96ec-11e5-8021-6221fcac24c1.png)\r\n____\r\nFixes #1742 \r\nhttps://duck.co/ia/view/dice","created_at":"2015-11-30T04:59:37Z","updated_at":"2015-11-30T15:17:43Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9c6c7576f92901d9857d9a8df52194e21405ce6c","assignee":{"login":"moollaza","id":873785,"avatar_url":"https://avatars.githubusercontent.com/u/873785?v=3","gravatar_id":"","url":"https://api.github.com/users/moollaza","html_url":"https://github.com/moollaza","followers_url":"https://api.github.com/users/moollaza/followers","following_url":"https://api.github.com/users/moollaza/following{/other_user}","gists_url":"https://api.github.com/users/moollaza/gists{/gist_id}","starred_url":"https://api.github.com/users/moollaza/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/moollaza/subscriptions","organizations_url":"https://api.github.com/users/moollaza/orgs","repos_url":"https://api.github.com/users/moollaza/repos","events_url":"https://api.github.com/users/moollaza/events{/privacy}","received_events_url":"https://api.github.com/users/moollaza/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/pulls/1831/commits","review_comments_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/pulls/1831/comments","review_comment_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/pulls/comments{/number}","comments_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/issues/1831/comments","statuses_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/statuses/5f15df8124fc915c66d9effad185b0f062497f66","head":{"label":"maxau:branchzero","ref":"branchzero","sha":"5f15df8124fc915c66d9effad185b0f062497f66","user":{"login":"maxau","id":16066006,"avatar_url":"https://avatars.githubusercontent.com/u/16066006?v=3","gravatar_id":"","url":"https://api.github.com/users/maxau","html_url":"https://github.com/maxau","followers_url":"https://api.github.com/users/maxau/followers","following_url":"https://api.github.com/users/maxau/following{/other_user}","gists_url":"https://api.github.com/users/maxau/gists{/gist_id}","starred_url":"https://api.github.com/users/maxau/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maxau/subscriptions","organizations_url":"https://api.github.com/users/maxau/orgs","repos_url":"https://api.github.com/users/maxau/repos","events_url":"https://api.github.com/users/maxau/events{/privacy}","received_events_url":"https://api.github.com/users/maxau/received_events","type":"User","site_admin":false},"repo":{"id":47053496,"name":"zeroclickinfo-goodies","full_name":"maxau/zeroclickinfo-goodies","owner":{"login":"maxau","id":16066006,"avatar_url":"https://avatars.githubusercontent.com/u/16066006?v=3","gravatar_id":"","url":"https://api.github.com/users/maxau","html_url":"https://github.com/maxau","followers_url":"https://api.github.com/users/maxau/followers","following_url":"https://api.github.com/users/maxau/following{/other_user}","gists_url":"https://api.github.com/users/maxau/gists{/gist_id}","starred_url":"https://api.github.com/users/maxau/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maxau/subscriptions","organizations_url":"https://api.github.com/users/maxau/orgs","repos_url":"https://api.github.com/users/maxau/repos","events_url":"https://api.github.com/users/maxau/events{/privacy}","received_events_url":"https://api.github.com/users/maxau/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/maxau/zeroclickinfo-goodies","description":"DuckDuckGo instant answer plugins based on Perl functions","fork":true,"url":"https://api.github.com/repos/maxau/zeroclickinfo-goodies","forks_url":"https://api.github.com/repos/maxau/zeroclickinfo-goodies/forks","keys_url":"https://api.github.com/repos/maxau/zeroclickinfo-goodies/keys{/key_id}","collaborators_url":"https://api.github.com/repos/maxau/zeroclickinfo-goodies/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/maxau/zeroclickinfo-goodies/teams","hooks_url":"https://api.github.com/repos/maxau/zeroclickinfo-goodies/hooks","issue_events_url":"https://api.github.com/repos/maxau/zeroclickinfo-goodies/issues/events{/number}","events_url":"https://api.github.com/repos/maxau/zeroclickinfo-goodies/events","assignees_url":"https://api.github.com/repos/maxau/zeroclickinfo-goodies/assignees{/user}","branches_url":"https://api.github.com/repos/maxau/zeroclickinfo-goodies/branches{/branch}","tags_url":"https://api.github.com/repos/maxau/zeroclickinfo-goodies/tags","blobs_url":"https://api.github.com/repos/maxau/zeroclickinfo-goodies/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/maxau/zeroclickinfo-goodies/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/maxau/zeroclickinfo-goodies/git/refs{/sha}","trees_url":"https://api.github.com/repos/maxau/zeroclickinfo-goodies/git/trees{/sha}","statuses_url":"https://api.github.com/repos/maxau/zeroclickinfo-goodies/statuses/{sha}","languages_url":"https://api.github.com/repos/maxau/zeroclickinfo-goodies/languages","stargazers_url":"https://api.github.com/repos/maxau/zeroclickinfo-goodies/stargazers","contributors_url":"https://api.github.com/repos/maxau/zeroclickinfo-goodies/contributors","subscribers_url":"https://api.github.com/repos/maxau/zeroclickinfo-goodies/subscribers","subscription_url":"https://api.github.com/repos/maxau/zeroclickinfo-goodies/subscription","commits_url":"https://api.github.com/repos/maxau/zeroclickinfo-goodies/commits{/sha}","git_commits_url":"https://api.github.com/repos/maxau/zeroclickinfo-goodies/git/commits{/sha}","comments_url":"https://api.github.com/repos/maxau/zeroclickinfo-goodies/comments{/number}","issue_comment_url":"https://api.github.com/repos/maxau/zeroclickinfo-goodies/issues/comments{/number}","contents_url":"https://api.github.com/repos/maxau/zeroclickinfo-goodies/contents/{+path}","compare_url":"https://api.github.com/repos/maxau/zeroclickinfo-goodies/compare/{base}...{head}","merges_url":"https://api.github.com/repos/maxau/zeroclickinfo-goodies/merges","archive_url":"https://api.github.com/repos/maxau/zeroclickinfo-goodies/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/maxau/zeroclickinfo-goodies/downloads","issues_url":"https://api.github.com/repos/maxau/zeroclickinfo-goodies/issues{/number}","pulls_url":"https://api.github.com/repos/maxau/zeroclickinfo-goodies/pulls{/number}","milestones_url":"https://api.github.com/repos/maxau/zeroclickinfo-goodies/milestones{/number}","notifications_url":"https://api.github.com/repos/maxau/zeroclickinfo-goodies/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/maxau/zeroclickinfo-goodies/labels{/name}","releases_url":"https://api.github.com/repos/maxau/zeroclickinfo-goodies/releases{/id}","created_at":"2015-11-29T06:59:16Z","updated_at":"2015-11-29T06:59:20Z","pushed_at":"2015-11-30T04:46:54Z","git_url":"git://github.com/maxau/zeroclickinfo-goodies.git","ssh_url":"git@github.com:maxau/zeroclickinfo-goodies.git","clone_url":"https://github.com/maxau/zeroclickinfo-goodies.git","svn_url":"https://github.com/maxau/zeroclickinfo-goodies","homepage":"http://duckduckhack.com/","size":11639,"stargazers_count":0,"watchers_count":0,"language":"Perl","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"duckduckgo:master","ref":"master","sha":"ce846a3323691ccba41869ea8994f43233de8ce9","user":{"login":"duckduckgo","id":342708,"avatar_url":"https://avatars.githubusercontent.com/u/342708?v=3","gravatar_id":"","url":"https://api.github.com/users/duckduckgo","html_url":"https://github.com/duckduckgo","followers_url":"https://api.github.com/users/duckduckgo/followers","following_url":"https://api.github.com/users/duckduckgo/following{/other_user}","gists_url":"https://api.github.com/users/duckduckgo/gists{/gist_id}","starred_url":"https://api.github.com/users/duckduckgo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/duckduckgo/subscriptions","organizations_url":"https://api.github.com/users/duckduckgo/orgs","repos_url":"https://api.github.com/users/duckduckgo/repos","events_url":"https://api.github.com/users/duckduckgo/events{/privacy}","received_events_url":"https://api.github.com/users/duckduckgo/received_events","type":"Organization","site_admin":false},"repo":{"id":2164979,"name":"zeroclickinfo-goodies","full_name":"duckduckgo/zeroclickinfo-goodies","owner":{"login":"duckduckgo","id":342708,"avatar_url":"https://avatars.githubusercontent.com/u/342708?v=3","gravatar_id":"","url":"https://api.github.com/users/duckduckgo","html_url":"https://github.com/duckduckgo","followers_url":"https://api.github.com/users/duckduckgo/followers","following_url":"https://api.github.com/users/duckduckgo/following{/other_user}","gists_url":"https://api.github.com/users/duckduckgo/gists{/gist_id}","starred_url":"https://api.github.com/users/duckduckgo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/duckduckgo/subscriptions","organizations_url":"https://api.github.com/users/duckduckgo/orgs","repos_url":"https://api.github.com/users/duckduckgo/repos","events_url":"https://api.github.com/users/duckduckgo/events{/privacy}","received_events_url":"https://api.github.com/users/duckduckgo/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/duckduckgo/zeroclickinfo-goodies","description":"DuckDuckGo instant answer plugins based on Perl functions","fork":false,"url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies","forks_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/forks","keys_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/keys{/key_id}","collaborators_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/teams","hooks_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/hooks","issue_events_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/issues/events{/number}","events_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/events","assignees_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/assignees{/user}","branches_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/branches{/branch}","tags_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/tags","blobs_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/git/refs{/sha}","trees_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/git/trees{/sha}","statuses_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/statuses/{sha}","languages_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/languages","stargazers_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/stargazers","contributors_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/contributors","subscribers_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/subscribers","subscription_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/subscription","commits_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/commits{/sha}","git_commits_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/git/commits{/sha}","comments_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/comments{/number}","issue_comment_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/issues/comments{/number}","contents_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/contents/{+path}","compare_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/compare/{base}...{head}","merges_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/merges","archive_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/downloads","issues_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/issues{/number}","pulls_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/pulls{/number}","milestones_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/milestones{/number}","notifications_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/labels{/name}","releases_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/releases{/id}","created_at":"2011-08-06T13:26:05Z","updated_at":"2015-11-25T19:46:43Z","pushed_at":"2015-11-30T11:11:59Z","git_url":"git://github.com/duckduckgo/zeroclickinfo-goodies.git","ssh_url":"git@github.com:duckduckgo/zeroclickinfo-goodies.git","clone_url":"https://github.com/duckduckgo/zeroclickinfo-goodies.git","svn_url":"https://github.com/duckduckgo/zeroclickinfo-goodies","homepage":"http://duckduckhack.com/","size":19489,"stargazers_count":351,"watchers_count":351,"language":"Perl","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1262,"mirror_url":null,"open_issues_count":156,"forks":1262,"open_issues":156,"watchers":351,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/pulls/1831"},"html":{"href":"https://github.com/duckduckgo/zeroclickinfo-goodies/pull/1831"},"issue":{"href":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/issues/1831"},"comments":{"href":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/issues/1831/comments"},"review_comments":{"href":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/pulls/1831/comments"},"review_comment":{"href":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/pulls/1831/commits"},"statuses":{"href":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/statuses/5f15df8124fc915c66d9effad185b0f062497f66"}}}}