I am generating random Nos to store my matrix index for row and column . That is different row and column index Nos every time not repeat. But some time same value is generating.How to rectify this problem.
This is what i written .. for example
4 * 4 Matrix. i am running with loop and storing date
int i;
for (i=0;i<6;i++)
{
Row = arc4random() % 4 ;
Column = arc4random() % 4;
CGFloat xOffset1 = (block.contentSize.width+350)+((block.contentSize.height-15)*Column);
FireBlock.position = ccp(xOffset1,Row*15);
statement 1--- store Column;
statement 2--- store Row;
}
With only 16 different combinations, I’d write all of them in an array, shuffle the array, then select from the array.