attempt to fix rand_array()
This commit is contained in:
parent
bda44e4647
commit
8b5e089792
@ -1,6 +1,4 @@
|
|||||||
const time = new Date()
|
|
||||||
const MS_PER_DAY = 86400000
|
const MS_PER_DAY = 86400000
|
||||||
let seed = Math.floor(time.getTime()/MS_PER_DAY)
|
|
||||||
function mulberry32(a) {
|
function mulberry32(a) {
|
||||||
return function() {
|
return function() {
|
||||||
var t = a += 0x6D2B79F5;
|
var t = a += 0x6D2B79F5;
|
||||||
@ -11,6 +9,8 @@ function mulberry32(a) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function rand_array(array){
|
export function rand_array(array){
|
||||||
|
let time = new Date()
|
||||||
|
const seed = Math.floor(time.getTime()/MS_PER_DAY)
|
||||||
let rand = mulberry32(seed)
|
let rand = mulberry32(seed)
|
||||||
array.sort((a,b) => 0.5 - rand())
|
array.sort((a,b) => 0.5 - rand())
|
||||||
return array
|
return array
|
||||||
|
Loading…
Reference in New Issue
Block a user