Developer Manual - MiaYWei/Group_G_UNO-Card-Game GitHub Wiki
- Software Overview
- Flowchart
- Functional Requirements
- Release Info
- Coding Language and Convention
- File and Folder Structure Organization
- Modules
- Testing Strategy
- Program Output
- Future Work
The purpose of this project is to develop the UNO Express card game in C programming language. This game is adopted from the original UNO game and has been implemented with slight modifications to make the single player game against a computer opponent more interesting. All this games requires to run is a Cygwin compiler or any other IDE with GNU GCC compiler. The development has been done in away to ensure clarity as well as in adherence with the desired coding standards.
The UNO Express card specifies a predefined set of keyboard inputs a player must be using in order to play the game. The program will understand these specified inputs and carry the game forward.
The working of the software is depicted in the form of flowchart below.
The software is equipped with the following functionalities
- A human player competes with a computer opponent.
- The computer opponent will play a valid random card.
- Game display screen with the following console output:
- Game Welcome screen: includes software name and copyright.
- Game Main menu: “Game Rules”, “Start New Game”, and “Exit”.
- When “Game Rules” is selected, then display the game rules.
- During the initialization of the game, display the cards assigned to the human player and the card on the table.
- Warning messages: In case of an illegal choice by the Human player.
- Display the latest discarded card information for each round: color and number or name.
- Display whose turn it is - human or computer as soon as one player ends his turn.
- Start a new game:
- Human player always starts the game first.
- Player name inquiry screen: Requires the Human player to enter his/her name.
- Each player will get five cards to start the game.
- Exit the game:
- Human player enters “q” or “Q” to quit the game.
- Warning message to confirm the exit action.
- Human player confirms the action or cancels the warning message.
- On each turn of the game, the player must perform one of the following actions.
- Drop a card matching the previous card on the table (discarded card) in color, number or symbol (symbols represent Action Cards).
- Request a card from the system by entering 'n' or 'N' on the keyboard, if there is no playable card in your hand
- Request to end turn by pressing 'e' or 'E'.
- If you have a matching card in your deck, you can discard it by using the following keyboard input combinations
- Skip card- Combine the first letter of the color with 'S', so if you want to discard(Red,Skip), Press RS.
- Draw one card- Combine the first letter of the color with 'O', so if you want to discard(Red,Draw-one), Press R0.
- Wild card- Press AW.
- Wild Draw two card- Press AT. (A above stands for Action cards, W stands for Wild, T stands for draw Two)
- To quit the game, Press Q or q. (You can choose to quit the game at any point of time).
- Once a player has no cards left, the game is over and s/he is declared the winner.
- Winning the game: The winner is the first player to get rid of all the cards in his/her hand.
- End of the game message: Notification for Winner of the game with the player’s name.
- Action Card #1 - Skip card:
- When a player uses this card, the next player loses his/her turn.
- This card may only be played on a matching color or another Skip card.
- Action Card #2 - Wild card:
- When a player uses this card, s/he gets to choose the color to continue the game (any color including the color in play before the Wild card was laid down).
- You may play a Wild card on your turn even if you have another playable card in your hand.
- Action Card # 3 - Draw One card:
- When a player uses this card, the next player must draw a card and lose their turn.
- This card may only be played on a matching color or on another Draw One card.
- Action Card # 4 - Wild Draw Two cards:
- When a player uses this card, s/he gets to choose the color to continue the game PLUS the next player must draw 2 cards from the DRAW pile and lose their turn.
The software was implemented and delivered in two releases.
- Release 1 covers the Main menu, Normal cards functionality and the Winner declaration. Features 1-9 belong to Release 1.
- Release 2 includes the addition of action cards to the card set. Both the human and computer related functions for action cards were developed in this release. Features 10-14 belong to Release 2.
The application is developed entirely in C programming language. The desired coding conventions for C language are followed and are aligned with the specifications provided by Prof Cristina Ruiz Martin of the course SYSC5709 at Carleton University as part of the project requirements.
The following file structure is used to organize files in this repository:
- /bin - Contains the files created after executing the make file.
- /doc - Contains the designed flowchart for the application. The main documentation can be found in the UNO Express User Manual. Also contains the doxygen config file to generate the doxygen documentation.
- /src - Contains the definition for all functions.
- /include - All Header files are included here that are used throughout the application.
- /test
- /data - Contains the log files generated during testing.
- /include - Contains the header files for the test files.
- /src - Contains the definitions for all unit tests.
- test.c - Main file that calls the test functions in other files.
The project is divided into 5 modules as follows,
-
Menu Display- Displays the Welcome screen along with the Main menu during the start of the game.
-
Game - This module handles the initialization of the game, assigning each player with 5 cards during the start of the game and setting up the discard and draw piles. This also has the functionality to end each player's turn as well as quit game.
-
Cards Management - All card related functionalities like the declaration of cards structures, global variables, add/remove card, display card are all taken care of here.
-
Computer Player - Computer player related functions is implemented here.
-
Human Player- Human player functionality is supported here.
- Black-box testing strategy is used. All tests can be run by executing the 'UNO-Card-Game_Test' file inside the bin folder.
- The test cases are logged into a file name 'test_log.txt' which is inside the '/test/include/data' folder.
- All the test files are run at the same time. You can see the results of the each test case printed module wise in the log file.
- If a test case fails, then the status is printed in the output file with the expected and actual values.
Refer to the User Documentation for help regarding executing the test files.
The testing log file looks like this,
The image below shows the final output on the terminal. The game continues till one player wins the game or the human player quits the game.
The project has been developed with an intention to deliver in two releases, keep in mind the time constraints. However below are some avenues for improvement that we identified during the course of development. We hope to work on these in the future and are open to suggestions.
- Timer implementation to monitor the time taken by the human player to make his choice during each turn. If he exceeds the stipulated time, we can give out a warning.
- Scoreboard display to keep in track the player history and show the lead players
- Extend the application to a multiplayer game.