Task: Write a C program to play a tiling game called Pentominoes, a variation of the game Tetris.
The game starts with an empty playing field (a rectangular 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 pentomino falls straight down the well
one square at a time. A pentomino cannot fall into a square already occupied by a previously
fallen pentomino. When a pentomino can fall no further, a new pentomino appears at the top of
the well and begins to fall. As pentominoes fall, a solid horizontal line without gaps may form.
When such a line is formed, it disappears and any squares above it fall down one square to fill
the newly emptied space.
The Basic pentominoes are:
The possible pentominoes include the basic pentominoes, and their rotations in quarter turns.
Essentially, each pentomino belongs to a family of between one and four distinct rotations. The
N pentomino has one rotation, and the
M pentomino has four. 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 clockwise 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 of the
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 named pentominoes.c containing the ANSI C source code. Before submitting your
solutions via Canvas, zip the ANSI source code and name the archive, if your name is Harry
Houdini, for example, HW2_HarryHoundini.zip.
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 cleanly using the gcc
compiler as follows:
$ gcc -ansi -Wall -Wextra -Wpedantic -Werror pentominoes.c