✅ 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.
8 Replies
TheRanger
TheRanger2y ago
this is a C# server, maybe you should ask in a JS server?
HappyTeaKid
HappyTeaKidOP2y ago
well dot net is kinda related to C# right?
Angius
Angius2y ago
Sure But you said it's JS code And seeing the let and function seems to back that claim up
HappyTeaKid
HappyTeaKidOP2y ago
If needed it could be made on the backend side But I preffer it to be on front
Angius
Angius2y ago
Well, a JS answer will be different than a C# answer, that's for sure If you want it to be on the frontend, that's JS So ask in $javascript maybe $js
Angius
Angius2y ago
You're more likely to get JS help in a JS server than in a C# one
HappyTeaKid
HappyTeaKidOP2y ago
Thanks
Want results from more Discord servers?
Add your server