91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

資源簡介

用c語言實現(xiàn)的連連看算法,對c語言基礎(chǔ),數(shù)據(jù)結(jié)構(gòu)等能有較好了解

資源截圖

代碼片段和文件信息

#include?
#include?
#include
#include

typedef?struct{
int?x;
int?y;
}stPos;

typedef?struct{
stPos?position;
????char?type;
bool?IsClear;
}stUnion;

//#define?UNION_ARRAY_XLEN???16
//#define?UNION_ARRAY_YLEN???16
#define?UNION_ARRAY_XLEN???9
#define?UNION_ARRAY_YLEN???9

#define?GET_MIN(x?y)???(x?<=?y???x?:?y)
#define?GET_MAX(x?y)???(x?>=?y???x?:?y)


extern?void?InitUnionArray(stUnion?ucUnionArray[][UNION_ARRAY_YLEN]);
extern?void?PrintfUnionArray(stUnion?ucUnionArray[][UNION_ARRAY_YLEN]);
extern?bool?IsUnionClear(stUnion?*?ucUnion);
extern?void?ClearUnion(stUnion?*?ucUnion);
extern?bool?IsSameTypeUnion(stUnion?*?ucFirUnion?stUnion?*?ucSecUnion);
extern?bool?IsSameUnion(stUnion?*?ucFirUnion?stUnion?*?ucSecUnion);
extern?bool?IsNextUnion(stUnion?*?ucFirUnion?stUnion?*?ucSecUnion);
extern?bool?IsHoriLine(stUnion?*?ucFirUnion?stUnion?*?ucSecUnion?stUnion?ucUnionArray[][UNION_ARRAY_YLEN]);
extern?bool?IsVerLine(stUnion?*?ucFirUnion?stUnion?*?ucSecUnion?stUnion?ucUnionArray[][UNION_ARRAY_YLEN]);
extern?bool?IsLine(stUnion?*?ucFirUnion?stUnion?*?ucSecUnion?stUnion?ucUnionArray[][UNION_ARRAY_YLEN]);
extern?bool?IsNearLeftBorder(stUnion?*?ucUnion?stUnion?ucUnionArray[][UNION_ARRAY_YLEN]);
extern?bool?IsNearRightBorder(stUnion?*?ucUnion?stUnion?ucUnionArray[][UNION_ARRAY_YLEN]);
extern?bool?IsNearUpBorder(stUnion?*?ucUnion?stUnion?ucUnionArray[][UNION_ARRAY_YLEN]);
extern?bool?IsNearDownBorder(stUnion?*?ucUnion?stUnion?ucUnionArray[][UNION_ARRAY_YLEN]);
extern?bool?GetHoriTwoUnion(stUnion?*?ucUnion?stUnion?ucUnionArray[][UNION_ARRAY_YLEN]?stUnion?*FirUnion?stUnion?*?SecUnion);
extern?bool?GetVerTwoUnion(stUnion?*?ucUnion?stUnion?ucUnionArray[][UNION_ARRAY_YLEN]?stUnion?*FirUnion?stUnion?*?SecUnion);
extern?bool?IsLineUnderTwoTurn(stUnion?*?ucFirUnion?stUnion?*?ucSecUnion?stUnion?ucUnionArray[][UNION_ARRAY_YLEN]);
extern?bool?IsTwoUnionClear(stUnion?*?ucFirUnion?stUnion?*?ucSecUnion?stUnion?ucUnionArray[][UNION_ARRAY_YLEN]);

void?InitUnionArray(stUnion?ucUnionArray[][UNION_ARRAY_YLEN])
{
int?i?=?0;
int?j?=?0;


srand((int)time(0));

for(j?=?0;?j? {
for(i?=?0;?i? {
ucUnionArray[i][j].position.x?=?i;
ucUnionArray[i][j].position.y?=?j;

ucUnionArray[i][j].type?=?(char)(65?+?(int)(10.0*rand()/(RAND_MAX+1.0)));

ucUnionArray[i][j].IsClear?=?false;

//if(!UnionArray[i][j].IsClear)
//printf(“?%c?“?UnionArray[i][j].type);
//else
//printf(“???“);
}
//printf(“\n“);
}

}

void?PrintfUnionArray(stUnion?ucUnionArray[][UNION_ARRAY_YLEN])
{
int?i?=?0;
int?j?=?0;

for(i?=?0;?i? printf(“?%d?“?i);
printf(“\n\n“);
for(j?=?0;?j? {
for(i?=?0;?i? {
if(!IsUnionClear(&ucUnionArray[i][j]))
printf(“?%c?“?ucUnionArray[i][j].type);
else
pr

評論

共有 條評論