AdvancedDiceAndCoins 1.0.1
See the version list below for details.
dotnet add package AdvancedDiceAndCoins --version 1.0.1
NuGet\Install-Package AdvancedDiceAndCoins -Version 1.0.1
<PackageReference Include="AdvancedDiceAndCoins" Version="1.0.1" />
paket add AdvancedDiceAndCoins --version 1.0.1
#r "nuget: AdvancedDiceAndCoins, 1.0.1"
// Install AdvancedDiceAndCoins as a Cake Addin #addin nuget:?package=AdvancedDiceAndCoins&version=1.0.1 // Install AdvancedDiceAndCoins as a Cake Tool #tool nuget:?package=AdvancedDiceAndCoins&version=1.0.1
AdvancedDiceAndCoins
Proudly* presenting my first package, designed for simulating all kinds of dice rolls. My friends and family have told me it’s great! Give it a roll! (sorry) Your feedback is welcome.
Usage/Examples
using AdvancedDiceAndCoins;
int attack = Roll.D20; //D4, D6, D8, D10, D12, D100 supported as well
Dice longswordDamage = new("D8+2");
longswordDamage.Roll();
int forgotToSaveTheResultNoWorries = longswordDamage.LastRoll;
DiceSet redDragonBreath = new("18D6");
int playerHP = 23;
playerHP -= redDragonBreath.Roll();
DiceSet mixedDice = new();
mixedDice.Add(new Dice("D8+3")); //D8+3
mixedDice.Add(new Dice(10, 1)); //D10+1
mixedDice.Add(new Dice(1, 12, 6)); //D12+6
mixedDice.Add(new Dice(4)); //D4
mixedDice.Add(new Dice(10, 100, 0)); //D100 but smallest roll is 10
Dice rerollOneOnD6 = new(2, 6, 0); //smallestNumber, largestNumber, modifier
Dice a = new(6); //d6 same as => Dice a = new("D6");
Dice b = new(6);
a.Roll();
b.Roll();
int result = a + b;
int resultSub = a - b;
if (a > b)
{
Console.WriteLine("*: should be more modest");
}
Coin coin = new();
coin.Flip();
coin.Toss();
Console.WriteLine(coin.NumberOfTails);
bool trueOrFalse = TrueOrFalse.Decide()
string leftOrRight = LeftOrRight.Decide()
Authors
Feedback
If you have any feedback, please reach out at ifigazsisp@gmail.com
License
MIT License
Copyright (c) 2024, Zoltán Kapeller
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
-
net8.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Minor updates. Regarding Readme File, GetHash, Equal methods implemented, for Dice class.