部分图片未上传
![](/Images/OutliningIndicators/ExpandedBlockStart.gif) /**//*天宇软件
作者:上海黑暗之龙
2002/10/30
麻将原代码*/
#include "dos.h"
#include "stdio.h"
#include "graphics.h"
#include "bios.h"
#include "conio.h"
#include "stdlib.h"
unsigned char far *video_buffer=(char far *)0xA0000000L;
#define VGA256 0x13 /*图形模式13h*/
#define TEXT_MODE 0x03 /*普通文本模式*/
#define SETVGA Set_Video_Mode(VGA256)
#define OUTVGA Set_Video_Mode(TEXT_MODE)
#define BYTE unsigned char
#define WORD unsigned int
#define DWORD unsigned int
#define ESC 283
#define LEFT 19200
#define RIGHT 19712
#define H 9064
#define ENTER 7181
unsigned long int z=54400,zz=0,zy=0,zyy=0,z1=0,zl=10140;
int key=0,keyy=0,sing=0,sing1=0,second=0,threes=0;
struct chi
![](/Images/OutliningIndicators/ExpandedBlockStart.gif) ![](/Images/OutliningIndicators/ContractedBlock.gif) {
int lg;
int lgg;
}ch[13];
struct mj
![](/Images/OutliningIndicators/ExpandedBlockStart.gif) ![](/Images/OutliningIndicators/ContractedBlock.gif) { char *name; /**//*名字*/
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) int data1; /**//*是否已出,无用了*/
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) int data2; /**//*是否在手中,1为自己,2为对方*/
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) int number; /**//*同一个花色的第几张,共4张*/
![](/Images/OutliningIndicators/ExpandedBlockStart.gif) }m[136]= {"1.bmp",0,0,1,"1.bmp",0,0,2,"1.bmp",0,0,3,"1.bmp",0,0,4,"2.bmp",0,0,1,
"2.bmp",0,0,2,"2.bmp",0,0,3,"2.bmp",0,0,4,"3.bmp",0,0,1,"3.bmp",0,0,2,
"3.bmp",0,0,3,"3.bmp",0,0,4,"4.bmp",0,0,1,"4.bmp",0,0,2,"4.bmp",0,0,3,
"4.bmp",0,0,4,"5.bmp",0,0,1,"5.bmp",0,0,2,"5.bmp",0,0,3,"5.bmp",0,0,4,
"6.bmp",0,0,1,"6.bmp",0,0,2,"6.bmp",0,0,3,"6.bmp",0,0,4,"7.bmp",0,0,1,
"7.bmp",0,0,2,"7.bmp",0,0,3,"7.bmp",0,0,4,"8.bmp",0,0,1,"8.bmp",0,0,2,
"8.bmp",0,0,3,"8.bmp",0,0,4,"9.bmp",0,0,1,"9.bmp",0,0,2,"9.bmp",0,0,3,
"9.bmp",0,0,4,"10.bmp",0,0,1,"10.bmp",0,0,2,"10.bmp",0,0,3,"10.bmp",0,0,4,
"11.bmp",0,0,1,"11.bmp",0,0,2,"11.bmp",0,0,3,"11.bmp",0,0,4,"12.bmp",0,0,1,
"12.bmp",0,0,2,"12.bmp",0,0,3,"12.bmp",0,0,4,"13.bmp",0,0,1,"13.bmp",0,0,2,
"13.bmp",0,0,3,"13.bmp",0,0,4,"14.bmp",0,0,1,"14.bmp",0,0,2,"14.bmp",0,0,3,
"14.bmp",0,0,4,"15.bmp",0,0,1,"15.bmp",0,0,2,"15.bmp",0,0,3,"15.bmp",0,0,4,
"16.bmp",0,0,1,"16.bmp",0,0,2,"16.bmp",0,0,3,"16.bmp",0,0,4,"17.bmp",0,0,1,
"17.bmp",0,0,2,"17.bmp",0,0,3,"17.bmp",0,0,4,"18.bmp",0,0,1,"18.bmp",0,0,2,
"18.bmp",0,0,3,"18.bmp",0,0,4,"19.bmp",0,0,1,"19.bmp",0,0,2,"19.bmp",0,0,3,
"19.bmp",0,0,4,"20.bmp",0,0,1,"20.bmp",0,0,2,"20.bmp",0,0,3,"20.bmp",0,0,4,
"21.bmp",0,0,1,"21.bmp",0,0,2,"21.bmp",0,0,3,"21.bmp",0,0,4,"22.bmp",0,0,1,
"22.bmp",0,0,2,"22.bmp",0,0,3,"22.bmp",0,0,4,"23.bmp",0,0,1,"23.bmp",0,0,2,
"23.bmp",0,0,3,"23.bmp",0,0,4,"24.bmp",0,0,1,"24.bmp",0,0,2,"24.bmp",0,0,3,
"24.bmp",0,0,4,"25.bmp",0,0,1,"25.bmp",0,0,2,"25.bmp",0,0,3,"25.bmp",0,0,4,
"26.bmp",0,0,1,"26.bmp",0,0,2,"26.bmp",0,0,3,"26.bmp",0,0,4,"27.bmp",0,0,1,
"27.bmp",0,0,2,"27.bmp",0,0,3,"27.bmp",0,0,4,"28.bmp",0,0,1,"28.bmp",0,0,2,
"28.bmp",0,0,3,"28.bmp",0,0,4,"29.bmp",0,0,1,"29.bmp",0,0,2,"29.bmp",0,0,3,
"29.bmp",0,0,4,"30.bmp",0,0,1,"30.bmp",0,0,2,"30.bmp",0,0,3,"30.bmp",0,0,4,
"31.bmp",0,0,1,"31.bmp",0,0,2,"31.bmp",0,0,3,"31.bmp",0,0,4,"32.bmp",0,0,1,
"32.bmp",0,0,2,"32.bmp",0,0,3,"32.bmp",0,0,4,"33.bmp",0,0,1,"33.bmp",0,0,2,
"33.bmp",0,0,3,"33.bmp",0,0,4,"34.bmp",0,0,1,"34.bmp",0,0,2,"34.bmp",0,0,3,
"34.bmp"};
struct every
![](/Images/OutliningIndicators/ExpandedBlockStart.gif) ![](/Images/OutliningIndicators/ContractedBlock.gif) { int *k; /**//*名字*/
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) int oneorfour; /**//*同一张牌的第几张*/
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) int number; /**//*第几张牌136*/
int p;
int g;
int c;
int d[2];
};
struct me
![](/Images/OutliningIndicators/ExpandedBlockStart.gif) ![](/Images/OutliningIndicators/ContractedBlock.gif) { int m; /**//*定义有几张牌,开始有13张随着游戏的进行,会越来越小*/
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) int p; /**//*乓对方*/
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) int c; /**//*吃对方*/
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) int g; /**//*杠*/
![](/Images/OutliningIndicators/InBlock.gif)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) struct every pp[14]; /**//*存放手上的牌*/
}me;
struct computer
![](/Images/OutliningIndicators/ExpandedBlockStart.gif) ![](/Images/OutliningIndicators/ContractedBlock.gif) { int m;
int p;
int c;
int g;
struct every pp[14];
}computer,comp;
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/ExpandedBlockStart.gif) /**//* 设置调色板 */
void Set_Palette(int Color,BYTE r,BYTE g,BYTE b)
![](/Images/OutliningIndicators/ExpandedBlockStart.gif) ![](/Images/OutliningIndicators/ContractedBlock.gif) {
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) outportb(0x3c8,Color); /**//*0x3c8写端口 写色号*/
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) outportb(0x3c9,r); /**//*0x3c9数据端口 R、G、B的比例*/
outportb(0x3c9,g);
outportb(0x3c9,b);
}
![](/Images/OutliningIndicators/ExpandedBlockStart.gif) /**//*0x3c7读端口 0x3c6计算机调色板寄存器调用端口*/
![](/Images/OutliningIndicators/ExpandedBlockStart.gif) /**//* 设置显示模式的函数 */
void Set_Video_Mode(int mode)
![](/Images/OutliningIndicators/ExpandedBlockStart.gif) ![](/Images/OutliningIndicators/ContractedBlock.gif) {
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) union REGS inregs,outregs; /**//*定义输入和返回寄存器*/
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) inregs.h.ah=0; /**//*ah存放功能号0h表示进入视频模式*/
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) inregs.h.al=(unsigned char)mode; /**//*al存放要设定的视频模式*/
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) int86(0x10,&inregs,&outregs); /**//*通过10h中断设定显示模式int86()包含在dos.h*/
}
void v_line(int y0,int y1,int x,unsigned int color)
![](/Images/OutliningIndicators/ExpandedBlockStart.gif) ![](/Images/OutliningIndicators/ContractedBlock.gif) { unsigned int address,n,temp;
if(y0>y1)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
temp=y1;
y1=y0;
y0=temp;
}
address=320*y0+x;
for(n=0;n<=y1-y0;n++)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
video_buffer[address]=color;
address+=320;
}
}
void h_line(int x0,int x1,int y,unsigned int color)
![](/Images/OutliningIndicators/ExpandedBlockStart.gif) ![](/Images/OutliningIndicators/ContractedBlock.gif) { unsigned int address,n,temp;
if(x0>x1)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
temp=x1;
x1=x0;
x0=temp;
}
address=320*y+x0;
for(n=0;n<=x1-x0;n++)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
video_buffer[address]=color;
address+=1;
}
}
void p_pixel(int x,int y,unsigned int color)
![](/Images/OutliningIndicators/ExpandedBlockStart.gif) ![](/Images/OutliningIndicators/ContractedBlock.gif) { video_buffer[y*320+x]=color;
}
void s_square(int x,int y,int side,int color)
![](/Images/OutliningIndicators/ExpandedBlockStart.gif) ![](/Images/OutliningIndicators/ContractedBlock.gif) {
h_line(x,x+side,y,color);
h_line(x,x+side,y+side,color);
v_line(y,y+side,x,color);
v_line(y,y+side,x+side,color);
}
void r_rectangle(int x1,int y1,int x2,int y2,int color)
![](/Images/OutliningIndicators/ExpandedBlockStart.gif) ![](/Images/OutliningIndicators/ContractedBlock.gif) {
h_line(x1,x2,y1,color);
h_line(x1,x2,y2,color);
v_line(y1,y2,x1,color);
v_line(y1,y2,x2,color);
}
void fillRectangle(int x1,int y1,int x2,int y2,int color)
![](/Images/OutliningIndicators/ExpandedBlockStart.gif) ![](/Images/OutliningIndicators/ContractedBlock.gif) {
int i;
for(i=y1;i<=y2;i++)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
h_line(x1,x2,i,color);
}
}
void showbmp(int l)
![](/Images/OutliningIndicators/ExpandedBlockStart.gif) ![](/Images/OutliningIndicators/ContractedBlock.gif) { FILE *bmp;
int i,x,y;
BYTE palette[256][3];
bmp=fopen(me.pp[l].k,"rb");
fseek(bmp,54,SEEK_SET);
for(i=0;i<256;i++)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
palette[i][2]=fgetc(bmp)>>2;
palette[i][1]=fgetc(bmp)>>2;
palette[i][0]=fgetc(bmp)>>2;
fgetc(bmp);
Set_Palette(i,palette[i][0],palette[i][1],palette[i][2]);
}
for (y=0;y<30;y++)
for(x=0;x<20;x++)
pokeb(0xa000,y*320+x+z+zz+z1,fgetc(bmp));
fclose(bmp);
}
void showbmpd(int l)
![](/Images/OutliningIndicators/ExpandedBlockStart.gif) ![](/Images/OutliningIndicators/ContractedBlock.gif) { FILE *bmp;
int i,x,y;
BYTE palette[256][3];
bmp=fopen(me.pp[l].k,"rb");
fseek(bmp,54,SEEK_SET);
for(i=0;i<256;i++)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
palette[i][2]=fgetc(bmp)>>2;
palette[i][1]=fgetc(bmp)>>2;
palette[i][0]=fgetc(bmp)>>2;
fgetc(bmp);
Set_Palette(i,palette[i][0],palette[i][1],palette[i][2]);
}
for (y=0;y<30;y++)
for(x=0;x<20;x++)
pokeb(0xa000,y*320+x+zyy,fgetc(bmp));
fclose(bmp);
}
void showybmp(int ll)
![](/Images/OutliningIndicators/ExpandedBlockStart.gif) ![](/Images/OutliningIndicators/ContractedBlock.gif) { FILE *bmp;
int i,x,y;
BYTE palette[256][3];
bmp=fopen(computer.pp[ll].k,"rb");
fseek(bmp,54,SEEK_SET);
for(i=0;i<256;i++)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
palette[i][2]=fgetc(bmp)>>2;
palette[i][1]=fgetc(bmp)>>2;
palette[i][0]=fgetc(bmp)>>2;
fgetc(bmp);
Set_Palette(i,palette[i][0],palette[i][1],palette[i][2]);
}
for (y=0;y<30;y++)
for(x=0;x<20;x++)
pokeb(0xa000,y*320+x+zy,fgetc(bmp));
fclose(bmp);
}
void showcbmp(int ll)
![](/Images/OutliningIndicators/ExpandedBlockStart.gif) ![](/Images/OutliningIndicators/ContractedBlock.gif) { FILE *bmp;
int i,x,y;
BYTE palette[256][3];
bmp=fopen(computer.pp[ll].k,"rb");
fseek(bmp,54,SEEK_SET);
for(i=0;i<256;i++)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
palette[i][2]=fgetc(bmp)>>2;
palette[i][1]=fgetc(bmp)>>2;
palette[i][0]=fgetc(bmp)>>2;
fgetc(bmp);
Set_Palette(i,palette[i][0],palette[i][1],palette[i][2]);
}
for (y=0;y<30;y++)
for(x=0;x<20;x++)
pokeb(0xa000,y*320+x+zyy,fgetc(bmp));
fclose(bmp);
}
void bmpp(int number)
![](/Images/OutliningIndicators/ExpandedBlockStart.gif) ![](/Images/OutliningIndicators/ContractedBlock.gif) { FILE *bmp;
int i,x,y;
BYTE palette[256][3];
bmp=fopen(m[number].name,"rb");
fseek(bmp,54,SEEK_SET);
for(i=0;i<256;i++)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
palette[i][2]=fgetc(bmp)>>2;
palette[i][1]=fgetc(bmp)>>2;
palette[i][0]=fgetc(bmp)>>2;
fgetc(bmp);
Set_Palette(i,palette[i][0],palette[i][1],palette[i][2]);
}
for (y=0;y<30;y++)
for(x=0;x<20;x++)
pokeb(0xa000,y*320+x+zl,fgetc(bmp));
fclose(bmp);
}
![](/Images/OutliningIndicators/ExpandedBlockStart.gif) void comlipai() /**//*整理电脑的牌*/
![](/Images/OutliningIndicators/ExpandedBlockStart.gif) ![](/Images/OutliningIndicators/ContractedBlock.gif) { int n,j,u;
int *lingshi;
for(n=0;n<computer.m;n++)
for(j=n;j<computer.m;j++)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
if(computer.pp[n].number>computer.pp[j+1].number)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
lingshi=computer.pp[n].k;
computer.pp[n].k=computer.pp[j+1].k;
computer.pp[j+1].k=lingshi;
u=computer.pp[n].oneorfour;
computer.pp[n].oneorfour=computer.pp[j+1].oneorfour;
computer.pp[j+1].oneorfour=u;
u=computer.pp[n].number;
computer.pp[n].number=computer.pp[j+1].number;
computer.pp[j+1].number=u;
}
else
if(computer.pp[n].number==computer.pp[j+1].number)
if(computer.pp[n].oneorfour>computer.pp[j+1].oneorfour)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
lingshi=computer.pp[n].k;
computer.pp[n].k=computer.pp[j+1].k;
computer.pp[j+1].k=lingshi;
u=computer.pp[n].oneorfour;
computer.pp[n].oneorfour=computer.pp[j+1].oneorfour;
computer.pp[j+1].oneorfour=u;
u=computer.pp[n].number;
computer.pp[n].number=computer.pp[j+1].number;
computer.pp[j+1].number=u;
}
}
}
void melipai()
![](/Images/OutliningIndicators/ExpandedBlockStart.gif) ![](/Images/OutliningIndicators/ContractedBlock.gif) { int n,j,u;
int *lingshi;
for(n=0;n<me.m;n++)
for(j=n;j<me.m;j++)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
if(me.pp[n].number>me.pp[j+1].number)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
lingshi=me.pp[n].k;
me.pp[n].k=me.pp[j+1].k;
me.pp[j+1].k=lingshi;
u=me.pp[n].oneorfour;
me.pp[n].oneorfour=me.pp[j+1].oneorfour;
me.pp[j+1].oneorfour=u;
u=me.pp[n].number;
me.pp[n].number=me.pp[j+1].number;
me.pp[j+1].number=u;
}
else
if(me.pp[n].number==me.pp[j+1].number)
if(me.pp[n].oneorfour>me.pp[j+1].oneorfour)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
lingshi=me.pp[n].k;
me.pp[n].k=me.pp[j+1].k;
me.pp[j+1].k=lingshi;
u=me.pp[n].oneorfour;
me.pp[n].oneorfour=me.pp[j+1].oneorfour;
me.pp[j+1].oneorfour=u;
u=me.pp[n].number;
me.pp[n].number=me.pp[j+1].number;
me.pp[j+1].number=u;
}
}
}
![](/Images/OutliningIndicators/ExpandedBlockStart.gif) void rgzn(int c) /**//*本程序涵数的核心针对电脑的牌*/
![](/Images/OutliningIndicators/ExpandedBlockStart.gif) ![](/Images/OutliningIndicators/ContractedBlock.gif) { int b=0,lg,lgg,logo,logoo,pg=0,gp=0,cs=0,f=0;
if(me.pp[c].number<=35 && me.pp[c].number>=0)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
logo=1;
if(me.pp[c].number<=3 && me.pp[c].number>=0)
logoo=1;
else if(me.pp[c].number<=7 && me.pp[c].number>=4)
logoo=2;
else if(me.pp[c].number<=11 && me.pp[c].number>=8)
logoo=3;
else if(me.pp[c].number<=15 && me.pp[c].number>=12)
logoo=4;
else if(me.pp[c].number<=19 && me.pp[c].number>=16)
logoo=5;
else if(me.pp[c].number<=23 && me.pp[c].number>=20)
logoo=6;
else if(me.pp[c].number<=27 && me.pp[c].number>=24)
logoo=7;
else if(me.pp[c].number<=31 && me.pp[c].number>=28)
logoo=8;
else if(me.pp[c].number<=35 && me.pp[c].number>=32)
logoo=9;
}
else if(me.pp[c].number<=71 && me.pp[c].number>=36)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
logo=2;
if(me.pp[c].number<=39 && me.pp[c].number>=36)
logoo=1;
else if(me.pp[c].number<=43 && me.pp[c].number>=40)
logoo=2;
else if(me.pp[c].number<=47 && me.pp[c].number>=44)
logoo=3;
else if(me.pp[c].number<=51 && me.pp[c].number>=48)
logoo=4;
else if(me.pp[c].number<=55 && me.pp[c].number>=52)
logoo=5;
else if(me.pp[c].number<=59 && me.pp[c].number>=56)
logoo=6;
else if(me.pp[c].number<=63 && me.pp[c].number>=60)
logoo=7;
else if(me.pp[c].number<=67 && me.pp[c].number>=64)
logoo=8;
else if(me.pp[c].number<=71 && me.pp[c].number>=68)
logoo=9;
}
else if(me.pp[c].number<=107 && me.pp[c].number>=72)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
logo=3;
if(me.pp[c].number<=75 && me.pp[c].number>=72)
logoo=1;
else if(me.pp[c].number<=79 && me.pp[c].number>=76)
logoo=2;
else if(me.pp[c].number<=83 && me.pp[c].number>=80)
logoo=3;
else if(me.pp[c].number<=87 && me.pp[c].number>=84)
logoo=4;
else if(me.pp[c].number<=91 && me.pp[c].number>=88)
logoo=5;
else if(me.pp[c].number<=95 && me.pp[c].number>=92)
logoo=6;
else if(me.pp[c].number<=99 && me.pp[c].number>=96)
logoo=7;
else if(me.pp[c].number<=103 && me.pp[c].number>=100)
logoo=8;
else if(me.pp[c].number<=107 && me.pp[c].number>=104)
logoo=9;
}
else if(me.pp[c].number<=135 && me.pp[c].number>=108)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
logo=4;
if(me.pp[c].number<=111 && me.pp[c].number>=108)
logoo=1;
else if(me.pp[c].number<=115 && me.pp[c].number>=112)
logoo=2;
else if(me.pp[c].number<=119 && me.pp[c].number>=116)
logoo=3;
else if(me.pp[c].number<=123 && me.pp[c].number>=120)
logoo=4;
else if(me.pp[c].number<=127 && me.pp[c].number>=124)
logoo=5;
else if(me.pp[c].number<=131 && me.pp[c].number>=128)
logoo=6;
else if(me.pp[c].number<=135 && me.pp[c].number>=132)
logoo=7;
}
while(b<=computer.m)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) if(computer.pp[b].number<=35 && computer.pp[b].number>=0) /**//*假定电脑经过分析后出了第一张牌*/
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
lg=1;
computer.pp[b].d[0]=1;
if(computer.pp[b].number<=3 && computer.pp[b].number>=0)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
lgg=1;
computer.pp[b].d[1]=1;
}
else if(computer.pp[b].number<=7 && computer.pp[b].number>=4)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
lgg=2;
computer.pp[b].d[1]=2;
}
else if(computer.pp[b].number<=11 && computer.pp[b].number>=8)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
lgg=3;
computer.pp[b].d[1]=3;
}
else if(computer.pp[b].number<=15 && computer.pp[b].number>=12)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
lgg=4;
computer.pp[b].d[1]=4;
}
else if(computer.pp[b].number<=19 && computer.pp[b].number>=16)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
lgg=5;
computer.pp[b].d[1]=5;
}
else if(computer.pp[b].number<=23 && computer.pp[b].number>=20)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
lgg=6;
computer.pp[b].d[1]=6;
}
else if(computer.pp[b].number<=27 && computer.pp[b].number>=24)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
lgg=7;
computer.pp[b].d[1]=7;
}
else if(computer.pp[b].number<=31 && computer.pp[b].number>=28)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
lgg=8;
computer.pp[b].d[1]=8;
}
else if(computer.pp[b].number<=35 && computer.pp[b].number>=32)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
lgg=9;
computer.pp[b].d[1]=9;
}
}
else if(computer.pp[b].number<=71 && computer.pp[b].number>=36)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
lg=2;
computer.pp[b].d[0]=2;
if(computer.pp[b].number<=39 && computer.pp[b].number>=36)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
lgg=1;
computer.pp[b].d[1]=1;
}
else if(computer.pp[b].number<=43 && computer.pp[b].number>=40)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
lgg=2;
computer.pp[b].d[1]=2;
}
else if(computer.pp[b].number<=47 && computer.pp[b].number>=44)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
lgg=3;
computer.pp[b].d[1]=3;
}
else if(computer.pp[b].number<=51 && computer.pp[b].number>=48)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
lgg=4;
computer.pp[b].d[1]=4;
}
else if(computer.pp[b].number<=55 && computer.pp[b].number>=52)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
lgg=5;
computer.pp[b].d[1]=5;
}
else if(computer.pp[b].number<=59 && computer.pp[b].number>=56)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
lgg=6;
computer.pp[b].d[1]=6;
}
else if(computer.pp[b].number<=63 && computer.pp[b].number>=60)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
lgg=7;
computer.pp[b].d[1]=7;
}
else if(computer.pp[b].number<=67 && computer.pp[b].number>=64)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
lgg=8;
computer.pp[b].d[1]=8;
}
else if(computer.pp[b].number<=71 && computer.pp[b].number>=68)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
lgg=9;
computer.pp[b].d[1]=9;
}
}
else if(computer.pp[b].number<=107 && computer.pp[b].number>=72)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
lg=3;
computer.pp[b].d[0]=3;
if(computer.pp[b].number<=75 && computer.pp[b].number>=72)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
lgg=1;
computer.pp[b].d[1]=1;
}
else if(computer.pp[b].number<=79 && computer.pp[b].number>=76)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
lgg=2;
computer.pp[b].d[1]=2;
}
else if(computer.pp[b].number<=83 && computer.pp[b].number>=80)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
lgg=3;
computer.pp[b].d[1]=3;
}
else if(computer.pp[b].number<=87 && computer.pp[b].number>=84)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
lgg=4;
computer.pp[b].d[1]=4;
}
else if(computer.pp[b].number<=91 && computer.pp[b].number>=88)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
lgg=5;
computer.pp[b].d[1]=5;
}
else if(computer.pp[b].number<=95 && computer.pp[b].number>=92)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
lgg=6;
computer.pp[b].d[1]=6;
}
else if(computer.pp[b].number<=99 && computer.pp[b].number>=96)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
lgg=7;
computer.pp[b].d[1]=7;
}
else if(computer.pp[b].number<=103 && computer.pp[b].number>=100)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
lgg=8;
computer.pp[b].d[1]=8;
}
else if(computer.pp[b].number<=107 && computer.pp[b].number>=104)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
lgg=9;
computer.pp[b].d[1]=9;
}
}
else if(computer.pp[b].number<=135 && computer.pp[b].number>=108)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
lg=4;
computer.pp[b].d[0]=4;
if(computer.pp[b].number<=111 && computer.pp[b].number>=108)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
lgg=1;
computer.pp[b].d[1]=1;
}
else if(computer.pp[b].number<=115 && computer.pp[b].number>=112)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
lgg=2;
computer.pp[b].d[1]=2;
}
else if(computer.pp[b].number<=119 && computer.pp[b].number>=116)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
lgg=3;
computer.pp[b].d[1]=3;
}
else if(computer.pp[b].number<=123 && computer.pp[b].number>=120)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
lgg=4;
computer.pp[b].d[1]=4;
}
else if(computer.pp[b].number<=127 && computer.pp[b].number>=124)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
lgg=5;
computer.pp[b].d[1]=5;
}
else if(computer.pp[b].number<=131 && computer.pp[b].number>=128)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
lgg=6;
computer.pp[b].d[1]=6;
}
else if(computer.pp[b].number<=135 && computer.pp[b].number>=132)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
lgg=7;
computer.pp[b].d[1]=7;
}
}
![](/Images/OutliningIndicators/InBlock.gif)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) if(logo==lg) /**//*如果相等的话,那再进一步的判断,乓杠的判断*/
if(logoo==lgg)
pg++;
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ch[b].lg=lg; /**//*保存电脑手里的每张牌的信息*/
ch[b].lgg=lgg;
lg=0;
lgg=0;
b++;
}
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) if(pg==2) /**//*乓*/
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
![](/Images/OutliningIndicators/InBlock.gif)
sing=1;
b=computer.m;
while(b!=-1)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
if(strcmp(me.pp[c].k,computer.pp[b].k)==0)
computer.pp[b].p=1;
![](/Images/OutliningIndicators/InBlock.gif)
b--;
}
}
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) if(pg==3) /**//*杠*/
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
![](/Images/OutliningIndicators/InBlock.gif)
sing=2;
b=computer.m;
while(b!=-1)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
if(strcmp(me.pp[c].k,computer.pp[b].k)==0)
computer.pp[b].g=1;
b--;
}
}
f=0;
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) while(f<computer.m) /**//*吃的判断*/
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) { if(ch[f].lg==logo && ch[f].lg!=4)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) if(ch[f+1].lgg-ch[f].lgg==1) /**//*顺吃*/
if(ch[f].lgg-logoo==1)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
gp++;
computer.pp[f].c=1;
computer.pp[f+1].c=1;
}
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) if(ch[f].lgg-ch[f+1].lgg==-1) /**//*逆吃*/
if(ch[f+1].lgg-logoo==-1)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
gp++;
computer.pp[f].c=1;
computer.pp[f+1].c=1;
}
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) if(ch[f].lgg-logoo==-1) /**//*中吃*/
if(ch[f+1].lgg-logoo==1)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
gp++;
computer.pp[f].c=1;
computer.pp[f+1].c=1;
}
if(gp==1)
break;
}
f++;
}
if(gp==1)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {sing=7;
![](/Images/OutliningIndicators/InBlock.gif)
}
pg=0;
gp=0;
b=0;
}
![](/Images/OutliningIndicators/ExpandedBlockStart.gif) void rgznme(int c) /**//*本程序涵数的核心针对我的牌*/
![](/Images/OutliningIndicators/ExpandedBlockStart.gif) ![](/Images/OutliningIndicators/ContractedBlock.gif) { int b=0,lg,lgg,logo,logoo,pg=0,gp=0,cs=0,f=0;
if(computer.pp[c].number<=35 && computer.pp[c].number>=0)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
logo=1;
if(computer.pp[c].number<=3 && computer.pp[c].number>=0)
logoo=1;
else if(computer.pp[c].number<=7 && computer.pp[c].number>=4)
logoo=2;
else if(computer.pp[c].number<=11 && computer.pp[c].number>=8)
logoo=3;
else if(computer.pp[c].number<=15 && computer.pp[c].number>=12)
logoo=4;
else if(computer.pp[c].number<=19 && computer.pp[c].number>=16)
logoo=5;
else if(computer.pp[c].number<=23 && computer.pp[c].number>=20)
logoo=6;
else if(computer.pp[c].number<=27 && computer.pp[c].number>=24)
logoo=7;
else if(computer.pp[c].number<=31 && computer.pp[c].number>=28)
logoo=8;
else if(computer.pp[c].number<=35 && computer.pp[c].number>=32)
logoo=9;
}
else if(computer.pp[c].number<=71 && computer.pp[c].number>=36)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
logo=2;
if(computer.pp[c].number<=39 && computer.pp[c].number>=36)
logoo=1;
else if(computer.pp[c].number<=43 && computer.pp[c].number>=40)
logoo=2;
else if(computer.pp[c].number<=47 && computer.pp[c].number>=44)
logoo=3;
else if(computer.pp[c].number<=51 && computer.pp[c].number>=48)
logoo=4;
else if(computer.pp[c].number<=55 && computer.pp[c].number>=52)
logoo=5;
else if(computer.pp[c].number<=59 && computer.pp[c].number>=56)
logoo=6;
else if(computer.pp[c].number<=63 && computer.pp[c].number>=60)
logoo=7;
else if(computer.pp[c].number<=67 && computer.pp[c].number>=64)
logoo=8;
else if(computer.pp[c].number<=71 && computer.pp[c].number>=68)
logoo=9;
}
else if(computer.pp[c].number<=107 && computer.pp[c].number>=72)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
logo=3;
if(computer.pp[c].number<=75 && computer.pp[c].number>=72)
logoo=1;
else if(computer.pp[c].number<=79 && computer.pp[c].number>=76)
logoo=2;
else if(computer.pp[c].number<=83 && computer.pp[c].number>=80)
logoo=3;
else if(computer.pp[c].number<=87 && computer.pp[c].number>=84)
logoo=4;
else if(computer.pp[c].number<=91 && computer.pp[c].number>=88)
logoo=5;
else if(computer.pp[c].number<=95 && computer.pp[c].number>=92)
logoo=6;
else if(computer.pp[c].number<=99 && computer.pp[c].number>=96)
logoo=7;
else if(computer.pp[c].number<=103 && computer.pp[c].number>=100)
logoo=8;
else if(computer.pp[c].number<=107 && computer.pp[c].number>=104)
logoo=9;
}
else if(computer.pp[c].number<=135 && computer.pp[c].number>=108)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
logo=4;
if(computer.pp[c].number<=111 && computer.pp[c].number>=108)
logoo=1;
else if(computer.pp[c].number<=115 && computer.pp[c].number>=112)
logoo=2;
else if(computer.pp[c].number<=119 && computer.pp[c].number>=116)
logoo=3;
else if(computer.pp[c].number<=123 && computer.pp[c].number>=120)
logoo=4;
else if(computer.pp[c].number<=127 && computer.pp[c].number>=124)
logoo=5;
else if(computer.pp[c].number<=131 && computer.pp[c].number>=128)
logoo=6;
else if(computer.pp[c].number<=135 && computer.pp[c].number>=132)
logoo=7;
}
while(b<=me.m)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) if(me.pp[b].number<=35 && me.pp[b].number>=0) /**//*我分析后出了第一张牌*/
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
lg=1;
me.pp[b].d[0]=1;
if(me.pp[b].number<=3 && me.pp[b].number>=0)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
lgg=1;
me.pp[b].d[1]=1;
}
else if(me.pp[b].number<=7 && me.pp[b].number>=4)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
lgg=2;
me.pp[b].d[1]=2;
}
else if(me.pp[b].number<=11 && me.pp[b].number>=8)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
lgg=3;
me.pp[b].d[1]=3;
}
else if(me.pp[b].number<=15 && me.pp[b].number>=12)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
lgg=4;
me.pp[b].d[1]=4;
}
else if(me.pp[b].number<=19 && me.pp[b].number>=16)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
lgg=5;
me.pp[b].d[1]=5;
}
else if(me.pp[b].number<=23 && me.pp[b].number>=20)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
lgg=6;
me.pp[b].d[1]=6;
}
else if(me.pp[b].number<=27 && me.pp[b].number>=24)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
lgg=7;
me.pp[b].d[1]=7;
}
else if(me.pp[b].number<=31 && me.pp[b].number>=28)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
lgg=8;
me.pp[b].d[1]=8;
}
else if(me.pp[b].number<=35 && me.pp[b].number>=32)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
lgg=9;
me.pp[b].d[1]=9;
}
}
else if(me.pp[b].number<=71 && me.pp[b].number>=36)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
lg=2;
me.pp[b].d[0]=2;
if(me.pp[b].number<=39 && me.pp[b].number>=36)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
lgg=1;
me.pp[b].d[1]=1;
}
else if(me.pp[b].number<=43 && me.pp[b].number>=40)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
lgg=2;
me.pp[b].d[1]=2;
}
else if(me.pp[b].number<=47 && me.pp[b].number>=44)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
lgg=3;
me.pp[b].d[1]=3;
}
else if(me.pp[b].number<=51 && me.pp[b].number>=48)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
lgg=4;
me.pp[b].d[1]=4;
}
else if(me.pp[b].number<=55 && me.pp[b].number>=52)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
lgg=5;
me.pp[b].d[1]=5;
}
else if(me.pp[b].number<=59 && me.pp[b].number>=56)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
lgg=6;
me.pp[b].d[1]=6;
}
else if(me.pp[b].number<=63 && me.pp[b].number>=60)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
lgg=7;
me.pp[b].d[1]=7;
}
else if(me.pp[b].number<=67 && me.pp[b].number>=64)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
lgg=8;
me.pp[b].d[1]=8;
}
else if(me.pp[b].number<=71 && me.pp[b].number>=68)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
lgg=9;
me.pp[b].d[1]=9;
}
}
else if(me.pp[b].number<=107 && me.pp[b].number>=72)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
lg=3;
me.pp[b].d[0]=3;
if(me.pp[b].number<=75 && me.pp[b].number>=72)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
lgg=1;
me.pp[b].d[1]=1;
}
else if(me.pp[b].number<=79 && me.pp[b].number>=76)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
lgg=2;
me.pp[b].d[1]=2;
}
else if(me.pp[b].number<=83 && me.pp[b].number>=80)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
lgg=3;
me.pp[b].d[1]=3;
}
else if(me.pp[b].number<=87 && me.pp[b].number>=84)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
lgg=4;
me.pp[b].d[1]=4;
}
else if(me.pp[b].number<=91 && me.pp[b].number>=88)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
lgg=5;
me.pp[b].d[1]=5;
}
else if(me.pp[b].number<=95 && me.pp[b].number>=92)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
lgg=6;
me.pp[b].d[1]=6;
}
else if(me.pp[b].number<=99 && me.pp[b].number>=96)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
lgg=7;
me.pp[b].d[1]=7;
}
else if(me.pp[b].number<=103 && me.pp[b].number>=100)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
lgg=8;
me.pp[b].d[1]=8;
}
else if(me.pp[b].number<=107 && me.pp[b].number>=104)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
lgg=9;
me.pp[b].d[1]=9;
}
}
else if(me.pp[b].number<=135 && me.pp[b].number>=108)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
lg=4;
me.pp[b].d[0]=4;
if(me.pp[b].number<=111 && me.pp[b].number>=108)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
lgg=1;
me.pp[b].d[1]=1;
}
else if(me.pp[b].number<=115 && me.pp[b].number>=112)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
lgg=2;
me.pp[b].d[1]=2;
}
else if(me.pp[b].number<=119 && me.pp[b].number>=116)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
lgg=3;
me.pp[b].d[1]=3;
}
else if(me.pp[b].number<=123 && me.pp[b].number>=120)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
lgg=4;
me.pp[b].d[1]=4;
}
else if(me.pp[b].number<=127 && me.pp[b].number>=124)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
lgg=5;
me.pp[b].d[1]=5;
}
else if(me.pp[b].number<=131 && me.pp[b].number>=128)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
lgg=6;
me.pp[b].d[1]=6;
}
else if(me.pp[b].number<=135 && me.pp[b].number>=132)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
lgg=7;
me.pp[b].d[1]=7;
}
}
}
}
void istwo(testt)
int testt[];
![](/Images/OutliningIndicators/ExpandedBlockStart.gif) ![](/Images/OutliningIndicators/ContractedBlock.gif) { if(testt[0]==testt[1])
second++;
}
void isthree(testt,n)
int testt[],n=0;
![](/Images/OutliningIndicators/ExpandedBlockStart.gif) ![](/Images/OutliningIndicators/ContractedBlock.gif) { int i,j,flage=0,lianx=0,same=0;
n=n/3;
for(j=0;j<n;j++)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
for(i=j*3;i<2+j*3;i++)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
if(testt[i]==testt[i+1])
same++;
if(testt[i+1]-testt[i]==1)
lianx++;
}
if(same==2)
threes++;
if(lianx==2)
threes++;
same=0;
lianx=0;
}
}
![](/Images/OutliningIndicators/ExpandedBlockStart.gif) void panduan() /**//*本程序的精髓*/
![](/Images/OutliningIndicators/ExpandedBlockStart.gif) ![](/Images/OutliningIndicators/ContractedBlock.gif) {int data[14];
int pw[14];
int pt[14];
int pi[14];
int pf[14];
int test[12];
int jj,w,mm,nn,tpp=0,lp=0,ww=0,tt=0,ii=0,ff=0;ill=0;
for(jj=0;jj<=me.m;jj++)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
if(me.pp[jj].d[0]==1)
data[jj]=me.pp[jj].d[1];
if(me.pp[jj].d[0]==2)
data[jj]=me.pp[jj].d[1]+10;
if(me.pp[jj].d[0]==3)
data[jj]=me.pp[jj].d[1]+20;
if(me.pp[jj].d[0]==4)
data[jj]=me.pp[jj].d[1]+30;
}
if(logo==2)
w=logoo+10;
if(logo==3)
w=logoo+20;
if(logo==4)
w=logoo+30;
data[computer.m+1]=w;
for(mm=0;mm<=computer.m;mm++)
for(nn=mm;nn<=computer.m;nn++)
if(data[mm]>data[nn+1])
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
tpp=data[mm];
data[mm]=data[nn+1];
data[nn+1]=tpp;
}
lp=0;
while(lp<=computer.m)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) { if(data[lp]<10)
pw[ww++]=data[lp];
if(data[lp]>10 && data[lp]<20)
pt[tt++]=data[lp];
if(data[lp]>20 && data[lp]<30)
pi[ii++]=data[lp];
if(data[lp]>30 && data[lp]<38)
pf[ff++]=data[lp];
lp++;
}
if(ww==2)
istwo(pw);
else if(ww==3)
isthree(pw,ww);
else if(ww==5)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) /**//*pw[5]原始牌数组,假设已经升序排列*/
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) /**//*test[3]用来放置测试牌的数组*/
for(i=0;i<4;i++)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
for(j=0;j<2;j++)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {test[j]=pw[i+j];
}
if(istwo(test))
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) { ill=0;
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) for(kl=0;kl<5;kl++) /**//*把不在test数组中的三张放到test数组中*/
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {if(kl==i)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
kl=kl+2;
if(kl==5)
break;
}
test[ill++]=pw[kl];
}
isthree(test);
}
}
else if(ww==6)
isthree(pw,ww);
else if(ww==8)
for(i=0;i<7;i++)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
for(j=0;j<2;j++)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {test[j]=pw[i+j];
}
if(istwo(test))
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) { ill=0;
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) for(kl=0;kl<8;kl++) /**//*把不在test数组中的六张放到test数组中*/
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {if(kl==i)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
kl=kl+2;
if(kl==8)
break;
}
test[ill++]=pw[kl];
}
isthree(test,ww-2);
}
}
else if(ww==9)
isthree(pw,ww);
else if(ww==11)
for(i=0;i<10;i++)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
for(j=0;j<2;j++)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {test[j]=pw[i+j];
}
if(istwo(test))
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) { ill=0;
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) for(kl=0;kl<11;kl++) /**//*把不在test数组中的九张放到test数组中*/
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {if(kl==i)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
kl=kl+2;
if(kl==11)
break;
}
test[ill++]=pw[kl];
}
isthree(test,ww-2);
}
}
else if(ww=12)
isthree(pw,ww);
else if(ww=14)
for(i=0;i<13;i++)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
for(j=0;j<2;j++)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {test[j]=pw[i+j];
}
if(istwo(test))
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) { ill=0;
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) for(kl=0;kl<11;kl++) /**//*把不在test数组中的九张放到test数组中*/
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {if(kl==i)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
kl=kl+2;
if(kl==14)
break;
}
test[ill++]=pw[kl];
}
isthree(test,ww-2);
}
}
if(tt==2)
istwo(pt);
else if(tt==3)
isthree(pt,tt);
else if(tt==5)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) /**//*pt[5]原始牌数组,假设已经升序排列*/
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) /**//*test[3]用来放置测试牌的数组*/
for(i=0;i<4;i++)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
for(j=0;j<2;j++)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {test[j]=pt[i+j];
}
if(istwo(test))
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) { ill=0;
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) for(kl=0;kl<5;kl++) /**//*把不在test数组中的三张放到test数组中*/
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {if(kl==i)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
kl=kl+2;
if(kl==5)
break;
}
test[ill++]=pt[kl];
}
isthree(test);
}
}
else if(tt==6)
isthree(pt,tt);
else if(tt==8)
for(i=0;i<7;i++)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
for(j=0;j<2;j++)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {test[j]=pt[i+j];
}
if(istwo(test))
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) { ill=0;
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) for(kl=0;kl<8;kl++) /**//*把不在test数组中的六张放到test数组中*/
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {if(kl==i)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
kl=kl+2;
if(kl==8)
break;
}
test[ill++]=pt[kl];
}
isthree(test,tt-2);
}
}
else if(tt==9)
isthree(pt,tt);
else if(tt==11)
for(i=0;i<10;i++)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
for(j=0;j<2;j++)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {test[j]=pt[i+j];
}
if(istwo(test))
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) { ill=0;
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) for(kl=0;kl<11;kl++) /**//*把不在test数组中的九张放到test数组中*/
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {if(kl==i)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
kl=kl+2;
if(kl==11)
break;
}
test[ill++]=pt[kl];
}
isthree(test,tt-2);
}
}
else if(tt=12)
isthree(pt,tt);
else if(tt=14)
for(i=0;i<13;i++)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
for(j=0;j<2;j++)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {test[j]=pt[i+j];
}
if(istwo(test))
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) { ill=0;
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) for(kl=0;kl<11;kl++) /**//*把不在test数组中的九张放到test数组中*/
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {if(kl==i)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
kl=kl+2;
if(kl==14)
break;
}
test[ill++]=pt[kl];
}
isthree(test,tt-2);
}
}
if(ii==2)
istwo(pi);
else if(ii==3)
isthree(pi,ii);
else if(ii==5)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) /**//*pi[5]原始牌数组,假设已经升序排列*/
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) /**//*test[3]用来放置测试牌的数组*/
for(i=0;i<4;i++)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
for(j=0;j<2;j++)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {test[j]=pi[i+j];
}
if(istwo(test))
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) { ill=0;
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) for(kl=0;kl<5;kl++) /**//*把不在test数组中的三张放到test数组中*/
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {if(kl==i)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
kl=kl+2;
if(kl==5)
break;
}
test[ill++]=pw[kl];
}
isthree(test);
}
}
else if(ii==6)
isthree(pi,ii);
else if(ii==8)
for(i=0;i<7;i++)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
for(j=0;j<2;j++)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {test[j]=pi[i+j];
}
if(istwo(test))
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) { ill=0;
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) for(kl=0;kl<8;kl++) /**//*把不在test数组中的六张放到test数组中*/
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {if(kl==i)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
kl=kl+2;
if(kl==8)
break;
}
test[ill++]=pi[kl];
}
isthree(test,ii-2);
}
}
else if(ii==9)
isthree(pi,ii);
else if(ii==11)
for(i=0;i<10;i++)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
for(j=0;j<2;j++)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {test[j]=pi[i+j];
}
if(istwo(test))
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) { ill=0;
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) for(kl=0;kl<11;kl++) /**//*把不在test数组中的九张放到test数组中*/
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {if(kl==i)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
kl=kl+2;
if(kl==11)
break;
}
test[ill++]=pi[kl];
}
isthree(test,ii-2);
}
}
else if(ii=12)
isthree(pi,ii);
else if(ii=14)
for(i=0;i<13;i++)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
for(j=0;j<2;j++)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {test[j]=pi[i+j];
}
if(istwo(test))
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) { ill=0;
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) for(kl=0;kl<11;kl++) /**//*把不在test数组中的九张放到test数组中*/
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {if(kl==i)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
kl=kl+2;
if(kl==14)
break;
}
test[ill++]=pi[kl];
}
isthree(test,ii-2);
}
}
if(ff==2)
istwo(pf);
else if(ff==3)
isthree(pf,ff);
else if(ff==5)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) /**//*pf[5]原始牌数组,假设已经升序排列*/
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) /**//*test[3]用来放置测试牌的数组*/
for(i=0;i<4;i++)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
for(j=0;j<2;j++)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {test[j]=pf[i+j];
}
if(istwo(test))
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) { ill=0;
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) for(kl=0;kl<5;kl++) /**//*把不在test数组中的三张放到test数组中*/
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {if(kl==i)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
kl=kl+2;
if(kl==5)
break;
}
test[ill++]=pf[kl];
}
isthree(test);
}
}
else if(ff==6)
isthree(pf,ff);
else if(ff==8)
for(i=0;i<7;i++)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
for(j=0;j<2;j++)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {test[j]=pf[i+j];
}
if(istwo(test))
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) { ill=0;
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) for(kl=0;kl<8;kl++) /**//*把不在test数组中的六张放到test数组中*/
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {if(kl==i)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
kl=kl+2;
if(kl==8)
break;
}
test[ill++]=pf[kl];
}
isthree(test,ff-2);
}
}
else if(ff==9)
isthree(pw,ww);
else if(ff==11)
for(i=0;i<10;i++)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
for(j=0;j<2;j++)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {test[j]=pf[i+j];
}
if(istwo(test))
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) { ill=0;
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) for(kl=0;kl<11;kl++) /**//*把不在test数组中的九张放到test数组中*/
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {if(kl==i)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
kl=kl+2;
if(kl==11)
break;
}
test[ill++]=pf[kl];
}
isthree(test,ff-2);
}
}
else if(ff=12)
isthree(pf,ff);
else if(ff=14)
for(i=0;i<13;i++)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
for(j=0;j<2;j++)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {test[j]=pf[i+j];
}
if(istwo(test))
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) { ill=0;
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) for(kl=0;kl<11;kl++) /**//*把不在test数组中的九张放到test数组中*/
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {if(kl==i)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
kl=kl+2;
if(kl==14)
break;
}
test[ill++]=pf[kl];
}
isthree(test,ff-2);
}
}
}
void main(void)
![](/Images/OutliningIndicators/ExpandedBlockStart.gif) ![](/Images/OutliningIndicators/ContractedBlock.gif) {
FILE *bmp;
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) static char *name[2]= {"ff.bmp","logo.bmp"};
char *p;
int *lingshi;
int x,y,i,j,t=2,cont=13,temp,n=0,onetothirteen=13,oneorthirteen=13,l=0,ll=0,kk,u;
int every=0,w=0,x1,x2,y1,y2,every1=0;
int logo,lg,lgg,logoo,b=0,c=0,pg=0,h,h1,g=0,kkk,kkkk,r=0,d,o=0,dwei=0,dweig=0,dw[3],nn;
BYTE palette[256][3];
SETVGA;
getch();
while(t--)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
bmp=fopen(name[t],"rb");
fseek(bmp,54,SEEK_SET);
for(i=0;i<256;i++)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
palette[i][2]=fgetc(bmp)>>2;
palette[i][1]=fgetc(bmp)>>2;
palette[i][0]=fgetc(bmp)>>2;
fgetc(bmp);
Set_Palette(i,palette[i][0],palette[i][1],palette[i][2]);
}
for (y=0;y<200;y++)
for(x=0;x<320;x++)
pokeb(0xa000,y*320+x,fgetc(bmp));
fclose(bmp);
getch();
}
getch();
fillRectangle(0,0,320,200,0);
getch();
randomize();
me.m=onetothirteen;
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) while(me.m>0) /**//*先循环,给自己拿牌*/
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
![](/Images/OutliningIndicators/InBlock.gif)
temp=random(136);
if(m[temp].data2==0 && m[temp].data1==0)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) me.pp[n].k=m[temp].name; /**//*把136中之一的牌放到我的手上*/
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) me.pp[n].oneorfour=m[temp].number; /**//*判断同一个花色中的第几张*/
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) me.pp[n].number=temp; /**//*第几张,用来排序*/
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) m[temp].data2=1; /**//*判断牌是谁的*/
kk=1;
}
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) if(kk==0) /**//*判断如果又选择了,就从新再选*/
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
me.m++;
n--;
}
me.m--;
n++;
kk=0;
}
me.m=12;
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) melipai(); /**//*理牌*/
![](/Images/OutliningIndicators/InBlock.gif)
n=13;
while(l<n)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
z=z+20;
showbmp(l);
l++;
![](/Images/OutliningIndicators/InBlock.gif)
}
randomize();
computer.m=oneorthirteen;
n=0;
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) while(computer.m>0) /**//*循环,给对方拿牌*/
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
temp=random(136);
if(m[temp].data2==0 && m[temp].data1==0)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) computer.pp[n].k=m[temp].name; /**//*把136中之一的牌放到电脑的手上*/
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) computer.pp[n].oneorfour=m[temp].number; /**//*判断同一个花色中的第几张*/
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) computer.pp[n].number=temp; /**//*第几张,用来排序*/
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) m[temp].data2=2; /**//*判断牌是谁的,2为电脑*/
kk=1;
}
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) if(kk==0) /**//*判断如果又选择了,就从新再选*/
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
computer.m++;
n--;
}
computer.m--;
n++;
kk=0;
}
computer.m=12;
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) comlipai(); /**//*电脑理牌*/
n=13;
while(ll<n)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
zy=zy+20;
showybmp(ll);
ll++;
}
![](/Images/OutliningIndicators/InBlock.gif)
z=54400;
while(key!=ESC)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
![](/Images/OutliningIndicators/InBlock.gif)
keyy=bioskey(0);
if(keyy==LEFT)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) { w=1;
if(every==0)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
every=1;
z=54440-5*320;
![](/Images/OutliningIndicators/InBlock.gif)
}
zz=zz+5*320;
showbmp(every);
if(every==0)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
x1=20;
y1=165;
fillRectangle(x1,y1,x1+20,y1+4,0);
}
if(every==1)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
x1=40;
y1=165;
fillRectangle(x1,y1,x1+20,y1+4,0);
}
if(every==2)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
x1=60;
y1=165;
fillRectangle(x1,y1,x1+20,y1+4,0);
}
if(every==3)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
x1=80;
y1=165;
fillRectangle(x1,y1,x1+20,y1+4,0);
}
if(every==4)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
x1=100;
y1=165;
fillRectangle(x1,y1,x1+20,y1+4,0);
}
if(every==5)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
x1=120;
y1=165;
fillRectangle(x1,y1,x1+20,y1+4,0);
}
if(every==6)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
x1=140;
y1=165;
fillRectangle(x1,y1,x1+20,y1+4,0);
}
if(every==7)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
x1=160;
y1=165;
fillRectangle(x1,y1,x1+20,y1+4,0);
}
if(every==8)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
x1=180;
y1=165;
fillRectangle(x1,y1,x1+20,y1+4,0);
}
if(every==9)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
x1=200;
y1=165;
fillRectangle(x1,y1,x1+20,y1+4,0);
}
if(every==10)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
x1=220;
y1=165;
fillRectangle(x1,y1,x1+20,y1+4,0);
}
if(every==11)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
x1=240;
y1=165;
fillRectangle(x1,y1,x1+20,y1+4,0);
}
if(every==12)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
x1=260;
y1=165;
fillRectangle(x1,y1,x1+20,y1+4,0);
}
zz=0;
every--;
z=z-20;
}
if(keyy==RIGHT)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) { if(w==0)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
z=54440-5*320;
z=z-20;
w=1;
}
if(every==12)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
every=11;
z=54640-5*320;
}
zz=zz+5*320;
showbmp(every);
if(every==0)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
x1=20;
y1=165;
fillRectangle(x1,y1,x1+20,y1+4,0);
}
if(every==1)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
x1=40;
y1=165;
fillRectangle(x1,y1,x1+20,y1+4,0);
}
if(every==2)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
x1=60;
y1=165;
fillRectangle(x1,y1,x1+20,y1+4,0);
}
if(every==3)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
x1=80;
y1=165;
fillRectangle(x1,y1,x1+20,y1+4,0);
}
if(every==4)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
x1=100;
y1=165;
fillRectangle(x1,y1,x1+20,y1+4,0);
}
if(every==5)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
x1=120;
y1=165;
fillRectangle(x1,y1,x1+20,y1+4,0);
}
if(every==6)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
x1=140;
y1=165;
fillRectangle(x1,y1,x1+20,y1+4,0);
}
if(every==7)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
x1=160;
y1=165;
fillRectangle(x1,y1,x1+20,y1+4,0);
}
if(every==8)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
x1=180;
y1=165;
fillRectangle(x1,y1,x1+20,y1+4,0);
}
if(every==9)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
x1=200;
y1=165;
fillRectangle(x1,y1,x1+20,y1+4,0);
}
if(every==10)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
x1=220;
y1=165;
fillRectangle(x1,y1,x1+20,y1+4,0);
}
if(every==11)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif) ![](/Images/OutliningIndicators/ContractedSubBlock.gif) {
x1=240;
y1=165;
fillRectangle(x1
![](/Images/OutliningIndicators/InBlock.gif)
|