Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Help me write a Controller.cpp file. Below is the Controller.h file for the game Racko. I have also created cardDeck.h/cardDeck.cpp and main.cpp file. class Controller

Help me write a Controller.cpp file. Below is the Controller.h file for the game Racko. I have also created cardDeck.h/cardDeck.cpp and main.cpp file.

class Controller { public: void Menu(); //This will display the rules of the game void playGame(); (This will be the main loop until either the AI or the player wins ) void AITurn(); (Program a strategy that the AI will pick cards from discard pile when it benefits its rack. Otherwise, pick from the draw pile and the AI will determine if the draw pile card will be used. boolean check_racko(int Rack[],const int SIZE) //Given a rack, either the user's or the computer's, //determine if Racko has been achieved. Achieving Racko //means that the cards are in ascending order. private: int humanRack[10]; int AIRack[10]; bool playing; Deck gameDeck; };

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions