A program in C language

Closed - This job posting has been filled and work has been completed.
Engineering & Architecture Product Design Posted 3 years ago

Fixed Price

Budget: $5
Delivery by May 6, 2013

Start Date

April 5, 2013


Final Project ECE175 Spring 2013
Due Date: April 23, 2013 11:59pm via D2L dropbox
The final project is to write a c program which simulates the card game called “War”. The rules are:
1. You are to play with a deck of 52 cards, ranking from low to high as follows: two, three, …ten, jack, queen, king and ace. There are 4 suits (H S D C) of each numbered and face cards, although for the game, suits are ignored. The deck needs to be shuffled, then deal 26 cards to each of two players (This is called a hand).
2. Each player places the top card face up on the table and the player with the higher card takes the two cards and places it in his discount pile (he wins the first round of the game). If the two cards are identical, each player places three cards face down on top of their first card, then one more card face up on top of their pile. Again, the highest card takes the entire two hands. This is called a war.
3. Each player when he or she runs out of cards, then uses the discount pile to form a new hand to play the game from. The cards are not reshuffled when going from the discount pile to a hand.
4. The first player to totally run out of cards loses the game. If you run out in the middle of a war, you still lose.
5. Shuffle the cards using the rand[] function.
6. Represent your hand as a linked list of cards  ​
typedef struct card_s {​​​Use a typedef struct to define the cards.
char suit;
int face;
struct card_s *listp;
} card;
7. At the beginning of each round, you must display the top card for each person, indicate whether there is a war on not, and display the total number of cards still in each person’s possession. Upon entering a return key, the game will play the next round. The program should announce the winner at the end of the game.
8. The display should look like the following:
​​*         *​​​*         *
​​*   8    *​​​*    J   *
​​*         *​​​*         *
No War​​20 cards​​32 cards
Next Round

Honor code: You are expected to submit your own code. You may ask others for advice, and in general
discuss the project, but you should WRITE YOUR OWN CODE. If any part of the code submitted by
different teams is identical, ALL involved parties will receive 0 credit on the project and one
letter reduction in their final grade. ALL submitted code will be checked with a plagiarism detection tool (e.g., http://theory.stanford.edu/~aiken/moss/). The project is to be worked in teams of two students each, and you should use modular programming, documentation, etc.

About the Client

(5.00) 3 reviews

United States
Tucson 08:30 AM

17 Jobs Posted
24% Hire Rate, 1 Open Job

$109 Total Spent
4 Hires, 1 Active

Member Since Mar 4, 2013