so im trying to make a random number generator that will give me 1, 2 or 3 but for some reason it always give me 3. sorry its in french but i figured it didnt really matter. also tell me if something is missing its my first time posting here.
#include <iostream>
#include <fstream>
#include <string>
#include <ctime>
RPC choixOrdi()
{
int min = 1;
int max = 3;
int randNum = rand() % (max - min + 1) + min;
return convertirRandNum(randNum);
}
RPC convertirRandNum(int randNum)
{
switch (randNum)
{
case 1:
return RPC::Roche;
break;
case 2:
return RPC::Papier;
break;
case 3:
return RPC::Ciseaux;
break;
default:
return RPC::Invalid;
}
}```