export function seededShuffleChildren(container, seed) {
    const children = Array.from(container.children);
    const shuffled = seededShuffle(children, seed);
    shuffled.forEach(child => container.appendChild(child));
}

export function seededShuffle(array, seed) {
    for (let i = array.length - 1; i > 0; i--) {
        const j = Math.floor(seededRandom(seed++) * (i + 1));
        [array[i], array[j]] = [array[j], array[i]];
    }
    return array;
}

export function seededRandom(seed) {
    const x = Math.sin(seed++) * 10000;
    return x - Math.floor(x);
}
