CodePudding user response:
Before writing your own tetris, add 3 star and 5 star pattern, in order to simple limit the size of the 5 star patterns within 4 x4, each pattern is only 16 points, can be said that with uint16_t traverse from 0 XFFFF x0fff 0 after all the pattern out star number wrong, eliminate split into more than one piece design, eliminate repetition, and keep only in the patterns of the lower left corner, to get a complete set and do not repeat graphics, using the lower-left corner of 0 xf000 coding way, the bottom right hand corner of 0 x1000, the upper left corner of 0 x000f, top right corner of 0 x0001, so on the way, each row is the same graphics rotation when four direction, do not understand according to below to speculate:I put the filter algorithm to 6 star and seven star (4 x4) still limit, all the results are as follows:
3 star 2
Xe000 xe000 0, 0 x8880, 0, 0 x8880,
X4c00 xc800 0, 0 x8c00, 0, 0 xc400,
4 star 7
Xf000 xf000 0, 0 x8888, 0, 0 x8888,
X2e00 xe800 0, 0 x88c0, 0, 0 xc440,
X4e00 xe400 0, 0 x8c80, 0, 0 x4c40,
X8e00 xe200 0, 0 xc880, 0, 0 x44c0,
Xcc00 xcc00 0, 0 xcc00, 0, 0 xcc00,
Xc600 xc600 0, 0 x4c80, 0, 0 x4c80,
X8c40 x8c40 0, 0 x6c00, 0, 0 x6c00,
5 star 17
X1f00 xf800 0, 0 x888c, 0, 0 xc444,
X2f00 xf400 0, 0 x88c8, 0, 0 x4c44,
X4f00 xf200 0, 0 x8c88, 0, 0 x44c4,
X8f00 xf100 0, 0 xc888, 0, 0 x444c,
X6e00 xec00 0, 0 x8cc0, 0, 0 xcc40,
Xae00 xea00 0, 0 xc8c0, 0, 0 xc4c0,
X22e0 xe880 0, 0 x88e0, 0, 0 xe220,
Xce00 xe600 0, 0 xcc80, 0, 0 x4cc0,
X44e0 xe440 0, 0 x8e80, 0, 0 x2e20,
Xc700 xe300 0, 0 x4c88, 0, 0 x44c8,
X4c60 xc640 0, 0 x4e80, 0, 0 x2e40,
X8c60 xc620 0, 0 x6c80, 0, 0 x26c0,
Xc460 xc460 0, 0 x2e80, 0, 0 x2e80,
X4e20 x8e40 0, 0 x46c0, 0, 0 x6c40,
X8e20 x8e20 0, 0 x64c0, 0, 0 x64c0,
X88c4 x8c44 0, 0 x7c00, 0, 0 x3e00,
X4e40 x4e40 0, 0 x4e40, 0, 0 x4e40,
6 star 50
X3f00 xfc00 0, 0 x88cc, 0, 0 xcc44,
X5f00 xfa00 0, 0 x8c8c, 0, 0 xc4c4,
X9f00 xf900 0, 0 xc88c, 0, 0 xc44c,
X11f0 xf880 0, 0 x888e, 0, 0 xe222,
X6f00 xf600 0, 0 x8cc8, 0, 0 x4cc4,
Xaf00 xf500 0, 0 xc8c8, 0, 0 x4c4c,
X22f0 xf440 0, 0 x88e8, 0, 0 x2e22,
Xcf00 xf300 0, 0 xcc88, 0, 0 x44cc,
X44f0 xf220 0, 0 x8e88, 0, 0 x22e2,
X88f0 xf110 0, 0 xe888, 0, 0 x222e,
Xee00 xee00 0, 0 xccc0, 0, 0 xccc0,
X26e0 xec80 0, 0 x8ce0, 0, 0 xe620,
X46e0 xec40 0, 0 x8ec0, 0, 0 x6e20,
Xd700 xeb00 0, 0 x4c8c, 0, 0 xc4c8,
X2ae0 xea80 0, 0 xc8e0, 0, 0 xe260,
X8ae0 xea20 0, 0 xe8c0, 0, 0 x62e0,
Xe700 xe700 0, 0 x4cc8, 0, 0 x4cc8,
X4ce0 xe640 0, 0 xce80, 0, 0 x2e60,
X64e0 xe4c0 0, 0 x8ea0, 0, 0 xae20,
Xc4e0 xe460 0, 0 xae80, 0, 0 x2ea0,
X444e xe444 0, 0 x8f80, 0, 0 x1f10,
X4c70 xe320 0, 0 x4e88, 0, 0 x22e4,
X8c70 xe310 0, 0 x6c88, 0, 0 x226c,
Xc470 xe230 0, 0 x2e88, 0, 0 x22e8,
X4e60 xce40 0, 0 x4ec0, 0, 0 x6e40,
X8e60 xce20 0, 0 x6cc0, 0, 0 x66c0,
Xc660 xcc60 0, 0 x2ec0, 0, 0 x6e80,
X8c4c xc8c4 0, 0 xbe00, 0, 0 x7d00,
X2e30 xc740 0, 0 x44e8, 0, 0 x2e44,
X4e30 xc720 0, 0 x46c8, 0, 0 x26c4,
X8e30 xc710 0, 0 x64c8, 0, 0 x264c,
X6c60 xc6c0 0, 0 x4ea0, 0, 0 xae40,
X44c6 xc644 0, 0 x4f80, 0, 0 x1f20,
Xc630 xc630 0, 0 x26c8, 0, 0 x26c8,
X88c6 xc622 0, 0 x7c80, 0, 0 x13e0,
X4c46 xc464 0, 0 x2f80, 0, 0 x1f40,
X8c46 xc462 0, 0 x3e80, 0, 0 x17c0,
Xc446 xc446 0, 0 x1f80, 0, 0 x1f80,
X2f10 x8f40 0, 0 x446c, 0, 0 x6c44,
X4f10 x8f20 0, 0 x464c, 0, 0 x64c4,
X8f10 x8f10 0, 0 x644c, 0, 0 x644c,
X44e2 x8e44 0, 0 x47c0, 0, 0 x3e20,
X88e2 x8e22 0, 0 x74c0, 0, 0 x32e0,
X8cc4 x8cc4 0, 0 x7e00, 0, 0 x7e00,
X4c62 x8c64 0, 0 x27c0, 0, 0 x3e40,
X8c62 x8c62 0, 0 x36c0, 0, 0 x36c0,
X4e22 x88e4 0, 0 x23e0, 0, 0 x7c40,
X2f20 x4f40 0, 0 x44e4, 0, 0 x4e44,
X4f20 x4f20 0, 0 x46c4, 0, 0 x46c4,
X4c64 x4c64 0, 0 x2f40, 0, 0 x2f40,
Seven star 120
X7f00 xfe00 0, 0 x8ccc, 0, 0 xccc4,
Xbf00 xfd00 0, 0 xc8cc, 0, 0 xcc4c,
X13f0 xfc80 0, 0 x88ce, 0, 0 xe622,
X23f0 xfc40 0, 0 x88ec, 0, 0 x6e22,
Xdf00 xfb00 0, 0 xcc8c, 0, 0 xc4cc,
X15f0 xfa80 0, 0 x8c8e, 0, 0 xe262,
X45f0 xfa20 0, 0 x8e8c, 0, 0 x62e2,
X19f0 xf980 0, 0 xc88e, 0, 0 xe226,
X89f0 xf910 0, 0 xe88c, 0, 0 x622e,
X31f0 xf8c0 0, 0 x88ae, 0, 0 xea22,
X111f xf888 0, 0 x888f, 0, 0 xf111,
Xef00 xf700 0, 0 xccc8, 0, 0 x4ccc,
X26f0 xf640 0, 0 x8ce8, 0, 0 x2e62,
X46f0 xf620 0, 0 x8ec8, 0, 0 x26e2,
X2af0 xf540 0, 0 xc8e8, 0, 0 x2e26,
X8af0 xf510 0, 0 xe8c8, 0, 0 x262e,
X32f0 xf4c0 0, 0 x88ea, 0, 0 xae22,
X62f0 xf460 0, 0 x8ae8, 0, 0 x2ea2,
X222f xf444 0, 0 x88f8, 0, 0 x1f11,
X4cf0 xf320 0, 0 xce88, 0, 0 x22e6,
X8cf0 xf310 0, 0 xec88, 0, 0 x226e,
X64f0 xf260 0, 0 x8ea8, 0, 0 x2ae2,
Xc4f0 xf230 0, 0 xae88, 0, 0 x22ea,
X444f xf222 0, 0 x8f88, 0, 0 x11f1,
Xc8f0 xf130 0, 0 xea88, 0, 0 x22ae,
X2ee0 xee80 0, 0 xcce0, 0, 0 xe660,
X4ee0 xee40 0, 0 xcec0, 0, 0 x6e60,
X8ee0 xee20 0, 0 xecc0, 0, 0 x66e0,
Xc6e0 xec60 0, 0 xaec0, 0, 0 x6ea0,
X446e xec44 0, 0 x8fc0, 0, 0 x3f10,
X1d70 xeb80 0, 0 x4c8e, 0, 0 xe264,
X4d70 xeb20 0, 0 x4e8c, 0, 0 x62e4,
X8d70 xeb10 0, 0 x6c8c, 0, 0 x626c,
X6ae0 xeac0 0, 0 xcae0, 0, 0 xea60,
Xaae0 xeaa0 0, 0 xe8e0, 0, 0 xe2e0,
Xc570 xea30 0, 0 x2e8c, 0, 0 x62e8,
X462e xe8c4 0, 0 x8be0, 0, 0 x7d10,
X2e70 xe740 0, 0 x4ce8, 0, 0 x2e64,
X4e70 xe720 0, 0 x4ec8, 0, 0 x26e4,
nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull