Go back to Richel Bilderbeek's homepage.
Go back to Richel Bilderbeek's C++ page.
The algorithm to shuffle a std::vector to a random order is already present in the STL. It is called std::random_shuffle and can be found in the header file algorithm.
#include <algorithm> |
Go back to Richel Bilderbeek's C++ page.
Go back to Richel Bilderbeek's homepage.