https://github.com/paiv/swift-pcg-random
PCG Random for Swift language
https://github.com/paiv/swift-pcg-random
swift
Last synced: 5 months 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 (about 5 years ago)
- Default Branch: main
- Last Pushed: 2024-10-19T09:13:37.000Z (6 months ago)
- Last Synced: 2024-10-19T12:34:29.681Z (6 months 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
==[](https://ukrainewar.carrd.co/)
[](https://github.com/paiv/swift-pcg-random/actions)
[](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)
```