Write a group of three programs to play a game

Assignment Help Other Subject
Reference no: EM132377141

Assignment -

Purpose - In this assignment, you will write a group of three C99 programs to play a game. One of the programs will be called 2310hub it will control the game. The other two programs (2310alice and 2310bob will be players).

The hub will be responsible for running the player processes and communicating with them via pipes (created via pipe ()). These pipes will be connected to the players' standard ins and outs so from their point of view communication will be via stdin and stdout.

If some of the required programs compile and some do not, there will still be some marks allocated to each component working independently (see the marking section for more information).

Other than the hub starting player processes, there should not be any other parallelism used in this assignment. For example, no multi-threading nor non-blocking operations. Your programs are not permitted to start any additional processes nor are your programs permitted to create any files during their execution.

Your assignment submission must comply with the C style guide (version 2.0.4). It must also not use banned functions or commands listed in the same place.

Game -

What follows is an abstract description of the game. Precisely what your programs need to output will be described separately.

The game consists of:

Players (P of them): who are positioned in a circle. One player is labelled 0 and the remaining players are numbered in clockwise order.

A deck of cards (d of them) containing no duplicates. Each card in the deck has:

  • A suit from {S, C, D, H}
  • A rank (in hexadecimal) from 1 . . . 9, a . . . f.

A threshold (T)

At the start of the game, each player is given a "hand" of H = VA cards (ie rounded down). That is, the first H cards in the deck are given to Player 0, the next H cards are given to Player 1, etc. Each player tracks:

  • Their points (S)
  • The number of cards with the 'D' suit, played in rounds which they won (V).

D cards are worth -1 points at the end of the game unless the player won at least T of them. In which case, they are worth 1 point each.

1. The game is played in H rounds (one card per round).

2. The lead player for each round is:

  • Player 0 in the first round.
  • The player who won the previous round for all other rounds.

3. The lead player plays one of the cards from their hand. The suit of this card is the "lead suit".

4. The other players, in clockwise order from the lead player, play one card from their hands:

(a) If they have any cards belonging to the lead suit, then they must play one of those.

(b) Otherwise play any card

5. Find the highest ranked card of the lead suit. The player who played that card:

  • gets 1 point/ (ie increases S)
  • is the lead player for the next round.
  • records how many D cards were played that round. (ie increases that player's V value)

6. When all rounds are complete, each player's score is

  • S - V if V < T
  • S + V if V ≥ T

Deck file format -

The first line of the deck file will contain a single int indicating how many cards are in the deck. The remaining lines (each ended by '\n') contain two chars, the suit and the rank of the card.

Note - Want you to make this code for me on C language which can run on Linux. Want you to make the code from scratch which you have never made for any one so that no similarity can be found or don't give this code to anyone else.

Attachment:- Assignment File.rar

Reference no: EM132377141

Questions Cloud

Organisations to analyse their business environment : In today's competitive environment, it is important for organisations to analyse their business environment.
Describes post-traumatic stress in an interesting way : Describes post-traumatic stress in an interesting, accessible, and accurate way. You should talk about what PTSD is, what are some of its symptoms.
Discuss the data analysis procedure to be adopted : Discuss the data analysis procedure to be adopted. Discuss the possible ethical issues that need to be considered in this research.
Disadvantages of outsourcing of software development : Write a short report by critically evaluating the advantages and disadvantages of outsourcing of software development.
Write a group of three programs to play a game : In this assignment, you will write a group of three C99 programs to play a game. One of the programs will be called 2310hub it will control the game
Created in 1945 international monetary fund is organisation : Created in 1945 the International Monetary Fund (IMF) is an organisation composed of 188 countries, working to foster global monetary cooperation,
What are the competitive advantage for the organization : Choose 1 strength or opportunity, and create a marketing strategy that would promote a competitive advantage for this organization within the community.
What issues might arise with the given type of plan : Moon Corporation has established a bonus plan for its employees. An employee receives a bonus if his or her department meets the cost levels specified.
Fundamentally different applied business topics : You will present three fundamentally different applied business topics that align with your specialization and personal expertise.

Reviews

len2377141

9/26/2019 9:29:22 PM

I want help in this homework. The file is attached. I want you to make this code for me on C language which I can run on Linux. I want you to make the code from scratch which you have never made for any one so that no similarity can be found or don't give this code to anyone else. I have 10 days for this assignment, but I want you to make this within 1 week if possible so that I can start testing the code. The guidelines are attached in the document which is attached. There are some banned commands, please don't use them and please follow the style guide for writing the code. Please I request you to assure me that I will not get caught as my professor said they have online system to check the code called MOSS. Furthermore, I have provided you with all the information I have. I will update you further changes are made because our professor does this by making small changes / corrections.

Write a Review

Other Subject Questions & Answers

  Explain difference between abnormal versus normal qualities

Students will choose a mental health disorder (for example depression), from what we discussed in class. They will write a 3-5 page paper.

  Monozygotic twins raised in different households

A group of researchers wanted to find out whether trait X was primarily determined by genetics or environment. They examined the similarity in trait X between pairs of 1) monozygotic twins raised in the same households; 2) monozygotic twins raised..

  The various stonehenge structures issues

Can you use these confidence intervals to infer the likely construction order of the various Stonehenge structures? Explain.

  Explain the relevant law relating to the case

Presentation- Identify the facts of the case. Explain the relevant law relating to the case. Discuss the legal arguments raised by the parties in case

  What equal monthly investment

What equal monthly investment is required over a 40-year period to achieve a balance of $2,000,000 inan investment account that pays monthly interest of 3/4 percent?

  Discuss how three virtues apply to the mattel case

In a well-written 4- to 5-page paper, discuss how three virtues apply to the Mattel case. Before you begin to write up your Case, let's consider what is meant by "critical thinking."

  Compare and contrast the recommended roles

For which of your selected levels of government does your analysis indicate that the Critical Infrastructure Protection (CIP) guidance is better developed

  Analyze the potential collaborations

Analyze the potential collaborations that Steppingstone could have formed with Philadelphia's local and state government agencies and personnel.

  Senior citizen bank account in fsibl

Senior Citizen Bank account in FSIBL - A MARKETING PRESPECTIVE ANALYSIS

  Discuss role of trade regimes in national security strategy

Discuss the role of trade regimes in your National Security Strategy (NSS). How important will engagement and entanglement in international trade organizations.

  Discuss the use of cohort study designs

Cohort studies have proven particularly useful in the investigation of pediatric health and disease. Discuss, and provide specific examples for the use.

  Schools of thought-realism-liberalism-economic structuralism

Summarize the advantages and disadvantages of one of the following four schools of thought: Realism, Liberalism, Economic Structuralism or English School Rationalism. Include one of the following: Constructivist, Feminist, Postmodernist or Critical T..

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd