- uses the args argument parser as a CLI parser API https://taywee.github.io/args
- using the https://github.com/ZimProjects srell std::regex-like librarylibrary to parse the dice input strings https://www.akenotsuki.com/misc/srell/
- initially aiming at feature parity with the wonderful rolldice https://github.com/sstrickl/rolldice
Initially uses the same format that the rolldice C program uses:
{#x}{#}d[#|%]{*#}{+/-#}{s#}
{#x}
{#}d[#|%]
Which becomes an ECMAScript (JavaScript) regex with named-groups parseable by srell regex library:
std::string regexString = "^"
"(?<throwgroup>(?<throws>[0-9]{1,})(?<throwch>[x|X]{1})){0,}"
"(?<dicegroup>(?<numdice>[0-9]{1,})(?<dicechar>[d|D]{1})(?<sidestype>[0-9]{0,}|[%]{1})){0,}"
"(?<multgroup>(?<charmult>[*]{1})(?<nummult>[0-9]{1,})){0,}"
"(?<addsubgroup>(?<chaddsub>[+|-]{1})(?<numaddsub>[0-9]{1,})){0,}"
"(?<droplowgroup>(?<chardroplow>[s]{1})(?<numdroplow>[0-9]{1,})){0,}"
"$";
Stage the string parse into parts: Number of throws part optional Number and type of dice part required
- If there are no positional string arguments, drop into a "rolling shell" or "rolling session" where you type dicestrings and they are parsed from the line...
- fill in the options existing to operate similarly to rolldice
- someday I might integrate with GNOLLs amazing TTRPG dice string parser.
- Profit?