Skip to content

Commit 4d87f1a

Browse files
committed
Additional tetromino rotation system explanation
1 parent 97e5e74 commit 4d87f1a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ Reference implementations for the steps of this tutorial have been [tagged in it
5656

5757
Notice that the first test specifies the `Tetromino` objects to be immutable. Check the Wikipedia article about [immutable objects](http://en.wikipedia.org/wiki/Immutable_object) if that concept is new to you. Defaulting to immutability is a good thing.
5858

59+
Also notice that the I shape has only two possible orientations and the O shape has only one orientation. The tests are the way they are by design. Did you know that Tetris has many alternative [rotation systems](http://tetris.wikia.com/wiki/Category:Rotation_Systems)?
60+
5961
If you are thinking of making the `Tetromino` class extend the `Piece` class, first read about the [Liskov Substitution Principle](http://butunclebob.com/ArticleS.UncleBob.PrinciplesOfOod) to know when it's right for a class to inherit another. In general, it's best to [favor composition over inheritance](http://www.artima.com/lejava/articles/designprinciples4.html).
6062

6163
4. **FallingPiecesTest.java**

0 commit comments

Comments
 (0)