When I need to shuffle an array I usually do something like this
MyArray.Sort([this](const int Item1, const int Item2) {
return FMath::FRand() < 0.5f;
});
It’s nice and compact and no extra functions need to be defined.
When I need to shuffle an array I usually do something like this
MyArray.Sort([this](const int Item1, const int Item2) {
return FMath::FRand() < 0.5f;
});
It’s nice and compact and no extra functions need to be defined.