https://github.com/snyderks/stairs
A Go library to randomly select items from a weighted array.
https://github.com/snyderks/stairs
array golang random selection weighted
Last synced: over 1 year ago
JSON representation
A Go library to randomly select items from a weighted array.
- Host: GitHub
- URL: https://github.com/snyderks/stairs
- Owner: snyderks
- License: mit
- Created: 2017-08-16T17:40:37.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-10-18T15:42:17.000Z (almost 9 years ago)
- Last Synced: 2024-06-20T03:45:30.681Z (about 2 years ago)
- Topics: array, golang, random, selection, weighted
- Language: Go
- Size: 4.88 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Stairs

Stairs is a utility to randomly select items from a weighted array quickly and without high memory usage by creating continuous distribution functions to select from.
To install, simply `go get github.com/snyderks/stairs` and `import github.com/snyderks/stairs` to use in your project.
See `stairs_test.go` for basic usage.