Task: Write a C program to play a tiling game called Perrtominoes, a variation ofthe game Tetris. The game starts with an empty playing field (arectangt dar vertical shaft called the “well”). A pentomino, which is an arrangement of five connected squares chosen from a select set of possible pentominoes, appears at the top of the well. The pertomino falls straight down the well one square at a time. A pentomino cannot fall into a square already occupied by a previously fall en pentomino. When a pentomino can fall no further, anew pentomino appears at the top of the well and begins to fall. As pentominoesfall, a solid horizontal line without gaps may form. When such aline is formed, it disappears and any squares aboveit fall down one square to fill the newly emptied space.
The basic pentominoes are:
T.4 P 01+ M N
The possible pentominoes include the basic pentominoes, and their rotations in quarterturns. Essentially, each pentomino belongs to a family of between one and four distinct rotations. The N pentomino has one rotation, and the M pentomino hasfour. As an example, the following are the four rotations of the M pentomino:
The case-insensitive user input is given in the form of a text file. Each line represents a pentomino, number of quarter turn docicwise rotations to perform, and the column where the pentomino to appear at the top of the well. The three fields are separated by whitespace, and the lines can be of different lengths. Only when a pentomino can’t fall any further, and solid lines are dealt with, should the next pentomino appear at the top of the well. The program must accept the name of the input text file through a command-line argument. After all the pentominoes fall down the well. the program should print the entire content ofthe well to standard output. The well is a 12×10 rectangle. Each pentomino has a name, a letter of the alphabet. The number of rotations is a nonnegative integer. When a piece is at the top of the well, its leftmost square(s) must be on the column specified (an integer between. 0 and 9 inclusive), and the bottom block(s) of the piece must be at the top of the well (i.e., immediately above the well).
Deliverables A file nam ed pentominoes. c containing the ANSI C somre code. Before submitting your solutions via Canvas, zip the ANSI C source code and name the archive, if your name is Harry Houdini, for example, HW2_HarryHoudint
Grading Policy • Students who violate the University Policy on Academic Integrity will face disciplinary action. • This is an individual project; collaboration is not permitted. All work that you rep resort as your own must, in fact, be your own. • The submission will not receive a grade if the file pentominoes. c produces compilation warnings or errors. Therefore, before submitting your solution, make sure it compiles deanlyusingthe gcc compiler as follows
$ gcc – ansi -Wall -Wextra -Wpedantic -Werror pentaninoes .c