Question: I need Some help writing a program in C++ Here are the instructions: Create a domino game and table that has the following features 1.

I need Some help writing a program in C++ Here are the instructions: Create a domino game and table that has the following features 1. Create a Class CRandom to sort dominos that are shown/picked that makes sure pieces arent used twice. 2. Create a Class Ctable to show/display the sorted pieces using class deque as a double ended dynamically sized sequence container. 3. Create a class CDominoes to contain the data structure with pieces 4. Have a class CPlayer to select a randomly picked piece and sequential show the selected pieces 5. For attributes and variables for each piece use a struct named structdata{}..piece as dynamic allocated vector, as to properly allocate and free memory. 6. properly initialize and clean up each class implemented. 7. Make proper initialization and clean up of each class and structure you implemented, accordingly using as needed constructor, destructor, new and delete. 8. Generate a initialization of the pieces as positioned by a random uniform distribution. This initial positioning of the pieces are for the pieces available to be taken by the players as: available pieces. 9. Have two players on table. 10. From the 28 pieces, randomly give 10 pieces for each player. 11. The remaining 8 pieces stay available to be taken if the player doesn't have any piece that will match with the current head and tail of the game already placed on table thus, the player takes a piece from the so called available pieces. 12. Check if from the pieces in the current player's hand, if current player can select a piece that will match the tail or the head of the matching game. If not, then this player should take a piece from the available pieces. Then, check again if now this player can match this newly taken piece to the head or tail of the dominoes match; if not, the player goes and take another piece from available pieces. Repeat it until the player can match some of new piece into the dominoes tail or head. In case the player has no longer any left piece to take from available pieces, then the time to play turns to the other player. 13. The side of the piece placed on the head or tail of the dominoes match is marked as no longer available value to matching a next piece to be added on the matching table; at the same time the other value available in this piece become visible as the new head or tail from the dominoes match, that just become available as the new value to be matched to the next piece to be played, as the head or tail accordingly. 14. The first person to play is defined by a random uniform distribution. 15. The winner is who places all his pieces on the table, matching the head and the tail on the game with his pieces after playing each of his turns, and is left with no additional pieces in his hand. 16. Display in ASCII format on console each move from each player. Display in ASCII format on console the final result: who won, how many pieces was left with the second placed player and which are these pieces; the dominoes matching pieces as they were matching and placed on table.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!