(Solved) : Task Write C Program Play Tiling Game Called Pentis Variation Game Tetris Game Starts Cons Q39919118 . . .

Task: Write a C program to play a tiling game called Pentis, a variation of the game Tetris. When the game starts, construct

Sample Session: Input File and Output Command Line $ pentis sample.txt Contents of the Sample Input File N ROO H R1 6 D R25 D

Write a program in C language

Task: Write a C program to play a tiling game called Pentis, a variation of the game Tetris. When the game starts, construct a data structure representing an empty playing field (a rectangular vertical shaft, called the “well”). A Pentis piece, chosen by the player from a select set of possible Pentis pieces should appear at the top of the well. This piece should fall by moving down the well, one square at a time. A picce cannot fall into a square already occupied by a previously fallen picce. When a picce can fall no further, it should stop moving; a new piece should then appear at the top of the board and begin to fall. As pieces fall, a solid horizontal line without gaps may form. When such a line is formed, it disappears and any blocks above it fall down one line to fill the newly emptied space. A Pentis piece is an arrangement of five connected squares. The basic Pentis pieces are: The possible Pentis pieces include the basic Pentis pieces, and their rotations in quarter turns. Essentially, each Pentis piece belongs to a family of between one and four distinct rotations. The N Piece has one rotation, and the M piece has four. As an example, the following are the four rotations of the M piece: The user input is given in the form of a text file. Each line represents a Pentis piece, number of quarter- turn clockwise rotations to perform, and the column where the piece to appear at the top of the well. Only when a piece can’t fall any further, and solid lines are dealt with, should the next piece 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 Pentis pieces fall down the well, the program should print the entire content of the well to standard output The well is an 12×10 rectangle. Each Pentis piece has a name, a letter of the alphabet. The number of rotations is an integer between 0 and 3 inclusive. When a piece is at the top of the well, its leftmost block(s) must be on the column specified (an integer between 0 and 9 inclusive), and the bottom blocks) of the piece must be at the top of the well (i.e, immediately above the well). Sample Session: Input File and Output Command Line $ pentis sample.txt Contents of the Sample Input File N ROO H R1 6 D R25 DRO 8 Expected Output ! # # # ! ### ## ! # # ###! ! ======== Show transcribed image text Task: Write a C program to play a tiling game called Pentis, a variation of the game Tetris. When the game starts, construct a data structure representing an empty playing field (a rectangular vertical shaft, called the “well”). A Pentis piece, chosen by the player from a select set of possible Pentis pieces should appear at the top of the well. This piece should fall by moving down the well, one square at a time. A picce cannot fall into a square already occupied by a previously fallen picce. When a picce can fall no further, it should stop moving; a new piece should then appear at the top of the board and begin to fall. As pieces fall, a solid horizontal line without gaps may form. When such a line is formed, it disappears and any blocks above it fall down one line to fill the newly emptied space. A Pentis piece is an arrangement of five connected squares. The basic Pentis pieces are: The possible Pentis pieces include the basic Pentis pieces, and their rotations in quarter turns. Essentially, each Pentis piece belongs to a family of between one and four distinct rotations. The N Piece has one rotation, and the M piece has four. As an example, the following are the four rotations of the M piece: The user input is given in the form of a text file. Each line represents a Pentis piece, number of quarter- turn clockwise rotations to perform, and the column where the piece to appear at the top of the well. Only when a piece can’t fall any further, and solid lines are dealt with, should the next piece 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 Pentis pieces fall down the well, the program should print the entire content of the well to standard output The well is an 12×10 rectangle. Each Pentis piece has a name, a letter of the alphabet. The number of rotations is an integer between 0 and 3 inclusive. When a piece is at the top of the well, its leftmost block(s) must be on the column specified (an integer between 0 and 9 inclusive), and the bottom blocks) of the piece must be at the top of the well (i.e, immediately above the well).
Sample Session: Input File and Output Command Line $ pentis sample.txt Contents of the Sample Input File N ROO H R1 6 D R25 DRO 8 Expected Output ! # # # ! ### ## ! # # ###! ! ========

Expert Answer

Leave a Comment

About

We are the best freelance writing portal. Looking for online writing, editing or proofreading jobs? We have plenty of writing assignments to handle.

Quick Links

Browse Solutions

Place Order

About Us