your input flovodoh

i need an input of this program.  anything good or bad.  what could be changed, what you may like or dislike about it.  only one paragraph.// newTetris.cpp : Defines the entry point for the console application.//#include “stdafx.h”#include #include #include #include #define GAME_INTERVAL 20#define DIR_DOWN 2#define DIR_LEFT 4#define DIR_RIGHT 6#define DIR_ROTATE 5using namespace std;class TetrisShape {public:char shapeArray[4][4];int shapeTopLeftX = 6;int shapeTopLeftY = 0;void populateShapeArray(int shape);void rotate();template void setShape(char(&shape)[rows][cols]);TetrisShape(int shape) { populateShapeArray(shape); };TetrisShape() {};};void TetrisShape::rotate() {char _shapeArray[4][4];_shapeArray[0][0] = shapeArray[0][3]; _shapeArray[1][0] = shapeArray[0][2]; _shapeArray[2][0] = shapeArray[0][1]; _shapeArray[3][0] = shapeArray[0][0];_shapeArray[0][1] = shapeArray[1][3]; _shapeArray[1][1] = shapeArray[1][2]; _shapeArray[2][1] = shapeArray[1][1]; _shapeArray[3][1] = shapeArray[1][0];_shapeArray[0][2] = shapeArray[2][3]; _shapeArray[1][2] = shapeArray[2][2]; _shapeArray[2][2] = shapeArray[2][1]; _shapeArray[3][2] = shapeArray[2][0];_shapeArray[0][3] = shapeArray[3][3]; _shapeArray[1][3] = shapeArray[3][2]; _shapeArray[2][3] = shapeArray[3][1]; _shapeArray[3][3] = shapeArray[3][0];for (int _x = 0; _x < 4; _x++) {for (int _y = 0; _y < 4; _y++) {shapeArray[_x][_y] = _shapeArray[_x][_y];}}}void TetrisShape::populateShapeArray(int shape) {switch (shape) {case 1:shapeArray[0][0] = ' '; shapeArray[1][0] = ' '; shapeArray[2][0] = ' '; shapeArray[3][0] = ' ';shapeArray[0][1] = ' '; shapeArray[1][1] = 'X'; shapeArray[2][1] = ' '; shapeArray[3][1] = ' ';shapeArray[0][2] = ' '; shapeArray[1][2] = 'X'; shapeArray[2][2] = ' '; shapeArray[3][2] = ' ';shapeArray[0][3] = ' '; shapeArray[1][3] = 'X'; shapeArray[2][3] = 'X'; shapeArray[3][3] = ' ';break;case 2:shapeArray[0][0] = ' '; shapeArray[1][0] = 'X'; shapeArray[2][0] = ' '; shapeArray[3][0] = ' ';shapeArray[0][1] = ' '; shapeArray[1][1] = 'X'; shapeArray[2][1] = ' '; shapeArray[3][1] = ' ';shapeArray[0][2] = ' '; shapeArray[1][2] = 'X'; shapeArray[2][2] = ' '; shapeArray[3][2] = ' ';shapeArray[0][3] = ' '; shapeArray[1][3] = 'X'; shapeArray[2][3] = ' '; shapeArray[3][3] = ' ';break;case 3:shapeArray[0][0] = ' '; shapeArray[1][0] = ' '; shapeArray[2][0] = ' '; shapeArray[3][0] = ' ';shapeArray[0][1] = ' '; shapeArray[1][1] = 'X'; shapeArray[2][1] = ' '; shapeArray[3][1] = ' ';shapeArray[0][2] = ' '; shapeArray[1][2] = 'X'; shapeArray[2][2] = 'X'; shapeArray[3][2] = ' ';shapeArray[0][3] = ' '; shapeArray[1][3] = ' '; shapeArray[2][3] = 'X'; shapeArray[3][3] = ' ';break;case 4:shapeArray[0][0] = ' '; shapeArray[1][0] = ' '; shapeArray[2][0] = ' '; shapeArray[3][0] = ' ';shapeArray[0][1] = ' '; shapeArray[1][1] = ' '; shapeArray[2][1] = 'X'; shapeArray[3][1] = ' ';shapeArray[0][2] = ' '; shapeArray[1][2] = 'X'; shapeArray[2][2] = 'X'; shapeArray[3][2] = ' ';shapeArray[0][3] = ' '; shapeArray[1][3] = 'X'; shapeArray[2][3] = ' '; shapeArray[3][3] = ' ';break;case 5:shapeArray[0][0] = ' '; shapeArray[1][0] = ' '; shapeArray[2][0] = ' '; shapeArray[3][0] = ' ';shapeArray[0][1] = ' '; shapeArray[1][1] = ' '; shapeArray[2][1] = 'X'; shapeArray[3][1] = ' ';shapeArray[0][2] = ' '; shapeArray[1][2] = ' '; shapeArray[2][2] = 'X'; shapeArray[3][2] = ' ';shapeArray[0][3] = ' '; shapeArray[1][3] = 'X'; shapeArray[2][3] = 'X'; shapeArray[3][3] = ' ';break;case 6:shapeArray[0][0] = ' '; shapeArray[1][0] = ' '; shapeArray[2][0] = ' '; shapeArray[3][0] = ' ';shapeArray[0][1] = ' '; shapeArray[1][1] = ' '; shapeArray[2][1] = ' '; shapeArray[3][1] = ' ';shapeArray[0][2] = ' '; shapeArray[1][2] = 'X'; shapeArray[2][2] = 'X'; shapeArray[3][2] = ' ';shapeArray[0][3] = ' '; shapeArray[1][3] = 'X'; shapeArray[2][3] = 'X'; shapeArray[3][3] = ' ';break;}}int score = 0;int currentShape = -1;               // this is going to represent the shape that is currently in play.bool isDropping = false;             // global that defines if a piece is currently falling - mainly for gameTick function.int currentTick = 0;template void generateBucket(char(&bucket)[rows][cols]);       // Creates a slightly pre-filled bucket.void generateShapeStream();  // Generate a stream of shapes.void dropShape();       // Draw the shape top/center.bool moveShape(int direction);       // Move the shape in the spec. dir.template bool gameTick(char(&bucket)[rows][cols], char(&perm_bucket)[rows][cols]);                   // Handles what is going on in the game every second.template void landShape(char(&bucket)[rows][cols]);                    // What to do when the shape hits the bottom.template int checkScore(char(&bucket)[rows][cols], char(&perm_bucket)[rows][cols], int tempvar, int score);template void drawBucket(char(&bucket)[rows][cols]);                    // Draws the current contents of the bucket.template bool canEnter(int direction, char(&bucket)[rows][cols]);          // Checks if the shape can enter the space it is trying to drop into.int getUserInput();                 // gets the key pressed from the user.void setCursorTo(int x, int y);// Move the cursor to the appropriate positionint previousX = 6, previousY = 0;int shapes[256];template int check_bucket(char(&bucket)[rows][cols]);template void set_bucket(char(&bucket)[rows][cols], char(&perm_bucket)[rows][cols]);TetrisShape activeShape;int main() {// Two bucket arrays, one shown on the screen, the other with the permanent contents of the buckets (walls and any non-moving shapes)char bucket[12][25];int score = 0;int tempvar = 0;char _bucket[12][25];int shapes[256] = {};int shapeIndex = 0;bool gameOver = false;generateBucket(bucket);generateBucket(_bucket);generateShapeStream();drawBucket(bucket);while (!gameOver) {gameOver = gameTick(bucket, _bucket);Sleep(50);checkScore(bucket, _bucket, tempvar, score);cout << "Your Score is: " << score << endl;currentTick++;}setCursorTo(25, 6);cout << "GAME OVER";system("pause");}void setCursorTo(int x, int y){HANDLE handle;COORD position;handle = GetStdHandle(STD_OUTPUT_HANDLE);position.X = x;position.Y = y;SetConsoleCursorPosition(handle, position);}/* generateBucket - takes a bucket array of any size and*                  creates a semi-empty bucket, with a*                  few random shapes in the bottom few lines. */template void generateBucket(char(&bucket)[rows][cols]) {for (int w = 0; w < 12; w++) {for (int z = 0; z < 25; z++) {if (((w == 0) || (w == 11)) && (z == 0)) { bucket[w][z] = '.'; }else if (((w % 12 == 0) || (w % 12 == 11)) && ((z > 0) && (z < 24))) { bucket[w][z] = '|'; }else if (((w == 0) || (w == 11)) && (z == 24)) { bucket[w][z] = '+'; }else if (z == 24) { bucket[w][z] = '-'; }else { bucket[w][z] = ' '; }}}}/* generateShapeStream - generates a pre-determined list of*                       shapes that will fall from the sky. */void generateShapeStream() {// Initialize the random number generatorsrand(time(NULL));for (int i = 0; i < 256; i++) {shapes[i] = rand() % 6 + 1;}//cout << "In generate shape..." << endl;}/* drawBucket - draws the actual bucket on the screen*              including the currently dropping shape. */template void drawBucket(char(&bucket)[rows][cols]) {setCursorTo(0, 0);for (int w = 0; w < 25; w++) {for (int z = 0; z < 12; z++) {cout << bucket[z][w];}cout << endl;}}/* gameTick - this function does all of the different*  processessing that happens throughout*  the game.This also returns false to*  stop the main loop once gameover has*  been reached*/template bool gameTick(char(&bucket)[rows][cols], char(&perm_bucket)[rows][cols]) {drawBucket(bucket);if (!isDropping) {currentShape++;activeShape = TetrisShape(shapes[currentShape]);if (!canEnter(DIR_DOWN, perm_bucket)) {return true;}else {isDropping = true;updateBucket(bucket, false);}}else {if (currentTick % GAME_INTERVAL == 1) {// we are on a drop interval.if (canEnter(DIR_DOWN, perm_bucket)) {updateBucket(bucket, moveShape(DIR_DOWN));}else {landShape(perm_bucket);}}}int direction = getUserInput();if (canEnter(direction, perm_bucket)) {updateBucket(bucket, moveShape(direction));}if (!canEnter(DIR_DOWN, perm_bucket)) {landShape(perm_bucket);set_bucket(bucket, perm_bucket);}return false;}/* moveShape – Handles moving the shape in the bucket. */bool moveShape(int direction) {previousX = activeShape.shapeTopLeftX;previousY = activeShape.shapeTopLeftY;switch (direction) {case DIR_DOWN:activeShape.shapeTopLeftY++;return false;break;case DIR_RIGHT:activeShape.shapeTopLeftX++;return false;break;case DIR_LEFT:activeShape.shapeTopLeftX–;return false;break;case DIR_ROTATE:activeShape.rotate();return true;break;}}/* updateBucket – place the cureret shape in the bucket, remove the old shape*/template void updateBucket(char(&bucket)[rows][cols], bool isRotation) {for (int _x = 0; _x < 4; _x++) {for (int _y = 0; _y < 4; _y++) {if (!isRotation) {if ((activeShape.shapeArray[_x][_y] != ' ') && (bucket[_x + previousX][_y + previousY] != '|') && (bucket[_x + previousX][_y + previousY] != '-')) {bucket[_x + previousX][_y + previousY] = ' ';}}else {if ((bucket[_x + previousX][_y + previousY] != '|') && (bucket[_x + previousX][_y + previousY] != '-')) {bucket[_x + previousX][_y + previousY] = ' ';}}}}for (int _x = 0; _x < 4; _x++) {for (int _y = 0; _y < 4; _y++) {if (activeShape.shapeArray[_x][_y] != ' ') {bucket[_x + activeShape.shapeTopLeftX][_y + activeShape.shapeTopLeftY] = activeShape.shapeArray[_x][_y];}}}}/* landShape - Sets the shape in place once it hits thebottom of the bucket. Moves the shape to the permanent bucket (_bucket)*/template void landShape(char(&bucket)[rows][cols]) {updateBucket(bucket, false);previousX = 6; previousY = 0;check_bucket(bucket);isDropping = false;}templateint checkScore(char(&bucket)[rows][cols], char(&perm_bucket)[rows][cols], int tempvar, int score){for (int y = 0; y < 25; y++) {int tmp_count = 0;for (int x = 0; x < 13; x++) {if (bucket[x][y] == 'X') {tmp_count++;}}if (tmp_count == 10) {tempvar = 1;if (tempvar == 1) {score = score + 100;return score;}}}}/* getUserInput - Reads the user input from the player*/int getUserInput() {setCursorTo(35, 9);if ((GetKeyState(VK_DOWN) != 0) && (GetKeyState(VK_DOWN) != 1)) { return DIR_DOWN; }if ((GetKeyState(VK_RIGHT) != 0) && (GetKeyState(VK_RIGHT) != 1)) { return DIR_RIGHT; }if ((GetKeyState(VK_LEFT) != 0) && (GetKeyState(VK_LEFT) != 1)) { return DIR_LEFT; }if ((GetKeyState(VK_UP) != 0) && (GetKeyState(VK_UP) != 1)) { return DIR_ROTATE; }return 0;}/* canRotate - if we are adjacent to another shape, then we CANNOT rotate */template bool canRotate(char(&bucket)[rows][cols]) {// The only real way to do this is to create a copy of the shape, rotate it, then try to determine where it will be in the bucket.TetrisShape _tmp = TetrisShape(activeShape);_tmp.rotate();for (int _x = 0; _x < 4; _x++) {for (int _y = 0; _y < 4; _y++) {if (_tmp.shapeArray[_x][_y] != ' ') {if (bucket[_tmp.shapeTopLeftX + _x][_tmp.shapeTopLeftY + _y] != ' ') {return false;}}}}return true;}/* canEnter - Tests to see if the falling blocks canenter in any direction.*/template bool canEnter(int dir, char(&bucket)[rows][cols]) {// Check for collision with any elements of the shape array, and any elements of the bucket.// Determine which direction we are moving.int delta_x = 0, delta_y = 0;switch (dir) {case DIR_DOWN:delta_y++;break;case DIR_LEFT:delta_x–;break;case DIR_RIGHT:delta_x++;break;case DIR_ROTATE:return canRotate(bucket);break;}// Create the starting {x, y} position to test for collsionint test_x = activeShape.shapeTopLeftX + delta_x;int test_y = activeShape.shapeTopLeftY + delta_y;for (int _x = 0; _x < 4; _x++) {for (int _y = 0; _y < 4; _y++) {if (activeShape.shapeArray[_x][_y] != ' ') {if (bucket[test_x + _x][test_y + _y] != ' ') {return false;}}}}return true;}template int checkScore(char(&bucket)[rows][cols], int tempvar, int score) {for (int y = 0; y < 25; y++) {int tmp_count = 0;for (int x = 0; x < 13; x++) {if (bucket[x][y] == 'X') {tmp_count++;}}if (tmp_count == 10) {tempvar = 1;if (tempvar == 1) {score = score + 100;return score;}for (int x = 1; x < 11; x++) {for (int _y = y; _y > 0; _y–) {bucket[x][_y] = bucket[x][_y – 1];}}}}}template void check_bucket(char(&bucket)[rows][cols]) {for (int y = 0; y < 25; y++) {int tmp_count = 0;for (int x = 0; x < 13; x++) {if (bucket[x][y] == 'X') {tmp_count++;}}if (tmp_count == 10) {for (int x = 1; x < 11; x++) {for (int _y = y; _y > 0; _y–) {bucket[x][_y] = bucket[x][_y – 1];}}}}}template void set_bucket(char(&bucket)[rows][cols], char(&perm_bucket)[rows][cols]) {for (int x = 0; x < 12; x++) {for (int y = 0; y < 25; y++) {bucket[x][y] = perm_bucket[x][y];}}}

