C PROGRAMMING GAME UNO: (Not C++, Java, Python, etc.) Hi all! I\'m having troubl
ID: 3704854 • Letter: C
Question
C PROGRAMMING GAME UNO: (Not C++, Java, Python, etc.)
Hi all! I'm having trouble starting this C-Programming prompt. I'm not asking for actual code. Pseudocode would be much appreciated so that I can gain ideas of how to start or possibly tweak what you guys give me to how I would have approached it. Attached to this post are the rules and conditions of what my code is supposed to do. Thank you so much in advance, and have a great day!
2 A Game of UNO You are to develop an interactive game of UNO between two players. The gameplay for UNO is described at https://www.unorules.com/. Your program should operate as follows. 2.1 Setup 1. UNO cards are represented as variables of the following type typedef struct card s ( char suit [7]: int value; char action [15] struct card s pt; card You are allowed to add attributes to this definition, but not to remove any. You can represent colors by using card suits. Red: hearts; Yellow: diamonds; Green: clubs; Blue: spades. The action field is used to denote the function of action cards 2. The game is played using the following deck of cards 0 1 2 3456 7 8900 0 12 345 6 7 8 90 01 2 3456 7 8900 2 34567 8 90 2 3 4567 890 2 3 4567 8 90 Figure 1: The deck of UNO cards. The following action cards are included: . Reverse If going clockwise, switch to counterclockwise or vice versa. . Skip - When a player places this card, the next player has to skip their turn. If turned up at the beginning, the first player loses his/her turn. . Draw Two - When a person places this card, the next player will have to pick up two cards and forfeit his/her turn by Dmitry Fomin https://conmons.wikimedia.org/a/index.php?eurid-29517498.Explanation / Answer
card_deck array[52]
enter x to shuffle the deck or y to use the preshuffled deck.
if x
make random arrangements of cards
else
start the game.
Hand_cards=52/total_player_count.
if(total_player_count>2 && total_player_count<10)
Press from 1-7 to play card from hand bundle or press zero to draw card from deck:5
if player cards( ????) are matching then proceed
if the value of card playedby player 1>value of card playedby player 2
play player 1
else
play player 2
the 9? cannot be placed on top of 5?
Press 1-7 to play any card from hand bundle or press zero to draw card from deck:1
Discard pile:6?,5?
reduce number of count of cards of both players by 1
Player's two hand: 3?.5?,2?,reverse,6?,2?,7?,..........
Playere's one hand: 9?
Player one has UNO
Press 1 to play any card from hand bundle or press zero to draw card from deck:1
Discard pile: 9?,4?,6?,wild,2?
Player 1 wins.
else
message "Invalid move".
Would you like to play again(y/n)? n
Exit.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.