According to Steffen's post this is an efficient way to generate random BOOL
s in cocos2d
+(BOOL) getYesOrNo
{
return (CCRANDOM_0_1() < 0.5f);
}
but how do I set a range for this? (e.g. 0 - 29 is the interval and 5 ones BOOL
=
NO
, 25 ones BOOL
=
YES
)
you can do something like this: