📄 five.h
字号:
#ifndef __FIVE_H__
#define __FIVE_H__
#define LINE_COUNT 16
#define MAN_WHITE 1
#define MAN_BLACK 0
#define STAT_NOTHING 0
#define STAT_PLAING 1
#define COLOR_WHITE1 255
#define COLOR_WHITE2 255
#define COLOR_WHITE3 255
#define COLOR_BLACK1 0
#define COLOR_BLACK2 180
#define COLOR_BLACK3 255
#define COLOR_CUR1 0
#define COLOR_CUR2 255
#define COLOR_CUR3 0
#define COLOR_CUR_WHITE1 180
#define COLOR_CUR_WHITE2 180
#define COLOR_CUR_WHITE3 0
#define COLOR_CUR_BLACK1 180
#define COLOR_CUR_BLACK2 0
#define COLOR_CUR_BLACK3 180
#define SPACE_PRIORITY 10 // 两头的空格
#define SPACE_PRIORITY2 -5 // 中间的空格
#define BYTE unsigned char
typedef struct
{
char x, y;
}POINT;
#include "tcp.h"
typedef struct _APP_DATA
{
AEEApplet a;
IGraphics *m_pGraphics;
IBitmap *pCurBmp;
IFileMgr *pFileMgr;
CSocket m_Socket;
BYTE my_color; // 0-black, 1-white
short cx_screen, cy_screen, per_line_width, per_line_height, start_space;
BYTE man_width; // 棋子半径
short cur_i; // 当前x坐标
short cur_j; // 当前y坐标
BYTE stat; // 0-nothing, 1-wait black, 2-wait white
char man[LINE_COUNT][LINE_COUNT]; // 棋子位置数据
int cur_step;
POINT step[LINE_COUNT*LINE_COUNT]; // 记录每步棋
BYTE skill; // 级别
char who_start; // 谁先开始
}APP_DATA;
// 画棋盘
int FIVE_DrawBoard(APP_DATA *pdata);
int FIVE_MachineGo(APP_DATA *pdata);
int FIVE_CheckWin(APP_DATA *pdata);
int FIVE_GoBack(APP_DATA *pdata);
int FIVE_CalcCount(APP_DATA *pdata, int color);
// 画棋子
int FIVE_DrawMan(APP_DATA *pdata, int i, int j, int type);
// 画棋盘和棋子
void FIVE_DrawAll(APP_DATA *pdata);
// 检查某个位置是否有棋子,是什么棋子
int FIVE_CheckMan(APP_DATA *pdata, short x, short y);
// 检查输赢
int FIVE_CheckWin(APP_DATA *pdata);
int FIVE_tmp(APP_DATA *pdata, int i, int j);
int FIVE_HumanGo(APP_DATA *pdata, int i, int j);
int FIVE_CheckStat(APP_DATA *pdata, int nX, int nY, char cValue);
POINT FIVE_GetBestPoint(APP_DATA *pdata, char byColor);
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -