{"id":23814088,"url":"https://github.com/notjustanna/dice-notation","last_synced_at":"2025-08-04T18:18:56.511Z","repository":{"id":103408510,"uuid":"129918227","full_name":"NotJustAnna/dice-notation","owner":"NotJustAnna","description":"Dice Notation parsing library, based off Kaiper","archived":false,"fork":false,"pushed_at":"2019-08-11T04:59:36.000Z","size":150,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-02T03:46:19.620Z","etag":null,"topics":["dice","dice-notation","java"],"latest_commit_sha":null,"homepage":null,"language":"Java","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/NotJustAnna.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}},"created_at":"2018-04-17T14:35:56.000Z","updated_at":"2021-11-13T01:08:58.000Z","dependencies_parsed_at":null,"dependency_job_id":"0b1bcfa1-72f0-4aaa-b216-d8a53447a17b","html_url":"https://github.com/NotJustAnna/dice-notation","commit_stats":null,"previous_names":["notjustanna/dice-notation","annathelibri/dice-notation"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NotJustAnna%2Fdice-notation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NotJustAnna%2Fdice-notation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NotJustAnna%2Fdice-notation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NotJustAnna%2Fdice-notation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NotJustAnna","download_url":"https://codeload.github.com/NotJustAnna/dice-notation/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240079637,"owners_count":19744725,"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":["dice","dice-notation","java"],"created_at":"2025-01-02T03:46:24.560Z","updated_at":"2025-02-21T20:16:37.556Z","avatar_url":"https://github.com/NotJustAnna.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DiceNotation Library\nA full fledged Dice Notation (a.k.a `d20 + 2`) Java library.\n\nThe library was based of [Kaiper](https://github.com/Avarel/Kaiper) and even do mathematical expressions like `2 + 8 / 5`.\n\nLicensed under the [Apache 2.0 License](https://github.com/arudiscord/dice-notation/blob/master/LICENSE).\n\n### Installation\n\n![Latest Version](https://api.bintray.com/packages/arudiscord/maven/dice-notation/images/download.svg)\n\nUsing in Gradle:\n\n```gradle\nrepositories {\n  jcenter()\n}\n\ndependencies {\n  compile 'pw.aru.libs:dice-notation:LATEST' // replace LATEST with the version above\n}\n```\n\nUsing in Maven:\n\n```xml\n\u003crepositories\u003e\n  \u003crepository\u003e\n    \u003cid\u003ecentral\u003c/id\u003e\n    \u003cname\u003ebintray\u003c/name\u003e\n    \u003curl\u003ehttp://jcenter.bintray.com\u003c/url\u003e\n  \u003c/repository\u003e\n\u003c/repositories\u003e\n\n\u003cdependencies\u003e\n  \u003cdependency\u003e\n    \u003cgroupId\u003epw.aru.libs\u003c/groupId\u003e\n    \u003cartifactId\u003edice-notation\u003c/artifactId\u003e\n    \u003cversion\u003eLATEST\u003c/version\u003e \u003c!-- replace LATEST with the version above --\u003e\n  \u003c/dependency\u003e\n\u003c/dependencies\u003e\n```\n\n### Usage\n\nThe easiest way to start is by using the `SimpleDice` class.\n\n```java\nSimpleDice dice = new SimpleDice();\n\nint value = dice.resolve(\"d20 + 2\").intValue();\n```\n\nYou can extend the class and override behaviour to your liking.\n\nAlternatively, you can use the classes `DiceLexer`, `DiceParser`, `DiceSolver`, `DicePreEvaluator` and `DiceEvaluatorBuilder`.\n\n```java\nint value = new DiceParser(new DiceLexer(\"d20 + 2\"))\n            .parse()\n            .accept(new DiceSolver(this::roll).andFinally(builder.build()));\n```\n\nThe `DiceParser` generates AST which prints the original notation back with `Expr#toString`.\n\n```java\nString rolledDice = new DiceParser(new DiceLexer(\"d20+2\"))\n            .parse()\n            .accept(new DiceSolver(this::roll)).toString();\n```\n\n### Support\n\nSupport is given on [Aru's Discord Server](https://discord.gg/URPghxg)\n\n[![Aru's Discord Server](https://discordapp.com/api/guilds/403934661627215882/embed.png?style=banner2)](https://discord.gg/URPghxg)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnotjustanna%2Fdice-notation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnotjustanna%2Fdice-notation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnotjustanna%2Fdice-notation/lists"}