Game Wheel Hints

If you can carefully translate this pseudocode, the problem will be solved.

// copy all the prizecards into the scrambled arraylist

make a counting loop with i from 0-39

get a prizeCard from position i and add it to the scrambled ArrayList.

// repeat 40 times, pick a card, pick a random place to put it, swap the cards

make a counting loop with i from 0-39

int pick = a random number from 1 to 40

int other = 0

if pick is an odd number, other = a random odd number from 1 to 39 (20 different numbers, 2 apart, starting at 1)

if pick is a multiple of 10, other = a random number choice of 10,20,30 or 40 ( 4 different numbers, 10 apart, starting at 10)

else // pick a random even number from 2 to 38 that does NOT include 10,20,30 or 40

int tens = a random number from 0 to 3

int ones = a random, even number from 2 to 8

int other = tens*10 + ones;

// swap the cards

PrizeCard temp = get the card at location pick-1 in the scrambled arraylist

set the card at location pick-1 to be the one you get from poisition other - 1

set the card at location other-1 to be temp

// finished, return the scrambled arraylist

return scrambled