I need to randomly generate three cards from array i have the array of 52 cards names from card1 to card52
String rank[]=new String[52];
for(int i=0;i<rank.length;i++)
{
rank[i]= "card"+i;
}
Now i need to select three cards from the array and it should not be repetable.
can anybody help me. actually i m doing this bt cards are repeting.
pls provide me the sollution.
Thanks in Advance.
Have an array (or even a string) and add to it whenever you select a card. That way whenever you select the second or third card you can select another one if it is in the array (or string).
Here is one way to do it… I didn’t check if it works.