reset password
Author Message
BryanYeh
Posts: 38
Posted 20:25 Dec 02, 2011 |

I'm look at this

 

Pile

Player

Draw

Discard

1

1

2

2

2

3

3

3

4

4

4

1

So basically each player gets 4 cards at the beginning from the deck(4 decks for each person). But when the 1st player draws from "Pile 1", where is the "Pile 1" coming from?( Is it the deck?)
and
Is a deck like this? : 0 0 0 0 1 1 1 2 2 2 3 3 3 4 4 4 5 5 5 6 6 6 7 7 7 8 9 9 9 10 11 11
malamma
Posts: 25
Posted 09:36 Dec 03, 2011 |

There should be a pile to the right and left of each player in the game. At the start of the game you give each player 4 cards each and then divide the rest of the deck evenly between the piles on the table. Every player then draws from the pile on his left and discard to the pile on his right.

For example, the first player draws from the last pile on the table (his right) and discards to "his" pile (his left). 

BryanYeh
Posts: 38
Posted 12:36 Dec 03, 2011 |

Oh, okay I get it. But what about the deck? Would it look like this?

0 0 0 0 1 1 1 2 2 2 3 3 3 4 4 4 5 5 5 6 6 6 7 7 7 8 9 9 9 10 11 11

malamma
Posts: 25
Posted 14:28 Dec 03, 2011 |

Sure. I don't think it matters how you input the deck as long as it's read into an object that contains an ArrayList, Queue, or Stack (depends on your implementation).

I used a Pile object named "deck" to store it which composes it into a queue. There's no need to make a new object for it.

 

You can also shuffle it using Collections.shuffle()

malamma
Posts: 25
Posted 14:29 Dec 03, 2011 |

Here's the deck I'm using to test:

 

 

1 1 1 2 2 2 3 3
3 4 4 4 4 5 5 5
6 6 6 7 7 7 8 8
8 9 9 9 0 0 0 9