diff --git a/src/main/java/solitaer/CardDeck.java b/src/main/java/solitaer/CardDeck.java index 41a6518..3b49bdf 100644 --- a/src/main/java/solitaer/CardDeck.java +++ b/src/main/java/solitaer/CardDeck.java @@ -1,6 +1,7 @@ package solitaer; import java.util.ArrayList; +import java.util.Collections; public class CardDeck { @@ -33,4 +34,9 @@ public class CardDeck { return deck; } + + public void shuffelDeck() { + Collections.shuffle(deck); + } + } diff --git a/src/main/java/solitaer/SolitaerGamePanel.java b/src/main/java/solitaer/SolitaerGamePanel.java index 0edca74..26b1e18 100644 --- a/src/main/java/solitaer/SolitaerGamePanel.java +++ b/src/main/java/solitaer/SolitaerGamePanel.java @@ -48,6 +48,7 @@ public class SolitaerGamePanel extends JPanel { this.addMouseListener(mouseL); deck = new CardDeck(); + deck.shuffelDeck(); for (int i = 0; i < STARTSTACK_SIZE; i++) { int y = setLayouty(1);