Move from one array to another

Put your problem here if it does not fit any of the other categories.

Move from one array to another

Postby gooberguy » Sun Mar 21, 2010 7:54 pm

I'm trying to develop a card game.

there are 4 players and each player is assigned an array of 52 and initially handed out 13 cards.
they can pick a card from their array and i want to move it to a garbageArray so they no longer have it, yet i can still deal it out when the person runs out of cards.

my question is, it is possible to take a section of an array, remove it and then move it into another array? also moving up the rest of the cards in the players array so there is no null in between them?

for example player one has [0]2spades, [1]3spades,[2] 4spades. he picks the 3 spades and then garbageArray[0] = 3spades.

now player ones array is [0]2Spades, [1]4spades [2]null

any ideas? thanks!
Junior Developer
Junior Developer
Posts: 20
Joined: Thu Mar 04, 2010 7:45 am


Return to Other Coding-Problems

Who is online

Users browsing this forum: Alexa [Bot] and 5 guests