AKDice 3.1.5.11

dotnet add package AKDice --version 3.1.5.11                
NuGet\Install-Package AKDice -Version 3.1.5.11                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="AKDice" Version="3.1.5.11" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add AKDice --version 3.1.5.11                
#r "nuget: AKDice, 3.1.5.11"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install AKDice as a Cake Addin
#addin nuget:?package=AKDice&version=3.1.5.11

// Install AKDice as a Cake Tool
#tool nuget:?package=AKDice&version=3.1.5.11                

AKDice

Dice roll simulations. See the Doc.md for more details, but in short:

Usage

using Anikaiful.Dice;

Statics

Ranges

  • int Dice.Range(int min, int max)
  • double Dice.Range(double min, double max)
  int ir    = Dice.Range(3,11);
  double dr = Dice.Range(3.0,11.0);

Randoms

  • bool Dice.ToBoolean(bool? tf)
  • bool Dice.Chance(int probability=50)
  bool b1 = Dice.ToBoolean(true);   // == true
  bool b2 = Dice.ToBoolean(null);   // randomly true|false.
  bool b3 = Dice.Chance(75);        // 75% chance to result in true.

int Extensions

  • d2 (int mod=0, int probability=100)
  • d3 (...)
  • d4 (...)
  • d5 (...)
  • d6 (...)
  • d8 (...)
  • d10 (...)
  • d12 (...)
  • d20 (...)
  • d100 (...), all as per d2 above.
  • Probability (int|string probability, int otherwise=0)
  int r1 = 5.d6();
  int r2 = 5.d6(5);
  int r3 = 5.d6(5, 75);
  int r4 = 5.d6(mod: 5, probability: 75);
  int r5 = 5.d6(probability: 75);
  int r6 = (5.d6(5, 1.d100())).d6(probability: 25);
  int p1 = 10.Probability(50);
  int p2 = 25.Probability(75, /*otherwise:*/ 10);
  // lambda arg:
  int f1 = 85.Probability(() => 1.d20(), /* otherwise: */ 0); // 85% chance for 1.d20(), otherwise 0

string Extensions

  string s  = "string with 5d6+5 embedded".Evaluate();
  int i     = "5d6+5".Evaluate<int>();
  long l    = "5d6+5".Evaluate<long>();
  float f   = "5d6+5".Evaluate<float>();
  double d  = "5d6+5".Evaluate<double>();
  decimal m = "5d6+5".Evaluate<decimal>();

Evaluate methods have their corresponding Maximize and Minimize variants, e.g.

  int mi = "5d10+5".Minimize<int>();
  int mx = "5d10+5".Maximize<int>();

bool Extensions

  bool b1 = true.Probability(75);       // 75% chance for b1==true, 25% for b1==false
  bool b2 = (b1==true).Probability(33); // ;-) ... yeah, go figure ...
  bool b3 = true.Probability("50");	// 50% chance for b3 to be true
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  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. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETStandard 2.1

    • 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.

Version Downloads Last updated
3.1.5.11 561 4/21/2022