![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
My ELEC2645 joystick project Tetris Game NAME: JIANWEI CHEN SID: 200879849
Dependencies: N5110 SDFileSystem mbed
Patterns.cpp
- Committer:
- cjw851102
- Date:
- 2016-04-17
- Revision:
- 0:12a1972fa0d0
- Child:
- 1:2a758565f691
File content as of revision 0:12a1972fa0d0:
#include "Patterns.h" // type rotation y x int pattern[7][4][6][6] = { { //L { {1,1,0,0,0,0}, {1,1,0,0,0,0}, {1,1,0,0,0,0}, {1,1,0,0,0,0}, {1,1,1,1,0,0}, {1,1,1,1,0,0} }, { {0,0,0,0,0,0}, {0,0,0,0,0,0}, {0,0,0,0,1,1}, {0,0,0,0,1,1}, {1,1,1,1,1,1}, {1,1,1,1,1,1} }, { {0,0,1,1,1,1}, {0,0,1,1,1,1}, {0,0,0,0,1,1}, {0,0,0,0,1,1}, {0,0,0,0,1,1}, {0,0,0,0,1,1} }, { {1,1,1,1,1,1}, {1,1,1,1,1,1}, {1,1,0,0,0,0}, {1,1,0,0,0,0}, {0,0,0,0,0,0}, {0,0,0,0,0,0} } }, { //L mirrored { {0,0,0,0,1,1}, {0,0,0,0,1,1}, {0,0,0,0,1,1}, {0,0,0,0,1,1}, {0,0,1,1,1,1}, {0,0,1,1,1,1} }, { {1,1,1,1,1,1}, {1,1,1,1,1,1}, {0,0,0,0,1,1}, {0,0,0,0,1,1}, {0,0,0,0,0,0}, {0,0,0,0,0,0} }, { {1,1,1,1,0,0}, {1,1,1,1,0,0}, {1,1,0,0,0,0}, {1,1,0,0,0,0}, {1,1,0,0,0,0}, {1,1,0,0,0,0} }, { {0,0,0,0,0,0}, {0,0,0,0,0,0}, {1,1,0,0,0,0}, {1,1,0,0,0,0}, {1,1,1,1,1,1}, {1,1,1,1,1,1} } }, { //I { {0,0,0,0,0,0}, {0,0,0,0,0,0}, {1,1,1,1,1,1}, {1,1,1,1,1,1}, {0,0,0,0,0,0}, {0,0,0,0,0,0} }, { {0,0,1,1,0,0}, {0,0,1,1,0,0}, {0,0,1,1,0,0}, {0,0,1,1,0,0}, {0,0,1,1,0,0}, {0,0,1,1,0,0} }, { {0,0,0,0,0,0}, {0,0,0,0,0,0}, {1,1,1,1,1,1}, {1,1,1,1,1,1}, {0,0,0,0,0,0}, {0,0,0,0,0,0} }, { {0,0,1,1,0,0}, {0,0,1,1,0,0}, {0,0,1,1,0,0}, {0,0,1,1,0,0}, {0,0,1,1,0,0}, {0,0,1,1,0,0} } }, { //T { {0,0,0,0,0,0}, {0,0,0,0,0,0}, {0,0,1,1,0,0}, {0,0,1,1,0,0}, {1,1,1,1,1,1}, {1,1,1,1,1,1} }, { {0,0,0,0,1,1}, {0,0,0,0,1,1}, {0,0,1,1,1,1}, {0,0,1,1,1,1}, {0,0,0,0,1,1}, {0,0,0,0,1,1} }, { {1,1,1,1,1,1}, {1,1,1,1,1,1}, {0,0,1,1,0,0}, {0,0,1,1,0,0}, {0,0,0,0,0,0}, {0,0,0,0,0,0} }, { {1,1,0,0,0,0}, {1,1,0,0,0,0}, {1,1,1,1,0,0}, {1,1,1,1,0,0}, {1,1,0,0,0,0}, {1,1,0,0,0,0} } }, { //square { {1,1,1,1,0,0}, {1,1,1,1,0,0}, {1,1,1,1,0,0}, {1,1,1,1,0,0}, {0,0,0,0,0,0}, {0,0,0,0,0,0} }, { {1,1,1,1,0,0}, {1,1,1,1,0,0}, {1,1,1,1,0,0}, {1,1,1,1,0,0}, {0,0,0,0,0,0}, {0,0,0,0,0,0} }, { {1,1,1,1,0,0}, {1,1,1,1,0,0}, {1,1,1,1,0,0}, {1,1,1,1,0,0}, {0,0,0,0,0,0}, {0,0,0,0,0,0} }, { {1,1,1,1,0,0}, {1,1,1,1,0,0}, {1,1,1,1,0,0}, {1,1,1,1,0,0}, {0,0,0,0,0,0}, {0,0,0,0,0,0} } }, { //N { {1,1,0,0,0,0}, {1,1,0,0,0,0}, {1,1,1,1,0,0}, {1,1,1,1,0,0}, {0,0,1,1,0,0}, {0,0,1,1,0,0} }, { {0,0,0,0,0,0}, {0,0,0,0,0,0}, {0,0,1,1,1,1}, {0,0,1,1,1,1}, {1,1,1,1,0,0}, {1,1,1,1,0,0} }, { {0,0,1,1,0,0}, {0,0,1,1,0,0}, {0,0,1,1,1,1}, {0,0,1,1,1,1}, {0,0,0,0,1,1}, {0,0,0,0,1,1} }, { {0,0,1,1,1,1}, {0,0,1,1,1,1}, {1,1,1,1,0,0}, {1,1,1,1,0,0}, {0,0,0,0,0,0}, {0,0,0,0,0,0} } }, { //N mirrored { {0,0,1,1,0,0}, {0,0,1,1,0,0}, {1,1,1,1,0,0}, {1,1,1,1,0,0}, {1,1,0,0,0,0}, {1,1,0,0,0,0} }, { {0,0,0,0,0,0}, {0,0,0,0,0,0}, {1,1,1,1,0,0}, {1,1,1,1,0,0}, {0,0,1,1,1,1}, {0,0,1,1,1,1} }, { {0,0,0,0,1,1}, {0,0,0,0,1,1}, {0,0,1,1,1,1}, {0,0,1,1,1,1}, {0,0,1,1,0,0}, {0,0,1,1,0,0} }, { {1,1,1,1,0,0}, {1,1,1,1,0,0}, {0,0,1,1,1,1}, {0,0,1,1,1,1}, {0,0,0,0,0,0}, {0,0,0,0,0,0} } } }; int Patterns::getPatterns(int type, int rotation, int y, int x) { return pattern[type][rotation][y][x]; }