{"id":16658202,"url":"https://github.com/connorrigby/droll","last_synced_at":"2025-03-12T19:43:29.041Z","repository":{"id":152452162,"uuid":"388508651","full_name":"ConnorRigby/droll","owner":"ConnorRigby","description":"Simple implementation of standard dice notation","archived":false,"fork":false,"pushed_at":"2021-07-22T15:49:45.000Z","size":12,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-19T12:38:45.545Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://hexdocs.pm/droll/","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ConnorRigby.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-07-22T15:22:31.000Z","updated_at":"2021-07-22T15:50:46.000Z","dependencies_parsed_at":"2023-06-08T02:30:25.885Z","dependency_job_id":null,"html_url":"https://github.com/ConnorRigby/droll","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ConnorRigby%2Fdroll","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ConnorRigby%2Fdroll/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ConnorRigby%2Fdroll/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ConnorRigby%2Fdroll/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ConnorRigby","download_url":"https://codeload.github.com/ConnorRigby/droll/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243285602,"owners_count":20266846,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-12T10:03:41.372Z","updated_at":"2025-03-12T19:43:29.000Z","avatar_url":"https://github.com/ConnorRigby.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Droll\n\n[![Hex pm](http://img.shields.io/hexpm/v/droll.svg?style=flat)](https://hex.pm/packages/droll)\n\nStandard Dice Notation in Elixir. See [the Wikipedia page](https://en.wikipedia.org/wiki/Dice_notation)\nfor a full description of the notation.\n\n[Documentation for Droll is available online](http://hexdocs.pm/droll/).\n\n## Installation\n\nIf [available in Hex](https://hex.pm/docs/publish), the package can be installed\nby adding `droll` to your list of dependencies in `mix.exs`:\n\n```elixir\ndef deps do\n  [\n    {:droll, \"~\u003e 1.0.0\"}\n  ]\nend\n```\n\n## Usage\n\nExample of rolling a 1 single 20 sided dice:\n\n```elixir\niex(1)\u003e Droll.roll(\"d20\")\n{:ok, %Droll.Result{avg: 3.0, max: 0, min: 3, rolls: [3], total: 3}}\niex(2)\u003e Droll.roll(\"d20\")\n{:ok, %Droll.Result{avg: 20.0, max: 0, min: 20, rolls: [20], total: 20}}\niex(3)\u003e Droll.roll(\"d20\")\n{:ok, %Droll.Result{avg: 19.0, max: 0, min: 19, rolls: [19], total: 19}}\niex(4)\u003e Droll.roll(\"d20\")\n{:ok, %Droll.Result{avg: 17.0, max: 0, min: 17, rolls: [17], total: 17}}\n```\n\nExample of rolling 4 20 sided dice:\n\n```elixir\niex(1)\u003e Droll.roll(\"2d20\")\n{:ok, %Droll.Result{avg: 10.0, max: 0, min: 17, rolls: [3, 17], total: 20}}\niex(2)\u003e Droll.roll(\"2d20\")\n{:ok, %Droll.Result{avg: 15.0, max: 0, min: 16, rolls: [14, 16], total: 30}}\niex(3)\u003e Droll.roll(\"2d20\")\n{:ok, %Droll.Result{avg: 17.5, max: 0, min: 18, rolls: [18, 17], total: 35}}\niex(4)\u003e Droll.roll(\"2d20\")\n{:ok, %Droll.Result{avg: 18.5, max: 0, min: 19, rolls: [19, 18], total: 37}}\n```\n\nExample of modifiers:\n\n```elixir\niex(1)\u003e Droll.roll(\"2d20+10\")\n{:ok, %Droll.Result{avg: 17.0, max: 0, min: 15, rolls: [9, 15], total: 34}}\niex(2)\u003e Droll.roll(\"2d20/1\") \n{:ok, %Droll.Result{avg: 12.5, max: 0, min: 18, rolls: [7, 18], total: 25.0}}\niex(3)\u003e Droll.roll(\"2d20x8\")\n{:ok, %Droll.Result{avg: 5.5, max: 0, min: 10, rolls: [10, 1], total: 11}}\niex(4)\u003e Droll.roll(\"2d20-3\")\n{:ok, %Droll.Result{avg: 9.5, max: 0, min: 12, rolls: [12, 10], total: 19}}\n```\n\n## Special Thanks\n\nThis project was inspired by a [Javascript library](https://github.com/thebinarypenguin/droll) of the same name.\n\n## License\n\nCopyright 2021 Connor Rigby\n\n  Licensed under the Apache License, Version 2.0 (the \"License\");\n  you may not use this file except in compliance with the License.\n  You may obtain a copy of the License at\n\n      http://www.apache.org/licenses/LICENSE-2.0\n\n  Unless required by applicable law or agreed to in writing, software\n  distributed under the License is distributed on an \"AS IS\" BASIS,\n  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  See the License for the specific language governing permissions and\n  limitations under the License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fconnorrigby%2Fdroll","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fconnorrigby%2Fdroll","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fconnorrigby%2Fdroll/lists"}