Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bodil/unpredictable
More randomness for Clojure
https://github.com/bodil/unpredictable
Last synced: 23 days ago
JSON representation
More randomness for Clojure
- Host: GitHub
- URL: https://github.com/bodil/unpredictable
- Owner: bodil
- Created: 2012-07-17T19:27:55.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2012-07-17T19:30:17.000Z (over 12 years ago)
- Last Synced: 2024-11-17T20:57:13.988Z (about 1 month ago)
- Language: Clojure
- Size: 89.8 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Unpredictable
Unpredictable is a collection of Clojure functions for producing
randomness.## Usage
Add the dependency to your project.clj:
```clojure
[unpredictable "0.1.0"]
```Now use it like this:
```clojure
;; Make a set of 5 distinct items from the sequence
> (rand-from-seq 5 (range 10))
#{1 2 3 6 7};; Map 3 random items from the sequence through str
> (rand-map 3 str (range 10))
(0 1 2 "3" "4" 5 6 7 "8" 9)
```## License
Copyright © 2012 Bodil Stokke
Distributed under the Eclipse Public License, the same as Clojure.