From 80fbe62c36a368eafbdcb4430bd7c6ab7596fe5f Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Tue, 3 Dec 2013 01:47:42 -0600 Subject: [PATCH 1/3] using github exactly the wrong way --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 914bbbd..2423bbf 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ Browser Example === ```html - + ``` ```javascript From 9ad4188e38371597c8ff49a1acebd1220c39d457 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Tue, 3 Dec 2013 01:48:45 -0600 Subject: [PATCH 2/3] fixed link --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2423bbf..29e4d35 100644 --- a/README.md +++ b/README.md @@ -67,4 +67,4 @@ See Also * [How to randomize/shuffle a JavaScript array](http://stackoverflow.com/questions/2450954/how-to-randomize-shuffle-a-javascript-array) * [Fisher-Yates Shuffle on Wikipedia](http://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle) * [Doing the Microsoft Shuffle: Algorithm Fail in Browser Ballot](http://www.robweir.com/blog/2010/02/microsoft-random-browser-ballot.html) - * [knuth-shuffle on NPM](https://npmjs.org/package/citare-scriptum) + * [knuth-shuffle on NPM](https://npmjs.org/package/knuth-shuffle) From faa2f1b27d68be546ae9434f6539893cf9701b9d Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Tue, 3 Dec 2013 01:50:09 -0600 Subject: [PATCH 3/3] more typo fix and moved links to top --- README.md | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 29e4d35..895b26b 100644 --- a/README.md +++ b/README.md @@ -3,14 +3,22 @@ knuth-shuffle The Fisher-Yates (aka Knuth) shuffle for Browser and Node.js + * [Mike Bostock's Fisher–Yates Shuffle Visualization](http://bost.ocks.org/mike/shuffle/) + * [How to randomize/shuffle a JavaScript array](http://stackoverflow.com/questions/2450954/how-to-randomize-shuffle-a-javascript-array) + * [Fisher-Yates Shuffle on Wikipedia](http://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle) + * [Doing the Microsoft Shuffle: Algorithm Fail in Browser Ballot](http://www.robweir.com/blog/2010/02/microsoft-random-browser-ballot.html) + * [knuth-shuffle on NPM](https://npmjs.org/package/knuth-shuffle) + +'nuf said. + The Fisher-Yates (Knuth) Shuffle === As Microsoft learned the hard way (see article below), `function random() { return 0.5 - Math.random() }` turns out to be no-so-random at all. -The fisher-yates shuffle is an algorithm so simple that not even +The fisher-yates shuffle is an algorithm so simple that even [IEEE floating point math](http://blogs.adobe.com/bparadie/2011/11/22/0-2-0-1-0-30000000000000004/) -can screw it up! +can't screw it up! I put this on npm as `knuth-shuffle` because `fisher-yates-shuffle` was just too long of a name and shuffle was already taken. @@ -59,12 +67,3 @@ npm install -S knuth-shuffle console.log(b); }()); ``` - -See Also -=== - - * [Mike Bostock's Fisher–Yates Shuffle Visualization](http://bost.ocks.org/mike/shuffle/) - * [How to randomize/shuffle a JavaScript array](http://stackoverflow.com/questions/2450954/how-to-randomize-shuffle-a-javascript-array) - * [Fisher-Yates Shuffle on Wikipedia](http://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle) - * [Doing the Microsoft Shuffle: Algorithm Fail in Browser Ballot](http://www.robweir.com/blog/2010/02/microsoft-random-browser-ballot.html) - * [knuth-shuffle on NPM](https://npmjs.org/package/knuth-shuffle)