Uno Project

Uno project

Uno deck

  • 19 Red cards – 0 to 9
  • 19 Blue cards – 0 to 9
  • 19 Green cards – 0 to 9
  • 19 Yellow cards – 0 to 9
  • 8 Skip cards – two cards of each color
  • 8 Reverse cards – two cards of each color
  • 8 Draw cards – two cards of each color
  • 8 Black cards – 4 wild cards and 4 Wild Draw 4 cards

What you need to do:

  1. You must implement and use a circular linked list, doubly linked list, and singly-linked list somewhere in your code. (try to do this without copying the videos!)
    1. Hint: Circular linked list is best for the player order
  2. Normally Uno is played with one deck of cards, but you must allow for one to three decks in the game.
    1. Ask the user at the start of a game for their name and the number of decks they want to use.
  3. The cards’ values must be stored in your data structures but displayed on the screen in the following format: face-value/color (1/Blue, 2/Yellow, +4/Black, Skip/Yellow).
  4. The user should be prompted for the number of AI players.
    1. You must allow for 1 or 2 AI players.
    2. This will be a text-based game.

Gameplay

  1. The player order is randomly chosen.
    1. The starting player is randomly chosen as well.
    2. Display player order and starting player on the screen.
  2. Each player is dealt seven cards.
    1. The remaining becomes the draw pile.
  3. If it is the player's turn
    1. Ask the player what they want to do: show hand, play card, say uno, draw,etc
      1. Cannot draw unless there is no other option.
    2. Do the action.
    3. Go to the next player’s turn.
  4. If it is an AI player’s turn
    1. They will play a card that fits the face up card on the discard pile, or draw if they cannot
  5. When a player has 1 card left, they must press their uno action or they gain three cards. AIs do this automatically or randomly, it is up to you.
  6. The game ends when a player has no more cards in their hand, and they win.

Challenge

To add an extra bit of difficulty to the project, write all of the gameplay to a file and be able to read it back into the code so the game doesn’t end when you stop the program.

If you are not familiar with reading and writing files, check this website out: https://www.codejava.net/java-se/file-io/how-to-read-and-write-text-file-in-java

Full course
Next Lesson