Skip to content

Conversation

@kuaileyichu
Copy link

test Jules

imhuay and others added 30 commits October 18, 2018 16:48
* Update 笔试-迅雷-180912.md

## AI-A-01的题目是说该数等于左边所有数之和且等于右边所有数之和

* Update 笔试-迅雷-180912.md
Update 合并排序链表——迭代实现
make the last node of the list point to nullptr.
修改欧氏距离和余弦相似度的取值范围。
This commit introduces a playable, text-based version of Tetris.

Features:
- Standard Tetromino shapes (I, J, L, O, S, T, Z) and rotations.
- Game board with collision detection and row clearing.
- Core game logic: piece spawning, gravity, locking pieces.
- User input for moving (left, right, down), rotating, and hard-dropping pieces.
- Text-based display in the terminal showing the board, current piece, next piece, and score.
- Game over condition when new pieces cannot be spawned.
- Basic scoring for clearing lines.

The game is structured into modules:
- `tetris/board.py`: Handles the game board state and operations.
- `tetris/tetrominoes.py`: Defines Tetromino shapes and rotation logic.
- `tetris/game.py`: Contains the main game class and core game mechanics.
- `tetris/main.py`: Entry point for the game, handles user input and the main game loop.

Unit tests have been added for board operations (row clearing) and Tetromino rotations, located in the `tetris/tests` directory.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants