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
Grid/Grid.h@4:aa433f9865a6, 2019-03-12 (annotated)
- Committer:
- el17ajf
- Date:
- Tue Mar 12 20:03:31 2019 +0000
- Revision:
- 4:aa433f9865a6
- Parent:
- 3:a1b058ff66c2
- Child:
- 5:3efbdcb3efaf
Tetromino class;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
el17ajf | 4:aa433f9865a6 | 1 | #include "Tetromino.h" |
el17ajf | 3:a1b058ff66c2 | 2 | |
el17ajf | 3:a1b058ff66c2 | 3 | class Grid { |
el17ajf | 3:a1b058ff66c2 | 4 | public: |
el17ajf | 3:a1b058ff66c2 | 5 | bool isSpaceForTetromino(Tetromino tetromino); |
el17ajf | 3:a1b058ff66c2 | 6 | void placeTetromino(Tetromino tetromino); |
el17ajf | 4:aa433f9865a6 | 7 | void clear(); |
el17ajf | 4:aa433f9865a6 | 8 | void draw(); |
el17ajf | 3:a1b058ff66c2 | 9 | private: |
el17ajf | 4:aa433f9865a6 | 10 | void moveDownIfNeeded(); |
el17ajf | 4:aa433f9865a6 | 11 | void shiftDownFrom(int row); |
el17ajf | 3:a1b058ff66c2 | 12 | const int height = 20; |
el17ajf | 3:a1b058ff66c2 | 13 | const int width = 10; |
el17ajf | 4:aa433f9865a6 | 14 | bool * grid = new bool[width][height]; |
el17ajf | 4:aa433f9865a6 | 15 | bool isSpaceForBlock(Block block); |
el17ajf | 3:a1b058ff66c2 | 16 | }; |