Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
Fork of el17ajf by
Tetromino/Tetromino.h@5:3efbdcb3efaf, 2019-03-13 (annotated)
- Committer:
- el17ajf
- Date:
- Wed Mar 13 09:30:36 2019 +0000
- Revision:
- 5:3efbdcb3efaf
- Parent:
- 4:aa433f9865a6
- Child:
- 6:a54df561f442
Immutable grid class
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
el17ajf | 4:aa433f9865a6 | 1 | #include "Block.h" |
el17ajf | 4:aa433f9865a6 | 2 | |
el17ajf | 4:aa433f9865a6 | 3 | class Tetromino { |
el17ajf | 5:3efbdcb3efaf | 4 | private: |
el17ajf | 4:aa433f9865a6 | 5 | Tetromino translated(int dx, int dy); |
el17ajf | 4:aa433f9865a6 | 6 | public: |
el17ajf | 4:aa433f9865a6 | 7 | enum Type { |
el17ajf | 4:aa433f9865a6 | 8 | I, O, T, J, L, S, Z |
el17ajf | 4:aa433f9865a6 | 9 | }; |
el17ajf | 5:3efbdcb3efaf | 10 | static Tetromino GetTetriminoOfType(Type type); |
el17ajf | 5:3efbdcb3efaf | 11 | static Tetromino getTetrominoFromString(const char * str); |
el17ajf | 4:aa433f9865a6 | 12 | Tetromino(Block a, Block b, Block c, Block d); |
el17ajf | 5:3efbdcb3efaf | 13 | Block blocks[]; |
el17ajf | 4:aa433f9865a6 | 14 | Tetromino movedLeft(); |
el17ajf | 4:aa433f9865a6 | 15 | Tetromino movedRight(); |
el17ajf | 4:aa433f9865a6 | 16 | }; |