unique-random ![Build Status](https://secure.travis-ci.org/sindresorhus/unique-random.png?branch=master)
Generate random numbers that are consecutively unique.
Useful for eg. slideshows where you don't want to have the same slide twice in a row.
Install
Download manually or with a package-manager.
npm install --save unique-random
bower install --save unique-random
component install sindresorhus/unique-random
Example
Using Node.js. Will generate a random number between 1 and 10.
var uniqueRandom = require('unique-random')(1, 10);
console.log(uniqueRandom(), uniqueRandom(), uniqueRandom());
API
uniqueRandom(min, max)
Returns a function which when called will return a random number that's never the same as the previous number.
License
MIT © Sindre Sorhus