I think there is a big flaw in Matthew's code.

Instead of using a real random function there is this code:

Math.floor(Math.abs(Math.sin(seed++)) * currentIndex);

There are 2 flaws here I think:
1. sin isn't very "random"
2. sin goes from 0 to 1. This will lead to a just shuffled element being 
shuffled a second time. Even worse it can lead to array index out of bounds 
if the seed is (n * pi)+(pi/2). Try it with seed= 3.14159265359/2 ;)

will open an issue on github

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/e5210bfe-82b6-4c5f-92aa-01d3590b1db9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to