JavaScript Game: Card Game(War) Shuffle Help?

Well, I've been working on a card game(war) in JavaScript, and have a Deck array containing all of the card names, but want to create an array for the user's deck and computer's deck, but I can't figure out how to give each person different cards for each value in the array... Like so; var... show more Well, I've been working on a card game(war) in JavaScript, and have a Deck array containing all of the card names, but want to create an array for the user's deck and computer's deck, but I can't figure out how to give each person different cards for each value in the array... Like so;

var userdeck = newArray();
userdeck[0] = random number here
//check if number exceeds highest card value(ace - 13)
userdeck[1] = randomnumber
//check if not taken
etc.

Same for computer's deck... How would I do this?
1 answer 1