Fixed .sort

This commit is contained in:
Mahdi Dibaiee 2014-09-06 21:17:27 +04:30
parent b5c4f8bd10
commit d6935f1456

View File

@ -49,9 +49,9 @@ function loremipsum(data) {
}
}
var d = dictionary[method].concat(general),
r = d.sort(function(a, b) {
return Math.random() > 0.5;
var r = dictionary[method].concat(general);
r.sort(function() {
return Math.floor(Math.random()*3-1);
});
switch(unit) {
@ -65,7 +65,7 @@ function loremipsum(data) {
r = stretch(r, 15*(Math.random()+1));
var s = r.join(' ') + '. <br>';
for(var i = 1; i < amount; i++) {
r = r.sort(function() { return Math.random() > 0.5; });
r = r.sort(function() { return Math.floor(Math.random()*3-1); });
r = stretch(r, 15*(Math.random()*3+2));
s += r.join(' ') + '. <br>';