attempt to fix rand_array()

This commit is contained in:
Alexander Bocken 2024-02-21 10:29:17 +01:00
parent bda44e4647
commit 8b5e089792
Signed by: Alexander
GPG Key ID: 1D237BE83F9B05E8

View File

@ -1,6 +1,4 @@
const time = new Date()
const MS_PER_DAY = 86400000
let seed = Math.floor(time.getTime()/MS_PER_DAY)
function mulberry32(a) {
return function() {
var t = a += 0x6D2B79F5;
@ -11,6 +9,8 @@ function mulberry32(a) {
}
export function rand_array(array){
let time = new Date()
const seed = Math.floor(time.getTime()/MS_PER_DAY)
let rand = mulberry32(seed)
array.sort((a,b) => 0.5 - rand())
return array