Hello,
I think this should be an easy question for most but I'm having trouble finding the answer. I know how to switch between cases using rand and arcrand but how do I switch them in order 1,2,1,2,1,2,1,2...
thanks,
Nick
I think this should be an easy question for most but I'm having trouble finding the answer. I know how to switch between cases using rand and arcrand but how do I switch them in order 1,2,1,2,1,2,1,2...
Code:
// for random
int Number = rand() % 2;
switch (Number){
case 0:{
NSLog(@"one");}
break;
case 1:{
NSLog(@"two");}
break;
default:
break;
}
}
// for non random
int Number = //How do I just make this = 2
switch (Number){
case 0:{
NSLog(@"one");}
break;
case 1:{
NSLog(@"two");}
break;
default:
break;
}
}
thanks,
Nick
Last edited: