Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/samasaur1/dicekit
A Swift module for simulating dice both real and unreal
https://github.com/samasaur1/dicekit
dice hacktoberfest simulating-dice swift
Last synced: 2 months ago
JSON representation
A Swift module for simulating dice both real and unreal
- Host: GitHub
- URL: https://github.com/samasaur1/dicekit
- Owner: Samasaur1
- License: afl-3.0
- Created: 2018-08-21T23:08:45.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2022-07-27T23:22:59.000Z (over 2 years ago)
- Last Synced: 2024-10-30T17:17:54.455Z (2 months ago)
- Topics: dice, hacktoberfest, simulating-dice, swift
- Language: Swift
- Homepage: https://samasaur1.github.io/DiceKit/
- Size: 17.9 MB
- Stars: 4
- Watchers: 4
- Forks: 4
- Open Issues: 18
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: .github/CONTRIBUTING.md
- License: LICENSE
- Code of conduct: .github/CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# DiceKit [![tests](https://github.com/Samasaur1/DiceKit/actions/workflows/test.yml/badge.svg?event=push)](https://github.com/Samasaur1/DiceKit/actions/workflows/test.yml)
A Swift framework for simulating dice both real and unreal.
---
**Documentation**: https://samasaur1.github.io/DiceKit/
| Swift Version | Latest DiceKit version |
| ------------- | ---------------------- |
| Below Swift 4 | Not supported |
| Swift 4.0.x | [v0.15.0](https://github.com/Samasaur1/DiceKit/releases/tag/v0.15.0) |
| Swift 4.1.x | [v0.15.0](https://github.com/Samasaur1/DiceKit/releases/tag/v0.15.0) |
| Swift 4.2.x | [Latest version](https://github.com/Samasaur1/DiceKit/releases/latest) |
| Swift 5.0.x | [Latest version](https://github.com/Samasaur1/DiceKit/releases/latest) |
| Swift 5.1.x | [Latest version](https://github.com/Samasaur1/DiceKit/releases/latest) |
| Swift 5.2.x | [Latest version](https://github.com/Samasaur1/DiceKit/releases/latest) |
| Swift 5.3.x | [Latest version](https://github.com/Samasaur1/DiceKit/releases/latest) |
| Swift 5.4.x | [Latest version](https://github.com/Samasaur1/DiceKit/releases/latest) |
| Swift 5.5.x | [Latest version](https://github.com/Samasaur1/DiceKit/releases/latest) |
| Swift 5.6.x | [Latest version](https://github.com/Samasaur1/DiceKit/releases/latest) |
| Swift 5.7.x | [Latest version](https://github.com/Samasaur1/DiceKit/releases/latest) |---
## Quickstart
### Add DiceKit to your project using the Swift Package Manager
### Roll some dice
```swift
import DiceKitlet 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
```