Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/paiv/swift-pcg-random
PCG Random for Swift language
https://github.com/paiv/swift-pcg-random
swift
Last synced: about 10 hours ago
JSON representation
PCG Random for Swift language
- Host: GitHub
- URL: https://github.com/paiv/swift-pcg-random
- Owner: paiv
- License: mit
- Created: 2020-03-14T21:10:02.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2024-10-19T09:13:37.000Z (29 days ago)
- Last Synced: 2024-10-19T12:34:29.681Z (29 days ago)
- Topics: swift
- Language: Swift
- Homepage:
- Size: 81.1 KB
- Stars: 14
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- Funding: .github/funding.yml
- License: license
Awesome Lists containing this project
README
PCG Pseudorandom Number Generator
==[![standwithukraine](https://user-images.githubusercontent.com/196601/157245183-b198283a-c395-4318-854d-74a635ee7e60.svg)](https://ukrainewar.carrd.co/)
[![](https://github.com/paiv/swift-pcg-random/workflows/Build/badge.svg)](https://github.com/paiv/swift-pcg-random/actions)
[![cocoapods](https://img.shields.io/cocoapods/v/PcgRandom.svg)](https://cocoapods.org/pods/PcgRandom)[PCG random][HOME] generator for Swift language.
[HOME]: https://www.pcg-random.org/
Installation
--### Swift Package Manager
```swift
dependencies: [
.package(url: "https://github.com/paiv/swift-pcg-random.git", .upToNextMajor(from: "1.0.0"))
]
```### CocoaPods
```ruby
pod 'PcgRandom', '~> 1.0'
```Usage
--```swift
import PcgRandom
var pcg = Pcg64Random(seed: 42)
let dice = Int.random(in: 1...20, using: &pcg)
print(dice)
```