{"id":37020122,"url":"https://github.com/diceroll-dev/dice-parser","last_synced_at":"2026-01-14T02:15:53.599Z","repository":{"id":37260733,"uuid":"252577612","full_name":"diceroll-dev/dice-parser","owner":"diceroll-dev","description":"Try it out on the command line: `curl https://api.diceroll.dev`","archived":false,"fork":false,"pushed_at":"2025-11-21T14:09:37.000Z","size":272,"stargazers_count":9,"open_issues_count":5,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-21T16:08:01.166Z","etag":null,"topics":["dice","java","kotlin"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","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/diceroll-dev.png","metadata":{"files":{"readme":"README.md","changelog":null,"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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2020-04-02T22:23:53.000Z","updated_at":"2025-11-21T14:09:40.000Z","dependencies_parsed_at":"2024-04-19T18:33:15.290Z","dependency_job_id":"b413168d-34bb-48ed-b0aa-e354bdfe036b","html_url":"https://github.com/diceroll-dev/dice-parser","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/diceroll-dev/dice-parser","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diceroll-dev%2Fdice-parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diceroll-dev%2Fdice-parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diceroll-dev%2Fdice-parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diceroll-dev%2Fdice-parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/diceroll-dev","download_url":"https://codeload.github.com/diceroll-dev/dice-parser/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diceroll-dev%2Fdice-parser/sbom","scorecard":{"id":341017,"data":{"date":"2025-08-11","repo":{"name":"github.com/diceroll-dev/dice-parser","commit":"6181e20e016ac08037d125ab1683f12c6f4fe050"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4.4,"checks":[{"name":"Maintained","score":6,"reason":"8 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 6","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":0,"reason":"Found 0/5 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/build.yml:1","Warn: topLevel 'contents' permission set to 'write': .github/workflows/dependency-submission.yml:8","Info: topLevel 'actions' permission set to 'read': .github/workflows/release.yml:24","Warn: topLevel 'contents' permission set to 'write': .github/workflows/release.yml:26","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":7,"reason":"dependency not pinned by hash detected -- score normalized to 7","details":["Warn: third-party GitHubAction not pinned by hash: .github/workflows/release.yml:102: update your workflow using https://app.stepsecurity.io/secureworkflow/diceroll-dev/dice-parser/release.yml/main?enable=pin","Info:   7 out of   7 GitHub-owned GitHubAction dependencies pinned","Info:   2 out of   3 third-party GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 27 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-18T05:52:55.918Z","repository_id":37260733,"created_at":"2025-08-18T05:52:55.918Z","updated_at":"2025-08-18T05:52:55.918Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28408711,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T01:52:23.358Z","status":"online","status_checked_at":"2026-01-14T02:00:06.678Z","response_time":107,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["dice","java","kotlin"],"created_at":"2026-01-14T02:15:53.051Z","updated_at":"2026-01-14T02:15:53.582Z","avatar_url":"https://github.com/diceroll-dev.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"[\u003cimg src=\"https://avatars0.githubusercontent.com/u/56687116?s=400\u0026u=a1a754aad591efe43f8d00e768a87e67f6d3aead\" align=\"right\" height=\"64px\"/\u003e](https://github.com/diceroll-dev/dice-parser/)\n[![Maven Central](https://img.shields.io/maven-central/v/dev.diceroll/dice-parser.svg)](https://search.maven.org/#search%7Cga%7C1%7Cg%3A%22dev.diceroll%22%20a%3A%22dice-parser%22)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n\n# Dice Notation Parser for Kotlin and Java\n\nJava Usage:\n\n```java\nimport dev.diceroll.parse.Dice;\n...\n\n// evaluate an expression and return an integer \n        int result=Dice.roll(\"2d6\");\n\n// or\n\n// evaluate an expression and return a tree, which contains the values of the individual dice rolled \n        ResultTree resultTree=Dice.detailedRoll(\"2d6\");\n        int result=resultTree.value();\n```\n\nKotlin Usage:\n\n```kotlin\nimport dev.diceroll.parser.roll\nimport dev.diceroll.parser.detailedRoll\n\n...\n\n// evaluate an expression and return an integer \nval result: Int = roll(\"2d6\")\n\n// or\n\n// evaluate an expression and return a tree, which contains the values of the individual dice rolled \nval resultTree: ResultTree = detailedRoll(\"2d6\")\nval result: Int = resultTree.value()\n```\n\n## Supported Notation\n\n| Name                          | Notation                                            | Example         | Description                                                                                                                 |\n|-------------------------------|-----------------------------------------------------|-----------------|-----------------------------------------------------------------------------------------------------------------------------|\n|                               |                                                     |                 |                                                                                                                             |\n| Single Die                    | `d\u003cnumberOfFaces\u003e`                                  | `d6`            | roll one, six-sided die                                                                                                     |\n| Multiple Dice                 | `\u003cnumberOfDice\u003ed\u003cnumberOfFaces\u003e`                    | `3d20`          | roll three, twenty-sided dice                                                                                               |\n| Keep Dice                     | `\u003cnumberOfDice\u003ed\u003cnumberOfFaces\u003ek\u003cnumberOfDiceKept\u003e` | `3d6k2`         | keeps the the highest values out of three, six-sided dice                                                                   |\n| Keep Low Dice                 | `\u003cnumberOfDice\u003ed\u003cnumberOfFaces\u003el\u003cnumberOfDiceKept\u003e` | `3d6l2`         | keeps the the lowest values out of three, six-sided dice                                                                    |\n| Multiply Dice                 | `\u003cnumberOfDice\u003ed\u003cnumberOfFaces\u003eX`                   | `4d10X`         | multiplies the result of `4d10 * 4d10`                                                                                      |\n| Fudge Dice                    | `dF`                                                | `dF`            | roles a single \"fudge\" die (a six sided die, 1/3 chance of `-1`, 1/3 chance of `0`, and 1/3 chance of `1`)                  |\n| Multiple Fudge Dice           | `\u003cnumberOfDice\u003edF`                                  | `3dF`           | roles multiple fudge dice                                                                                                   |\n| Weighted Fudge Die            | `dF.\u003cweight\u003e`                                       | `dF.1`          | A weighted fudge die with 1/6 chance of a `1`, `2/3` chance of a `0` and 1/6 chance of a `-1`                               |\n| Multiple Weighted Fudge Dice  | `\u003cnumberOfDice\u003edF.\u003cweight\u003e`                         | `2dF.1`         | multiple weighted fudge dice.                                                                                               |\n| Exploding Dice                | `\u003cnumberOfDice\u003ed\u003cnumberOfFaces\u003e!`                   | `4d6!`          | any time the max value of a die is rolled, that die is re-rolled and added to the total                                     |\n| Exploding Dice (Target)       | `\u003cnumberOfDice\u003ed\u003cnumberOfFaces\u003e!\u003e\u003ctarget\u003e`          | `3d6!\u003e5`        | Same as exploding dice, but re-roll on values greater than or equal to the target (note, less than works too)               |\n| Compounding Dice              | `\u003cnumberOfDice\u003ed\u003cnumberOfFaces\u003e!!`                  | `3d6!!`         | similar to exploding dice, but ALL dice are re-rolled                                                                       | \n| Compounding Dice (Target)     | `\u003cnumberOfDice\u003ed\u003cnumberOfFaces\u003e!!\u003e\u003ctarget\u003e`         | `3d6!!\u003e5`       | similar as exploding dice (target), but all dice are re-rolled and added.                                                   |\n| Target Pool Dice              | `\u003cnumberOfDice\u003ed\u003cnumberOfFaces\u003e[\u003e,\u003c,=]\u003ctarget\u003e`     | `3d6=6`         | counts the number of dice that match the target (NOTE: greater \u0026 less than also match equals, i.e `\u003e=` and `\u003c=`)            | \n| Target Pool Dice (Expression) | `(\u003cexpression\u003e)[\u003e,\u003c,=]\u003ctarget\u003e`                     | `(4d8-2)\u003e6`     | A target pool roll, but where the expression is evaluated to the target.                                                    |\n| Integer                       | `\u003cint\u003e`                                             | `42`            | typically used in math operations, i.e. `2d4+2`                                                                             |\n| Math                          | `\u003cleft\u003e \u003coperation\u003e \u003cright\u003e`                        |\n| Add                           | `\u003cleft\u003e + \u003cright\u003e`                                  | `2d6 + 2`       |                                                                                                                             |\n| Subtract                      | `\u003cleft\u003e - \u003cright\u003e`                                  | `2 - 1`         |                                                                                                                             |\n| Multiply                      | `\u003cleft\u003e * \u003cright\u003e`                                  | `1d4 * 2d6`     |                                                                                                                             |\n| Divide                        | `\u003cleft\u003e / \u003cright\u003e`                                  | `4 / 2`         |                                                                                                                             |\n| Negative                      | `-\u003cdiceExpression\u003e`                                 | `-1d6`          | multiplies the result of the dice expression with -1                                                                        |\n| Oder                          | `\u003cdiceExpression\u003e[asc, desc]`                       | `10d10asc`      | ordering the results of the dice ascending (`asc`) or descending (`desc`)                                                   |\n| Min/Max                       | `\u003cdiceExpression\u003e[min, max]\u003cdiceExpression\u003e`        | `2d6min(1d6+3)` | returns the minimum or maximum of two dice expressions, e.g. `2d6min(1d6+3)` returns the smaller value of `2d6` and `1d6+3` |\n\n## Dependency Information\n\nMaven:\n\n```xml\n\n\u003cdependency\u003e\n    \u003cgroupId\u003edev.diceroll\u003c/groupId\u003e\n    \u003cartifactId\u003edice-parser\u003c/artifactId\u003e\n    \u003cversion\u003e${version}\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\nGradle\n\n```\nimplementation 'dev.diceroll:dice-parser:${version}'\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdiceroll-dev%2Fdice-parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdiceroll-dev%2Fdice-parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdiceroll-dev%2Fdice-parser/lists"}