ScottLilly/SOSCSRPG

Extend RandomNumberGenerator to have dice roll function

Closed this issue · 5 comments

New feature

Add a function to let programmers call a function to roll an N-sided die, X number of times.

See: this comment

I actually have built a fully functional dice rolling library. You can find it on NuGet.org: https://www.nuget.org/packages/d20tek-dicenotation/. Not only can you call the library to roll any sided dice, but you can also just pass in a dice notation string (like "1d20+5") and parse the string into the appropriate roll.

I wouldn't mind writing up how I implemented it, and the source code is up on: https://dev.azure.com/d20Tek/Libraries/_git/dicenotation.

@ScottLilly what do you think about this?

We chatted in Discord, but (in case anyone else is only looking at GitHub), this sounds good.

Just as a thought, do you plan to convert the package to .NET 5, when it's released? Once .NET 5 is officially released, I'd like to convert SOSCSRPG to that. It should still be able to use the NuGet package, since it's .NET Core 3.1. But that will be something we want to check on when we convert SOSCSRPG.

Sounds good. I will work on integrating it.
And yes, I plan to upgrade the DiceNotation NuGet package to new versions of .NET including 5. My library is already .NET Core 3.1.

Look good. Thanks!