← Back to companies
[ OK ] Loaded —
[ INFO ]
$ cd
$ ls -lt
01
02
03
04
05
$ ls -lt
01
02
03
04
05
user@intervues:~/$
Design and implement a simplified, console-style Tetris game. Your task is to write a class (or set of classes) that models an endless Tetris session. The board is a fixed 10×20 grid (width × height) implemented as a 2-D array of booleans/integers. Seven tetrominoes (I, O, T, S, Z, J, L) must be supported; each piece spawns at the top centre with a random rotation. The public API must expose exactly one key method:
int drop(int pieceType, int rotation, int column)
The method must:
No user input, scoring, line-count multipliers, or next-piece queue are required; focus purely on the core drop-and-clear mechanics. State must persist across calls so successive drops accumulate locked blocks and the board evolves accordingly.