Untitled
unknown
plain_text
a year ago
493 B
9
Indexable
Tetromino::Tetromino() {
srand(time(0));
// Define shapes for the 7 types of Tetrominoes
const int defaultFigures[7][4] = {
{1, 1, 1, 1}, // I
{1, 1, 1, 0, 1}, // T
{1, 1, 0, 0, 1, 1}, // O
{1, 1, 0, 1, 1}, // L
{1, 1, 1, 0, 1, 1}, // J
{1, 1, 1, 0, 1, 1}, // S
{1, 1, 1, 0, 1, 1} // Z
};
std::copy(&defaultFigures[0][0], &defaultFigures[0][0] + 7*4, &figures[0][0]);
reset(1 + rand() % 7, rand() % 7, figures);
}Editor is loading...
Leave a Comment