Ing0s
28-08-2000, 14:48
Hallo,
ich habe mir etwas code (für Tetris) durchgelesen und habe das gefunden:
#define bloc_types 7
#define bloc_orients 4
#define bloc_dots 4
typedef struct{
unsigned char x;
unsigned char y;
unsigned char color;
} DOT;
const DOT block_data[bloc_types][bloc_orients][bloc_dots] =
{
{
{{0,2,1},{1,2,1},{2,2,1},{3,2,1}},/* */
{{1,0,1},{1,1,1},{1,2,1},{1,3,1}},/* */
{{0,2,1},{1,2,1},{2,2,1},{3,2,1}},/* XXXX */
{{1,0,1},{1,1,1},{1,2,1},{1,3,1}}/* */
},
{
{{1,1,2},{2,1,2},{1,2,2},{2,2,2}},/* */
{{1,1,2},{2,1,2},{1,2,2},{2,2,2}},/* XX */
{{1,1,2},{2,1,2},{1,2,2},{2,2,2}},/* XX */
{{1,1,2},{2,1,2},{1,2,2},{2,2,2}}/* */
},
{
{{1,0,3},{1,1,3},{1,2,3},{0,2,3}},/* X */
{{0,0,3},{0,1,3},{1,1,3},{2,1,3}},/* X */
{{1,0,3},{2,0,3},{1,1,3},{1,2,3}},/* XX */
{{0,1,3},{1,1,3},{2,1,3},{2,2,3}}/* */
},
{
{{1,0,4},{1,1,4},{1,2,4},{2,2,4}},/* X */
{{0,1,4},{1,1,4},{2,1,4},{0,2,4}},/* X */
{{0,0,4},{1,0,4},{1,1,4},{1,2,4}},/* XX */
{{0,1,4},{1,1,4},{2,1,4},{2,0,4}}/* */
},
{
{{1,0,5},{0,1,5},{1,1,5},{0,2,5}},/* X */
{{0,0,5},{1,0,5},{1,1,5},{2,1,5}},/* XX */
{{1,0,5},{0,1,5},{1,1,5},{0,2,5}},/* X */
{{0,0,5},{1,0,5},{1,1,5},{2,1,5}}/* */
},
{
{{0,0,6},{0,1,6},{1,1,6},{1,2,6}},/* X */
{{1,0,6},{2,0,6},{0,1,6},{1,1,6}},/* XX */
{{0,0,6},{0,1,6},{1,1,6},{1,2,6}},/* X */
{{1,0,6},{2,0,6},{0,1,6},{1,1,6}}/* */
},
{
{{1,0,7},{0,1,7},{1,1,7},{2,1,7}},/* X */
{{1,0,7},{1,1,7},{2,1,7},{1,2,7}},/* XXX */
{{0,1,7},{1,1,7},{2,1,7},{1,2,7}},/* */
{{1,0,7},{0,1,7},{1,1,7},{1,2,7}}/* */
}
};
Was ist denn jetzt wo drin ?
ist
block_data[0][0][0]==0;
block_data[0][0][1]==2;
block_data[0][0][2]==1;
??
Danke
MfG Ing0s
ich habe mir etwas code (für Tetris) durchgelesen und habe das gefunden:
#define bloc_types 7
#define bloc_orients 4
#define bloc_dots 4
typedef struct{
unsigned char x;
unsigned char y;
unsigned char color;
} DOT;
const DOT block_data[bloc_types][bloc_orients][bloc_dots] =
{
{
{{0,2,1},{1,2,1},{2,2,1},{3,2,1}},/* */
{{1,0,1},{1,1,1},{1,2,1},{1,3,1}},/* */
{{0,2,1},{1,2,1},{2,2,1},{3,2,1}},/* XXXX */
{{1,0,1},{1,1,1},{1,2,1},{1,3,1}}/* */
},
{
{{1,1,2},{2,1,2},{1,2,2},{2,2,2}},/* */
{{1,1,2},{2,1,2},{1,2,2},{2,2,2}},/* XX */
{{1,1,2},{2,1,2},{1,2,2},{2,2,2}},/* XX */
{{1,1,2},{2,1,2},{1,2,2},{2,2,2}}/* */
},
{
{{1,0,3},{1,1,3},{1,2,3},{0,2,3}},/* X */
{{0,0,3},{0,1,3},{1,1,3},{2,1,3}},/* X */
{{1,0,3},{2,0,3},{1,1,3},{1,2,3}},/* XX */
{{0,1,3},{1,1,3},{2,1,3},{2,2,3}}/* */
},
{
{{1,0,4},{1,1,4},{1,2,4},{2,2,4}},/* X */
{{0,1,4},{1,1,4},{2,1,4},{0,2,4}},/* X */
{{0,0,4},{1,0,4},{1,1,4},{1,2,4}},/* XX */
{{0,1,4},{1,1,4},{2,1,4},{2,0,4}}/* */
},
{
{{1,0,5},{0,1,5},{1,1,5},{0,2,5}},/* X */
{{0,0,5},{1,0,5},{1,1,5},{2,1,5}},/* XX */
{{1,0,5},{0,1,5},{1,1,5},{0,2,5}},/* X */
{{0,0,5},{1,0,5},{1,1,5},{2,1,5}}/* */
},
{
{{0,0,6},{0,1,6},{1,1,6},{1,2,6}},/* X */
{{1,0,6},{2,0,6},{0,1,6},{1,1,6}},/* XX */
{{0,0,6},{0,1,6},{1,1,6},{1,2,6}},/* X */
{{1,0,6},{2,0,6},{0,1,6},{1,1,6}}/* */
},
{
{{1,0,7},{0,1,7},{1,1,7},{2,1,7}},/* X */
{{1,0,7},{1,1,7},{2,1,7},{1,2,7}},/* XXX */
{{0,1,7},{1,1,7},{2,1,7},{1,2,7}},/* */
{{1,0,7},{0,1,7},{1,1,7},{1,2,7}}/* */
}
};
Was ist denn jetzt wo drin ?
ist
block_data[0][0][0]==0;
block_data[0][0][1]==2;
block_data[0][0][2]==1;
??
Danke
MfG Ing0s