Yael Kelmer's README file.
To run my code you just need to type: ./finalproject
My final project recreates the card game SET. This is how the game works: There will be 9 cards displayed on your screen. Each card has 3 characteristics: a number(1, 2, 3), a fill(e (empty), f (full), s (striped) ), and a shape(c (circle),s (square), t (triangle) ). These cards can be combined to form a SET. What is a SET you may ask? A SET is three cards, where each characteristic, when looked at individually, is either all the same OR all different. For example, a SET, would be three cards who have all different numbers, all different fills, and all the same shape. Your goal is to find as many SETs as you can! When you spot a set type in the location of each card (the location is the number next to the description of the card). If you think thereare no SETs on the board, you can request more cards.
The code uses a struct to create the characteristics of the card, which are number, fill, and shape. The code uses 5 functions that I created. These functions generate the deck of cards, shuffle the cards, display the cards on the board, display the necessary cards on the board, and check if the 3 cards that the user selected are in fact a set. Within int main() I use the functions that create the deck of cards and shuffles them. Then I explain the rules of the game to the user. After the user says they are ready, 9 cards are displayed on the board. The user has the option to add more cards (in case there are no SETs on the board) as long as there are more cards in the deck that are available. If the user would like more cards, then 3 more cards are printed on the screen. The user then inputs the locations of the three cards that they think are a set and the code utilizes the function that checks if three cards are a set to check. If it is a SET then the user is told it is a SET and if it is not, the user is told it is not a SET. Once there are no more cards in the deck and all the cards are displayed on the board, the user is asked if they want to stop the game. If they feel that there are no more sets they can say yes and the game stops. If they feel that there are more sets they can continue to play and they will continue to be prompted to stop the game.
In my proposal I said that I would use UNICODE characters to display the cards. However, as I was coding I realized that I did not know how to implement it, so I displayed the cards in a different manner.