A fluent dice library, you know, for games!
Version 1.1
- Added
this.GrabPercentileDice()
- Added
DivisionRoundingUp()
andDivisionRoundingDown()
- Added Basic Integer Operators (
+
,-
, and*
) - Improved Tests (now test against 1000 rolls)
Version 1.0
- Initial Release
- Reference
NDiceBag.dll
- Add
using NDiceBag;
to your class - Grab some dice!
- 3d6 would be
3.d()
- 3d4 would be
3.d(4)
- 3d4x10 would be
3.d(4).x(10)
or3.d(4) * 10
- 3d4+5 would be
3.d(4).Plus(5)
or3.d(4) + 5
- 3d4-2 would be
3.d(4).Minus(2)
or3.d(4) - 2
- 1d10 / 2 rounding up would be
1.d(10).DivideRoundingUp(2)
- 1d10 / 2 rounding down would be
1.d(10).DivideRoundingDown(2)
- 3d4 + 2d8 would be
3.d(4) + 2.d(8)
- 3d4 - 2d12 would be
3.d(4) - 2.d(12)
- 3d4 * 1d20 would be
3.d(4) * 1.d(20)
- 3d4d10 would be
3.d(4).d(10)
- All dice object instances contain
.Roll()
- Operators return a dice object:
(3.d(4) + 1.d()).Roll()
- Modifiers are chain-able:
3.d().x(10).Plus(2).Minus(5).Roll()
or(3.d() * 10 + 2 - 5).Roll()
- Operators are chain-able:
(3.d(8) + 2.d(4) - 3.d(6)).Roll()
- Thoughts on string parsing (Regular Expressions FTW/FTL?)
- Possible ToString functionality (e.g. 3.d().ToString() == "3d6")
- Thoughts on division operators (assume default rounding down?)
- String parsing
- More cool stuff
Easy Percentile DiceDivision?
Mersenne Twister algorithm courtesy of Rory Plaire ([email protected]), Copyright 2007 - 2008