-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Maximilian Weichart
committed
May 4, 2024
1 parent
11d2bf6
commit 691871a
Showing
9 changed files
with
243 additions
and
149 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
"""Data structures for Tetris.""" | ||
from dataclasses import dataclass | ||
|
||
import numpy as np | ||
|
||
|
||
@dataclass | ||
class Pixel: | ||
"""A single pixel of a Tetris game. | ||
A pixel can be part of a tetromino or part of the game board (empty, bedrock). | ||
""" | ||
|
||
id: int | ||
color_rgb: list | ||
|
||
|
||
@dataclass | ||
class Tetromino(Pixel): | ||
"""A Tetris piece. | ||
A tetromino is a geometric shape composed of multiple pixels. | ||
""" | ||
|
||
matrix: np.ndarray |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.