I have been a programming student for about a year now and I have been tasked with creating a Tetris game. I am trying to display the bucket that is used for the game, it must be 25 x 12. I tried thinking and researching a way to do this using nested loops but to no avail. Everything looks fine except I get an error C2078: too many initializers. Could someone please take a look at the code and find something that I am just not seeing or maybe find a more efficient way to draw the bucket? Any help would be appreciated, thank you.
#include "stdafx.h"
#include <iostream>
#include <Windows.h>
using namespace std;
const int width = 12;
const int height = 25;
char bucket [width][height] ={"x"," "," "," "," "," "," "," "," "," "," ","x",
"x"," "," "," "," "," "," "," "," "," "," ","x",
"x"," "," "," "," "," "," "," "," "," "," ","x",
"x"," "," "," "," "," "," "," "," "," "," ","x",
"x"," "," "," "," "," "," "," "," "," "," ","x",
"x"," "," "," "," "," "," "," "," "," "," ","x",
"x"," "," "," "," "," "," "," "," "," "," ","x",
"x"," "," "," "," "," "," "," "," "," "," ","x",
"x"," "," "," "," "," "," "," "," "," "," ","x",
"x"," "," "," "," "," "," "," "," "," "," ","x",
"x"," "," "," "," "," "," "," "," "," "," ","x",
"x"," "," "," "," "," "," "," "," "," "," ","x",
"x"," "," "," "," "," "," "," "," "," "," ","x",
"x"," "," "," "," "," "," "," "," "," "," ","x",
"x"," "," "," "," "," "," "," "," "," "," ","x",
"x"," "," "," "," "," "," "," "," "," "," ","x",
"x"," "," "," "," "," "," "," "," "," "," ","x",
"x"," "," "," "," "," "," "," "," "," "," ","x",
"x"," "," "," "," "," "," "," "," "," "," ","x",
"x"," "," "," "," "," "," "," "," "," "," ","x",
"x"," "," "," "," "," "," "," "," "," "," ","x",
"x"," "," "," "," "," "," "," "," "," "," ","x",
"x"," "," "," "," "," "," "," "," "," "," ","x",
"x"," "," "," "," "," "," "," "," "," "," ","x",
"x"," "," "," "," "," "," "," "," "," "," ","x",
"x","x","x","x","x","x","x","x","x","x","x","x",
};
void setCursorTo(int x, int y){
HANDLE handle;
COORD position;
handle = GetStdHandle(STD_OUTPUT_HANDLE);
position.X = x;
position.Y = y;
SetConsoleCursorPosition(handle, position);
}
int _tmain(int argc, _TCHAR* argv[])
{
setCursorTo(0,0);
cout<<bucket<<endl;
return 0;
}enter code here