This is a bigger scope than it looks on paper.
Start by clarifying requirements and defining the core game loop and data structures, then implement the game logic in a modular, testable way. Emphasize clean code, separation of concerns, and extensibility, while ensuring all specified features are covered.
Pro tip: Write unit tests for critical components like collision detection and line clearing to demonstrate reliability and catch edge cases early. Also, document your design decisions and trade-offs in a README to showcase your thought process.
Confirm the scope, constraints, and evaluation criteria. Outline the main components: board, tetrominoes, game loop, input handling, and scoring/leveling.
Define the board representation, tetromino shapes and rotations, and algorithms for collision detection, line clearing, and scoring.
Create a loop that applies gravity, processes user input for movement, rotation, soft/hard drop, and updates the game state.
Implement increasing speed with levels, track score and lines, and detect game over when a new piece cannot be placed.
Write unit tests for critical logic, refactor for clarity, and provide documentation on how to run and extend the game.
AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.