I'm assuming the code should look something like this:
QString Boat::programming()
{
int rand = ???;
switch (rand) {
case 1:
return function1();
case 2:
return function2();
case 3:
return function3();
case 4:
return function4();
case 5:
return function5();
default:
return "";
}
}
Requirements:
- When I call the function a second or third time,
randcan not use the same value it had last time, or the time before. - Must use Qt's framework.
How should I go about this?
Aucun commentaire:
Enregistrer un commentaire