Question: PROGRAM DESCRIPTION:The purpose of this programming project is to write a C++ program to play a simplified version of The aMAZEing Labyrinth. This is a

PROGRAM DESCRIPTION:The purpose of this programming project is to write a C++ program to play a simplified version of The aMAZEing Labyrinth. This is a competitive tile shifting game, in which two players take turns sliding tiles into perpendicular lanes on the board. In our case one of the players is the computer plays random moves. The tiles have vertical lines, horizontal lines, or crosses on them. The goal is for one player to create a continuous path in one of the lanes using the lines in the tiles from their side of the board to the opposite side. The first player to do so wins.REQUIREMENTS:You must organize your program into three files: oeuidHW4func.h This file will contain the include directives for the necessary libraries, any enumerated data types, any type definitions, any structure definitions, and the list of function prototypes (i.e. function declarations) oeuidHW4main.cpp This file will contain the local include directive for the header file as well as the main function for the program euidHW4func.cpp This file will contain the local include directive for the header file as well as all function definitions (except the main) used in the programo Be sure to replace euidwith your EUIDAs with all homework programs in this course, your programs output will initially display the department and course number, your name, your EUID, and your email address.Define an enumerated type to store the different tile types that can be on the board:o+ CROSSo-HORIZONTALo|VERTICALoXLOCKEDoEMPTYDefine an enumerated type that represents two colors, RED and BLUE. This will keep track of each players game pieces.Define a structure (i.e. struct) to represent a tile that contains the tilesenumeratedtype, itsenumeratedcolor, and an integer value representing which lane it is in.Inside the main(),you will need to declare a two-dimensional, dynamic array representing the 7-by-7 board the tiles will be placed inTo initialize the board, you will need to define a function that takes in the two-dimensional board and its size. Remember that the size should not be a global constant, so you will need to use pointers for the array. oThe function will need to prompt the user for the name of the file containing the initial state of the board. This file will bea text filein comma separated value (CSV) format with each line representing one row on the board. If an incorrect file name is entered, the program should reprompt the user for a correct file name until one is received.o Using the information in the file, the board should be populated with tiles matching those described in the file.Keep in mind that an X is a LOCKED tile and cannot be moved during the game, and a is an EMPTY slot that does not currently contain a tile. oExamples of these input files can be found on the CSE machines at /home/jeh0289/public/csce1030/fa18/project4You can cddirectly into this directory and cpthe files into your home directory for easy access.You will then need to printout the game instructionsusing a function you have defined. See the SAMPLE OUTPUT for an example of the instructions.Next you should begin the gameoAt the beginning of each turn you should print out the state of the board using a function you have defined that takes in the two-dimensional board and its size. The players tiles should be colored red, the computers tiles should be colored blue, and theLOCKED tiles should be the default color. See printColor.cppfor an exampleon how to color your text.oYou will then need to prompt the user for which of the lanes 1-7 they would like to push a tile into and what type of tile they would like to push (-,|,or+). If the user inputs a lane that does not exist or a symbol that is not a possible tile type, politely inform them of the mistake and reprompt. You should also give them the option of surrendering by entering -1, a sentinel value,when asked for the lane number.If a user surrenders then output a polite message and end the game.oUsing the users specifications, you should create a new tileand then attempt to slide the tile into the board using a function you have defined. This function should take in the board, its size, and the new tile. To slide a tile for the player, you should slide it vertically from the bottom of the board in the appropriate lane. If a tile already exists in that spot, it and all other movable tiles above it that are touching should be moved up. A tile that slides out of the boards boundaries is removed from the board. Note that a tile cannot be slid into a LOCKED tile. If a player attempts to slide a tile into a lane that would result in a LOCKED tile being moved, you should ignored the move, politely report the mistake the player, and forfeit their current turn.oUsing a function you define,you should create a tile for which the computer should choose a random lane and tile type. Thistileshould be slid in horizontally from theleft side of the boardusing your previously defined tile sliding function. If the computer attempts to slide a tile into a lane that would result in a LOCKED tile being moved, you should ignored the move, politely report the computers mistaketothe player, and forfeit the computers current turn.oThe game should continue until either the player or computer has created acontinuous path in one of the lanes using the lines in the tiles from their side of the board to the opposite side. You should check for this using a function that takes in the board and its size, and return a Boolean. The final state of the board should be displayed along with congratulatory message if the user won, or a consoling message about their defeat. Once the game is complete, you will need to return the memory allocated for the board back to the freestore.

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!