I have created a shuffling program that uses a 5X5 array and a vector. The vector should store the values 1 through 25 inclusive and the array should just have 0 for each element. Once the shuffle() function is passed it should randomly position the 1 through 25 values of the vector in the array.
void Match::shuffle() {
std::vector<int> vec(25);
int randNum = rand() % (vec.size());
for (int i = 1; i < 26; i ++) {
vec.push_back(i);
}
for (int i = 0; i < 5; i++) {
for (int j = 0; j < 5; j++) {
backArr[i][j] = vec.at(randNum);
vec.erase(vec.begin() + randNum);
randNum = rand()%vec.size();
}
}
}