Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

need help in C Thanks The game starts with an eupty playing field (a rectangular vertical shaft called the well). A pentomino, which is an

need help in C

Thanks

image text in transcribed

The game starts with an eupty 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 previous y fallen pentomino. When a pentomino can fall no further, a new pentomino appears at the top of the well and begins to fall. As pentominoesfall, 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 bel ongs 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 rot ations 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 nam e of the input text file through a comm and-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 1210 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 leftm ost 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., im mediately above the well)

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

Recommended Textbook for

DB2 Universal Database V7.1 Application Development Certification Guide

Authors: Steve Sanyal, David Martineau, Kevin Gashyna, Michael Kyprianou

1st Edition

ISBN: 0130913677, 978-0130913678

More Books

Students also viewed these Databases questions