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
Diff: Grid/Grid.h
- Revision:
- 4:aa433f9865a6
- Parent:
- 3:a1b058ff66c2
- Child:
- 5:3efbdcb3efaf
--- a/Grid/Grid.h Tue Mar 12 16:37:43 2019 +0000 +++ b/Grid/Grid.h Tue Mar 12 20:03:31 2019 +0000 @@ -1,22 +1,16 @@ -class Block { -public: - int x; - int y; -}; - -class Tetromino { -public: - Tetromino(); - Block[] blocks = new Block[4]; -}; +#include "Tetromino.h" class Grid { public: - void update(); bool isSpaceForTetromino(Tetromino tetromino); void placeTetromino(Tetromino tetromino); + void clear(); + void draw(); private: + void moveDownIfNeeded(); + void shiftDownFrom(int row); const int height = 20; const int width = 10; - int * grid = new int[width][height]; + bool * grid = new bool[width][height]; + bool isSpaceForBlock(Block block); }; \ No newline at end of file