xxxx18一60岁hd中国/日韩女同互慰一区二区/西西人体扒开双腿无遮挡/日韩欧美黄色一级片 - 色护士精品影院www

資源簡(jiǎn)介

用c語(yǔ)言實(shí)現(xiàn)的連連看算法,對(duì)c語(yǔ)言基礎(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

評(píng)論

共有 條評(píng)論

相關(guān)資源