Gah its hard to explain..
but lets say...
There is:
case 1:
break;
case 2:
break;
case 3:
break;
And they are called at random.
I want to try and see wich is called the most.
Ok ok sorry i dont know what term to use say i say "call"
but i mean like
case(random(3));
void case(int n) {
switch (n) {
case 1:
break;
Lets say the random comes up with 1.
Thats what i mean by calling on 1 lol sorry.
Like a simple way i had some ideas but dont know how to do them..
And i dont want some long solution like if (2 > 1)
because there will be over 100 cases not just 3 ;)
Thanks and if i need to explain something more just tell me.
And also theres a second part..
I want to be able to do something like
void case(int num) {
switch (num) {
case 0:
return;
case 1:
return;
case 2:
return;
because if you have break; it doesnt stop the void so it checks through all the rest of them
wich is like a waste i guess. can i do that or can you not use return with cases?
And a part 3 sorry =)
lets say you had:
switch (n) {
case 1:
i = a;
continue;
case 2:
i = b;
continue;
}
if (i == a) {
//blah blah
}
If case 1 were true would it skip case 2 and go straight to the if statement or check if case 2 is true?
Thanks everyone!