Save Time On Research and Writing
Hire a Pro to Write You a 100% Plagiarism-Free Paper.
Get My Paper
Calculate the price
Make an order in advance and get the best price
Pages (550 words)
$0.00
*Price with a welcome 15% discount applied.
Pro tip: If you want to save more money and pay the lowest price, you need to set a more extended deadline.
We know how difficult it is to be a student these days. That's why our prices are one of the most affordable on the market, and there are no hidden fees.

Instead, we offer bonuses, discounts, and free services to make your experience outstanding.
How it works
Receive a 100% original paper that will pass Turnitin from a top essay writing service
step 1
Upload your instructions
Fill out the order form and provide paper details. You can even attach screenshots or add additional instructions later. If something is not clear or missing, the writer will contact you for clarification.
Pro service tips
How to get the most out of your experience with Homework Mules
One writer throughout the entire course
If you like the writer, you can hire them again. Just copy & paste their ID on the order form ("Preferred Writer's ID" field). This way, your vocabulary will be uniform, and the writer will be aware of your needs.
The same paper from different writers
You can order essay or any other work from two different writers to choose the best one or give another version to a friend. This can be done through the add-on "Same paper from another writer."
Copy of sources used by the writer
Our college essay writers work with ScienceDirect and other databases. They can send you articles or materials used in PDF or through screenshots. Just tick the "Copy of sources" field on the order form.
Testimonials
See why 20k+ students have chosen us as their sole writing assistance provider
Check out the latest reviews and opinions submitted by real customers worldwide and make an informed decision.
Psychology
I requested a revision and it was returned in less than 24 hours. Great job!
Customer 452467, November 15th, 2020
Education
Thank you so much, Reaserch writer. you are so helpfull. I appreciate all the hard works. See you.
Customer 452701, February 12th, 2023
Psychology
Thank you. I will forward critique once I receive it.
Customer 452467, July 25th, 2020
Business Studies
Great paper thanks!
Customer 452543, January 23rd, 2023
Political science
Thank you!
Customer 452701, February 12th, 2023
Finance
Thank you very much!! I should definitely pass my class now. I appreciate you!!
Customer 452591, June 18th, 2022
Political science
I like the way it is organized, summarizes the main point, and compare the two articles. Thank you!
Customer 452701, February 12th, 2023
Accounting
Thank you for your help. I made a few minor adjustments to the paper but overall it was good.
Customer 452591, November 11th, 2021
Technology
Thank you for your work
Customer 452551, October 22nd, 2021
11,595
Customer reviews in total
96%
Current satisfaction rate
3 pages
Average paper length
37%
Customers referred by a friend
OUR GIFT TO YOU
15% OFF your first order
Use a coupon FIRST15 and enjoy expert help with any task at the most affordable price.
Claim my 15% OFF Order in Chat
Show more
<
Live Chat 1 7633094299EmailWhatsApp

Order your essay today and save 15% with the discount code WELCOME