header.c

来自「用linuX 下的C语言 运用CURSES编写的俄罗斯方块游戏」· C语言 代码 · 共 53 行

C
53
字号
#include"curses.h"
#include"stdlib.h"
#include"time.h"



#define w_high 25   /*the high of gamewin*/
#define w_width 60  /*the width of gamewin*/
#define win_x 10  /*the sign x of the win*/
#define win_y 0  /*the sign y of the win*/
#define game_win_x 11
#define game_win_y 1
#define game_win_high 21
#define game_win_width 12
#define stone_type 7//the type of the stone
#define stone_view 4//the view of the stone
#define stone_x 4//the large x of the stone array
#define stone_y 4//the large y of the stone array

int i,j,t,v_t,k,v_k,quit,temp,v_temp,temp_y,flag,s_flag,temp_i;//不允许赋值
int view,type,view_a,type_a,v_type,v_view,v_type_a,v_view_a,color,
score,v_score;
int ch,x,y,v_x,v_y;
int stone_s[stone_type][stone_view][stone_x][stone_y];
int g_win[game_win_high+1][game_win_width],v_win[game_win_high+1][game_win_width];

WINDOW *win,*game_win,*hint_win,*virtual_win,*vhint_win;

void make_stone(int stone_s[stone_type][stone_view][stone_x][stone_y],int *type,int *view);

void show_stone(int stone_s[stone_type][stone_view][stone_x][stone_y],int *type,int *view,WINDOW *game_win,int *x,int *y);

int make_game_win(int stone_s[stone_type][stone_view][stone_x][stone_y],int g_win[game_win_high+1][game_win_width],int *type,int *view,int *x,int *y);

void clear_win(int g_win[game_win_high+1][game_win_width],int v_win[game_win_high+1][game_win_width]);

void show_g_stone(int g_win[game_win_high+1][game_win_width],WINDOW *game_win
);

void del_stone(int g_win[game_win_high+1][game_win_width],int *score);

int traversal_v_win(int v_win[game_win_high+1][game_win_width],int *type,int *view);

void select_mode (WINDOW *win,int *flag);

int iostream();

void hint_fun();

void sure_sign();

void init_data();

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?