Add DiceKit to your project using the Swift Package Manager
Roll some dice
import DiceKit
let myDie = Die.d6
let result = myDie.roll()
let myAbilityScore = try! myDie.roll(times: 4, .dropLowest)
let damageRoll = Dice("3d6 + 5")
let probabilityDistribution = damageRoll.probabilities
let mightDoNoDamage = damageRoll.chance(of: ...0) != 0
DiceKit
A Swift framework for simulating dice both real and unreal.
Documentation: https://samasaur1.github.io/DiceKit/
Quickstart
Add DiceKit to your project using the Swift Package Manager
Roll some dice