俄罗斯方块c语言源程序
#define LEFT 0x4b
#define RIGHT 0x4d
#define DOWN 0x50
#define CHANGE 0x20
#define ESC 0x1b
#define INTR 0x1C
#define DefaultX 5
#define DefaultY 1
static unsigned counter=0;
static unsigned shape[7][4][4][4]={
{
{{0,1,1,0},{0,1,1,0},{0,0,0,0},{0,0,0,0}},
{{0,1,1,0},{0,1,1,0},{0,0,0,0},{0,0,0,0}},
{{0,1,1,0},{0,1,1,0},{0,0,0,0},{0,0,0,0}},
{{0,1,1,0},{0,1,1,0},{0,0,0,0},{0,0,0,0}},
},
{
{{0,0,0,0},{1,1,1,1},{0,0,0,0},{0,0,0,0}},
{{0,0,1,0},{0,0,1,0},{0,0,1,0},{0,0,1,0}},
{{0,0,0,0},{1,1,1,1},{0,0,0,0},{0,0,0,0}},
{{0,0,1,0},{0,0,1,0},{0,0,1,0},{0,0,1,0}},
},
{
{{0,1,0,0},{1,1,1,0},{0,0,0,0},{0,0,0,0}},
{{0,1,0,0},{0,1,1,0},{0,1,0,0},{0,0,0,0}},
{{0,0,0,0},{1,1,1,0},{0,1,0,0},{0,0,0,0}},
{{0,1,0,0},{1,1,0,0},{0,1,0,0},{0,0,0,0}},
},
{
{{1,0,0,0},{1,1,0,0},{0,1,0,0},{0,0,0,0}},
{{0,0,0,0},{0,1,1,0},{1,1,0,0},{0,0,0,0}},
{{1,0,0,0},{1,1,0,0},{0,1,0,0},{0,0,0,0}},
{{0,0,0,0},{0,1,1,0},{1,1,0,0},{0,0,0,0}},
},
{
{{0,1,0,0},{1,1,0,0},{1,0,0,0},{0,0,0,0}},
{{0,0,0,0},{1,1,0,0},{0,1,1,0},{0,0,0,0}},
{{0,1,0,0},{1,1,0,0},{1,0,0,0},{0,0,0,0}},
{{0,0,0,0},{1,1,0,0},{0,1,1,0},{0,0,0,0}},
},
{
{{1,0,0,0},{1,0,0,0},{1,1,0,0},{0,0,0,0}},
{{0,0,0,0},{1,1,1,0},{1,0,0,0},{0,0,0,0}},
{{1,1,0,0},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