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

  • 大小: 9KB
    文件類型: .rar
    金幣: 2
    下載: 0 次
    發(fā)布日期: 2021-05-27
  • 語(yǔ)言: C/C++
  • 標(biāo)簽: 斗地主??c語(yǔ)言版??

資源簡(jiǎn)介

這是我剛學(xué)c語(yǔ)言時(shí)老師給我們的大作業(yè)--斗地主。 里面有簡(jiǎn)單的界面,AI,由于是初學(xué)時(shí)的作品,所以相當(dāng)?shù)暮?jiǎn)陋,不過(guò)對(duì)剛學(xué)c語(yǔ)言的朋友們還是有參考作用的

資源截圖

代碼片段和文件信息

/*?Note:Your?choice?is?C?IDE?*/

/****************************************************************
??查找牌中大于x的最小的單牌,返回該牌的大小,如未找到返回-1
*/
int?search_min_single(struct?card?*headint?x)
{
int?dou=0;
struct?card?*tmp1*tmp2*tmp3;
tmp1=tmp2=tmp3=(struct?card?*)malloc(sizeof(struct?card));
tmp1=head->next;
tmp2=tmp1->next;
tmp3=0;
do
{
if(tmp1->num==tmp2->num)
{
dou++;
}
else
{
if(dou==0)
{
if(tmp1->num>x)
tmp3=tmp1;
????}
else
{
dou=0;
}
}
tmp1=tmp2;
tmp2=tmp2->next;
}while(tmp1!=0);
if(tmp3==0)
return?-1;
else
return?tmp3->num;
}


/****************************************************************
???查找牌中大于xx的最小的牌如找到返回該牌第一張的大小,如未找到返回-1
*/
int?search_min_double(struct?card?*headint?x)
{
struct?card?*p1*p2*p3*p4*tmp;
p1=p2=p3=p4=tmp=(struct?card?*)malloc(sizeof(struct?card));
p1=head;
tmp=-1;
do
{
p2=p1->next;
????p3=p2->next;
????p4=p3->next;
????if(p1->num!=p2->num&&p2->num==p3->num&&p3->num!=p4->num)
????{
???? if(p2->num>x)
???? {
???? tmp=p2;
???? }
????}
????p1=p1->next;
}while(p4!=0);
if(tmp==-1)
return?-1;
else
return?tmp->num;
}

/****************************************************************
???查找牌中大于xxx的最小的牌如找到返回該牌第一張的大小,如未找到返回-1
*/
int?search_min_triangle(struct?card?*headint?x)
{
struct?card?*p1*p2*p3*p4*p5*tmp;
p1=p2=p3=p4=p5=tmp=(struct?card?*)malloc(sizeof(struct?card));
p1=head;
tmp=-1;
do
{
p2=p1->next;
????p3=p2->next;
????p4=p3->next;
????p5=p4->next;
????if(p1->num!=p2->num&&p2->num==p3->num&&p3->num==p4->num&&p4->num!=p5->num)
????{
???? if(p2->num>x)
???? {
???? tmp=p2;
???? }
????}
????p1=p1->next;
}while(p5!=0);
if(tmp==-1)
return?-1;
else
return?tmp->num;
}

/****************************************************************
???查找牌中大于xxxx的最小的牌并刪除,如成功,返回1,反之,返回0
*/
int?search_min_fourfold(struct?card?*headstruct?card?*tableint?x)
{
struct?card?*p1*p2*p3*p4*p5*p6*tmp;
p1=p2=p3=p4=p5=p6=tmp=(struct?card?*)malloc(sizeof(struct?card));
p1=head;
tmp=-1;
do
{
p2=p1->next;
????p3=p2->next;
????p4=p3->next;
????p5=p4->next;
????p6=p5->next;
????if(p1->num!=p2->num&&p2->num==p3->num&&p3->num==p4->num&&p4->num==p5->num&&p5->num!=p6->num)
????{
???? if(p2->num>x)
???? {
???? tmp=p2;
???? }
????}
????p1=p1->next;
}while(p6!=0);
if(tmp==-1)
return?0;
else
{
p1=tmp->next;
p2=p1->next;
p3=p2->next;
p4=p3->next;
tmp->next=p4->next;
for(p5=table;p5->next!=0;p5=p5->next){}??/*將tmp3連接到table上去*/
p5->next=p1;
p5=p1;
p5->next=p2;
p5=p2;
p5->next=p3;
p5=p3;
p5->next=p4;
p4->next=0;
}
return?1;
}

/*****************************************************************
?查找牌中大小等于x的牌,如找到,返回改牌在鏈表中的序列號(hào),反之,返回-1
*/
int?search_value_equal_x(struct?card?*headint?x)
{
int?positioni;
struct?card?*tmp;
tmp=(struct?card?*)

?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----

?????文件??????17737??2008-01-03?18:08??斗地主\Ai.c

?????文件???????6087??2007-12-02?14:54??斗地主\ChuPai.c

?????文件???????9473??2008-01-09?08:22??斗地主\HuaPai.c

?????文件???????6096??2008-01-04?10:24??斗地主\main.c

?????目錄??????????0??2009-01-15?11:48??斗地主

-----------?---------??----------?-----??----

????????????????39393????????????????????5


評(píng)論

共有 條評(píng)論

相關(guān)資源