Could you tell me if using <random> instead fixes that?
#include <random>
int RandInt(int Min, int Max)
{
static std::mt19937 Engine{std::random_device{}()};
return std::uniform_int_distribution<>{Min, Max}(Engine);
}
And then used like
const int CodeA = RandInt(Difficulty * 2, Difficulty * 3 - 1);
You can then remove srand(time(NULL))