C语言俄罗斯方块
先看效果


代码如下
#include <stdio.h>
#include <stdlib.h>
#include <windows.h>
#define UI_WIDTH 14
#define UI_HEIGHT 25
#define WALL 1
#define BLOCK 2
#define VK_UP 72
#define VK_DOWN 80
#define VK_LEFT 75
#define VK_RIGHT 77
#define TRUE 1
#define FALSE 0
void initia();
void gameShow();
void moveBlock();
short isCanMoveBlock(short x, short y);
void produceBlock();
void toBottom(short x, short y);
short cur_block_coord_x ,cur_block_coord_y;
short next_blockarr[4][4];
short cur_boxindex,next_boxindex;
int score;
char player_name[10] = "你大哥" ;
HANDLE hOutput;
struct _game_arr{
short info;
short var;
}game_arr[UI_HEIGHT][UI_WIDTH];
struct _block
{
short a[4][2];
short next;
};
struct _block block[19]=
{
{
1,1,1,2,1,3,2,3,1},
{
0,2,1,2,2,2,0,3,2},
{
0,1,1,1,1,2,1,3,3},
{
2,1,0,2,1,2,2,2,0},
{
1,1,1,2,0,3,1,3,5},
{
0,1,0,2,1,2,2,2,6},
{
1,1,2,1,1,2,1,3,7},
{
0,2,1,2,2,2,2,3,4},
{
1,1,0,2,1,2,2,2,9},
{
1,1,1