dimanche 25 novembre 2018

Check if multiple elements in an array contain the same value

For instance I have an array that gets filled with random numbers and am going to call this one dice.

Random rnd = new Random()
int[] dice=new dice [5]
for (int i=0;i<dice.length;i++)
{
dice[i]= rnd.next(1,7)
}

Now for the sake of simplicity I wanna ask how can I find out if got a three of a kind of instance.




Aucun commentaire:

Enregistrer un commentaire