this a C program instructions: output: Connect Four Redux Connect Four is a two-player board game that's
Fantastic news! We've Found the answer you've been seeking!
Question:
instructions:
output:
Transcribed Image Text:
Connect Four Redux Connect Four is a two-player board game that's fun to play. It's also fun to watch a replay of a game that you just won. Requirements A program is needed to allow two people to play Connect Four on a computer, the same way we did for assignment 4. The difference is that now when the user is prompted to enter 'q' to quit they will also be given the option to enter 'r' for 'replay', or 'rerun' or 'redux'. A replay will show the empty board and then show the moves as they occurred, at a rate that makes it possible to appreciate the win. The user should then be prompted again for a 'q' or an 'r' or anything else. An example run is shown at the end of this document. Design A linked list should be used to record the moves that the players make. A singly linked list can be used and the code should be in a separate file called slist.c and slist.h. A function to insert a new node at the tail will be needed. A function to free the list is also needed. The details of what is stored in each node is up to you. Implementation The program will be written in C. Try to write your program incrementally by first creating the overall structure with empty functions (stubs) and testing often to see that your program is always working as expected. Testing When testing, you are checking to see that the program satisfies the requirements. Remember that when moving through the stages of requirements, design, implementation and testing, it is often necessary to go back to a previous stage and revisit decisions and make changes. It is always better to make design changes early in a project rather than later. Connect Four Redux Connect Four is a two-player board game that's fun to play. It's also fun to watch a replay of a game that you just won. Requirements A program is needed to allow two people to play Connect Four on a computer, the same way we did for assignment 4. The difference is that now when the user is prompted to enter 'q' to quit they will also be given the option to enter 'r' for 'replay', or 'rerun' or 'redux'. A replay will show the empty board and then show the moves as they occurred, at a rate that makes it possible to appreciate the win. The user should then be prompted again for a 'q' or an 'r' or anything else. An example run is shown at the end of this document. Design A linked list should be used to record the moves that the players make. A singly linked list can be used and the code should be in a separate file called slist.c and slist.h. A function to insert a new node at the tail will be needed. A function to free the list is also needed. The details of what is stored in each node is up to you. Implementation The program will be written in C. Try to write your program incrementally by first creating the overall structure with empty functions (stubs) and testing often to see that your program is always working as expected. Testing When testing, you are checking to see that the program satisfies the requirements. Remember that when moving through the stages of requirements, design, implementation and testing, it is often necessary to go back to a previous stage and revisit decisions and make changes. It is always better to make design changes early in a project rather than later.
Expert Answer:
Answer rating: 100% (QA)
To create a program for Connect Four Redux which includes the ability to play the game replay the game and record moves using a linked list you can follow these steps Define the Data Structures Create ... View the full answer
Related Book For
Posted Date:
Students also viewed these programming questions
-
Let A, B be sets. Define: (a) the Cartesian product (A B) (b) the set of relations R between A and B (c) the identity relation A on the set A [3 marks] Suppose S, T are relations between A and B, and...
-
CANMNMM January of this year. (a) Each item will be held in a record. Describe all the data structures that must refer to these records to implement the required functionality. Describe all the...
-
10 You are looking at an investment that will pay $1200 in 5 years if you invest $1000 today. What is the implied rate of interest? A. What Formula would you use to find the answer? Show the formula...
-
Describe how a business element is reflected in the requirements to deduct moving expenses and how Congress limited this deduction to substantial moves.
-
1. Offender is at least 18. 2. Offender is white. 3. Offender is male. 4. Victim is a white female. 5. Victim is either white or female. 6. Victim and offender are from the same age category. 7....
-
When the heat capacity ratio is 1.67 , then the ideal gas is (a) Diatomic (b) Monatomic (c) Triatomic (d) None of these.
-
The Crafts home was supplied with gas by the city gas company. Because of some misunderstanding, the gas company believed that the Crafts were delinquent in paying their gas bill. The gas company had...
-
Quarry Ltd. is a mining company with several locations throughout Europe. Since its inception, they have always abided by the regulations of the various countries. With the introduction of...
-
A tank is shaped like an inverted cone. Its height is 6 m and the diameter of its upper face is 8 m. It empties its water through a tap located at its lower end (the tip of the cone). Determine at...
-
What is the momentum (as a function of time) of a 3 kg particle moving with a velocity = = (1.6i+4.9j) m/s. What is the net force acting on this particle, if it comes to a complete stop in 0.46 s?
-
Assignment 3 Case Study Marketing Management You have been contacted by a European Company with an offer for a joint venture. The company is in to Cotton Garments manufacturing. They have full...
-
What is the magnitude of the electric field at a location 62.7 mm inside a thick rod of radius 6.1 cm, length 1.2 m, and charge 178.4 nC distributed uniformly throughout its volume? (please provide...
-
Using the accounts below for Harsco, Inc. for December 31, 2022, classified balance sheet, in good form, using the template provided on the following ($ millions) Contributed capital $1,636 Cost of...
-
Goods H, I, and J are related goods, each operating in a perfectly competitive market. As the price of Good H increases from $4 to $5, its quantity demanded falls from 100 units to 60 units....
-
a disadvantage of selective attention is that it can be tasked to critically analyze how prior learning causes our brain to automatically react to our environments and brings things to mind, which...
-
Differentiate. y = ln(3x + 1) ln(5x + 1)
-
Cogesco purchased 75% of the capital of Securenet for $250,000 on January 1, 2008. At this date the equity of Securenet was: Share capital......... $100,000 Retained earnings...... 100,000 At this...
-
On December 31, 2010, Peat Limited purchased 70% of the outstanding common shares of Soap Limited for $7 million. On that date, Soaps shareholders equity consisted of common shares of $5 million and...
-
On January 1, 2013, Serpens Ltd. acquired the issued shares (cum div.) of Vela Ltd. for $120,000. At that date, the nancial statements of Vela included the following items: Share capital...
-
Following is a residual plot produced by MINITAB. Was it appropriate to compute the least-squares regression line? Explain. Residual -2 -3 1 2 3 5.0 5.5 09 6.0 Residuals Versus x 6.5 X 7.0 7.5 8.0
-
Following is a residual plot produced by MINITAB. Was it appropriate to compute the least-squares regression line? Explain. 50 50 Residuals Versus x 40 40 30 20 20 Residual 10 10 0 -10 -20 20 + -3 -2...
-
The following table presents the ages of the last 10 U.S. presidents and their wives on the first day of their presidencies. a. Compute the least-squares regression line for predicting the presidents...
Study smarter with the SolutionInn App