Search:

Type: Posts; User: KevinWorkman

Search: Search took 0.11 seconds.

  1. Re: Shuffling an Array is putting the same integer in more than one place

    What happened when you tried?

    What you need to do is figure out *what you're trying to do* first. How would you do this in real life, with a real deck of cards?

    Pretend you have a friend who...
  2. Re: Shuffling an Array is putting the same integer in more than one place

    Think about what this for loop is doing:


    for (int i=0; i<3; i++)
    {
    int randomPosition = r.nextInt(3);
    RandomDeck[randomPosition] = Deck[i];
    }
Results 1 to 2 of 2