Reply:
Choose a chant with a random number, and each option corresponds to a range of
Reply:
Trouble can say elaborate?
Reply:
Do not understand what is meant by a random number landlord can it
int index = random ()% count;
Reply:
Random number, then the better. . .
int value = arc4random ()% x; generates a random number of 1 to x-1. . .
Randomly selected ah randomly selected. . .
Reply:
A random number (0 ---- 0.999999). Taken out, multiplied by the number of options you want max_index * random ()
Then erase the decimal point, and replaced with int
Reply:
Brother, I'm begging you, do not mention random things, that I know, talking about random issues. . .
Reply:
up together, I mean to say how to achieve the realization of multiple buttons disrupted for example, and then to a random sample, if the random number, the problem is that I will lead a few buttons and this one is no longer a sign corresponding relationship between the
Reply:
Is this mean?
Button disrupted btn.tag = arc4random ();
Then sorted by size tag, and then index = arc4random ()% count, taking the first few btn
Reply:
Ah, man, this idea is actually quite good, but now with btn.tag = arc4random (); disrupted button may be circumstances where the two buttons tag value equal ah
No comments:
Post a Comment