✅ Pick random elements from array based on seed and randomise the order based also on seed.
I have an array with unique objects.
I'm writing this in fronted, Javascript and it looks should take these parameters:
let arrayWithObjects [new obj(x,y), new obj(a,b), new obj(d,e)... ] ;
function getRandomCards( seed, arrayWithObjects, newArrayLength){
//some code
return [x,y];
};
Seed is the parameter given by the user.
ArrayWithObjects is the array that I should take the objects out.
NewArrayLength should be the amount of object to pick.
TLDR:
Create a new array with a specified count by the user of unique objects from different array and then randomise the order(with seed parameter so that the outcome is repeatable), JavaScript.