```c
#include <stdio.h>
#include <stdlib.h>
#include <conio.h>
#include <time.h>
#define ROWS 20
#define COLS 10
int board[ROWS][COLS] = {0};
int current[4][2] = {0};
int current_type = 0;
int current_row = 0;
int current_col = 0;
int score = 0;
int types[7][4][2] = {
{{0, 0}, {0, 1}, {1, 0}, {1, 1}},
{{0, 0}, {0, 1}, {0, 2}, {0, 3}},
{{0, 0}, {0, 1}, {0, 2}, {1, 2}},
{{0, 0}, {0, 1}, {0, 2}, {-1, 2}},
{{0, 0}, {0, 1}, {1, 1}, {1, 2}},
{{0, 0}, {0, 1}, {-1, 1}, {-1, 2}},
{{0, 0}, {0, 1}, {0, 2}, {1, 1}}
};
void draw_block(int row, int col, int type) {
for (int i = 0; i < 4; i++) {
int r = row + types[type][i][0];
int c = col + types[type][i][1];
if (r >= 0 && r < ROWS && c >= 0 && c < COLS) {
board[r][c] = 1;
}
}
}
void remove_block(int row, int col, int type) {
for (int i = 0; i < 4; i++) {
int r = row + types[type][i][0];
int c = col + types[type][i][1];
if (r >= 0 && r < ROWS && c >= 0 && c < COLS) {
board[r][c] = 0;
}
}
}
int can_fall(int row, int col, int type) {
for (int i = 0; i < 4; i++) {
int r = row + types[type][i][0] + 1;
int c = col + types[type][i][1];
if (r >= ROWS || board[r][c]) {
return 0;
}
}
return 1;
}
int can_move_left(int row, int col, int type) {
for (int i = 0; i < 4; i++) {
int r = row + types[type][i][0];
int c = col + types[type][i][1] - 1;
if (c < 0 || board[r][c]) {
return 0;
}
}
return 1;
}
int can_move_right(int row, int col, int type) {
for (int i = 0; i < 4; i++) {
int r = row + types[type][i][0];
int c = col + types[type][i][1] + 1;
if (c >= COLS || board[r][c]) {
return 0;
}
}
return 1;
}
void fix_block() {
draw_block(current_row, current_col, current_type);
current_type = rand() % 7;
current_row = 0;
current_col = COLS / 2 - 2;
for (int i = 0; i < 4; i++) {
current[i][0] = types[current_type][i][0];
current[i][1] = types[current_type][i][1];
}
}
int is_full(int row) {
for (int i = 0; i < COLS; i++) {
if (board[row][i] == 0) {
return 0;
}
}
return 1;
}
void remove_row(int row) {
for (int i = row; i > 0; i--) {
for (int j = 0; j < COLS; j++) {
board[i][j] = board[i - 1][j];
}
}
for (int j = 0; j < COLS; j++) {
board[0][j] = 0;
}
score++;
}
void display() {
system("cls");
for (int i = 0; i < ROWS; i++) {
for (int j = 0; j < COLS; j++) {
if (board[i][j]) {
printf("*");
} else if (i >= current_row && i < current_row + 4 && j >= current_col && j < current_col + 4 && current[i - current_row][j - current_col]) {
printf("*");
} else {
printf(" ");
}
}
printf("\n");
}
printf("Score: %d\n", score);
}
int main() {
srand(time(NULL));
fix_block();
while (1) {
display();
if (kbhit()) {
char c = getch();
if (c == 'a' && can_move_left(current_row, current_col, current_type)) {
remove_block(current_row, current_col, current_type);
current_col--;
} else if (c == 'd' && can_move_right(current_row, current_col, current_type)) {
remove_block(current_row, current_col, current_type);
current_col++;
} else if (c == 's' && can_fall(current_row, current_col, current_type)) {
remove_block(current_row, current_col, current_type);
current_row++;
} else if (c == ' ') {
while (can_fall(current_row, current_col, current_type)) {
remove_block(current_row, current_col, current_type);
current_row++;
}
fix_block();
}
}
if (can_fall(current_row, current_col, current_type)) {
remove_block(current_row, current_col, current_type);
current_row++;
} else {
fix_block();
for (int i = 0; i < ROWS; i++) {
if (is_full(i)) {
remove_row(i);
}
}
}
}
return 0;
}
```