Java Card Game Challenge 2025
This six challenge series has you building your own card game. Each challenge has a webinar recording that can help guide you if you are looking for a solution. Of course, this game can be taken in a lot of different directions, so what is presented in the webinar is only one example of a solution.
Resources that might help you
Challenge 1: Create a Deck of Cards
Represent a deck of cards. Each card in the deck has a suit (hearts, diamonds, spades, or clubs) and a card face (Ace, 1 through 10, Jack, Queen, and King). There are a total of 52 unique cards in a deck.
Guiding Questions
- If a card has a suit, card face, and card value, what data types could you use to represent a single card?
- How can we group the features of a card together?
- How can you use
enum in the design of a card?
- Would you want to use a record or a class to represent a card?
- How can you create a deck of cards?
Watch the Recording
Challenge 2: All about Enum
Update our deck of cards program to iterate over the Suit and FaceofCard enum values.
Watch the Recording
Challenge 3: Write Methods to Deal Cards
Update our deck of cards program to add methods to deal cards to players and print the cards to the console.
- a no parameter method that deals 5 cards to 2 players
- a method with a parameter for number of cards to be dealt to 2 players
- a method with two parameters: one for the number of players and one for the number of cards
These methods will print the cards directly to the console.
Watch the Recording
Challenge 4: Our First Card Game
In this game, you should deal all the cards in the deck between two players. Compare the values of the two cards, the higher card wins the lower card and it is added to that players hand. If the cards are the same value, check the next card until you have two cards with different values, that player wins all the cards.
Watch the Recording
Challenge 5: Shuffle The Deck
The cards need to be shuffled. In this challenge, develop a few different ways to shuffle the cards and write shuffle methods.
- What class should the shuffle() method belong to?
Watch the Recording
--- To Be Announced