上海黑暗之龙--麻将原代码

2016-02-19 14:04 9 1 收藏

下面是个超简单的上海黑暗之龙--麻将原代码教程,图老师小编精心挑选推荐,大家行行好,多给几个赞吧,小编吐血跪求~

【 tulaoshi.com - 编程语言 】

部分图片未上传
  /*天宇软件
  作者:上海黑暗之龙
  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
   {
   int lg;
   int lgg;
   }ch[13];
   struct mj
   { char *name; /*名字*/
   int data1; /*是否已出,无用了*/
   int data2; /*是否在手中,1为自己,2为对方*/
   int number; /*同一个花色的第几张,共4张*/
   }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
   { int *k; /*名字*/
   int oneorfour; /*同一张牌的第几张*/
   int number; /*第几张牌136*/
   int p;
   int g;
   int c;
   int d[2];
   };
   struct me
   { int m; /*定义有几张牌,开始有13张随着游戏的进行,会越来越小*/
   int p; /*乓对方*/
   int c; /*吃对方*/
   int g; /*杠*/
  
   struct every pp[14]; /*存放手上的牌*/
   }me;
   struct computer
   { int m;
   int p;
   int c;
   int g;
   struct every pp[14];
   }computer,comp;
  
   /* 设置调色板 */
   void Set_Palette(int Color,BYTE r,BYTE g,BYTE b)
   {
   outportb(0x3c8,Color); /*0x3c8写端口 写色号*/
   outportb(0x3c9,r); /*0x3c9数据端口 R、G、B的比例*/
   outportb(0x3c9,g);
   outportb(0x3c9,b);
   }
   /*0x3c7读端口 0x3c6计算机调色板寄存器调用端口*/
   /* 设置显示模式的函数 */
   void Set_Video_Mode(int mode)
   {
   union REGS inregs,outregs; /*定义输入和返回寄存器*/
   inregs.h.ah=0; /*ah存放功能号0h表示进入视频模式*/
   inregs.h.al=(unsigned char)mode; /*al存放要设定的视频模式*/
   int86(0x10,&inregs,&outregs); /*通过10h中断设定显示模式int86()包含在dos.h*/
   }
   void v_line(int y0,int y1,int x,unsigned int color)
   { unsigned int address,n,temp;
   if(y0y1)
   {
   temp=y1;
   y1=y0;
   y0=temp;
   }
   address=320*y0+x;
   for(n=0;n=y1-y0;n++)
   {
   video_buffer[address]=color;
   address+=320;
   }
   }
   void h_line(int x0,int x1,int y,unsigned int color)
   { unsigned int address,n,temp;
   if(x0x1)
   {
   temp=x1;
   x1=x0;
   x0=temp;
   }
   address=320*y+x0;
   for(n=0;n=x1-x0;n++)
   {
  
  video_buffer[address]=color;
   address+=1;
   }
   }
   void p_pixel(int x,int y,unsigned int color)
   { video_buffer[y*320+x]=color;
   }
   void s_square(int x,int y,int side,int color)
   {
   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)
   {
   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)
   {
   int i;
   for(i=y1;i=y2;i++)
   {
   h_line(x1,x2,i,color);
   }
   }
   void showbmp(int l)
   { 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;i256;i++)
   {
   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;y30;y++)
   for(x=0;x20;x++)
   pokeb(0xa000,y*320+x+z+zz+z1,fgetc(bmp));
   fclose(bmp);
   }
   void showbmpd(int l)
   { 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;i256;i++)
   {
   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;y30;y++)
   for(x=0;x20;x++)
   pokeb(0xa000,y*320+x+zyy,fgetc(bmp));
   fclose(bmp);
   }
   void showybmp(int ll)
   { 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;i256;i++)
   {
   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]);
   }

来源:http://www.tulaoshi.com/n/20160219/1606112.html

延伸阅读
PSV《非常E麻将》隐藏福利攻略 每过一关可以撸的福利麻将游戏,撸完之后只见女生肤色泛红,也没有爆衣(有一种自己只是浴场搓背大叔的感觉) 每人通关后还有一张隐藏福利,分成16片,要花时间攻略,拼RP抽福利券. 以下是每关的胜利条件,之后上图. 朝霧ましろ(学生属性,天真派) ...
标签: 手机游戏 IOS
《时空猎人》攻略之龙影登场 《时空猎人》什么职业厉害?在6月18日时空猎人更新了新角色龙影后,毫无疑问作为刚出道的角色一般来说都是比较厉害的,而且这个角色还是属于收费角色,因此他的属性比应该会更高。 那么,除了新角色还有其他角色怎么样呢?下面图老师图老师小编就给他们简单介绍一下: 1、装备: 在游戏中,不同职业除了武器外...
标签: 网络游戏
《鹿鼎记》游戏致富之龙掘刷矿!   件:50级以上玩家并已经加入城市。 1、先去城市的工厂购买矿牌。 2.买了矿牌,大家可以前往龙掘了,在地图上找到没有开采的矿山。 3.点击矿山,使用矿牌,然后就可以开始开采了。 4.开采过程中会不断刷出怪物,玩家只需要击杀就可以了,职业经验好多的,不过注意自...
麻将席如果折的好,可以有效的延长牛筋与鱼线的使用寿命,也就延长了麻将席的使用寿命,而折的不好的话,会导致牛筋或鱼线断裂。所以在折叠麻将凉席时要注意,最好是按照原来的折叠顺序来折,不要自己随意乱折,而如果不记得原来的折叠顺序的可以参照以下的方法来折麻将席。 以1.8M大小的麻将席为例: 1.将麻将席铺在床上或平坦的地方,席面...
通宵麻将儿子坠亡 4月20日晚上,一名家住重庆九龙坡一小区的女子把年仅6岁的儿子彬彬一人反锁在家,去打通宵麻将。孩子可能是早上醒来后去幼儿园,门被反锁,想从阳台翻出去,最终酿成悲剧,从21楼阳台坠落身亡。女子第二天早上回家的时候,才知孩子出事。 长期打麻将的危害:易发胖 打麻将长期坐着不仅会使腿及腰部赘肉生长,而且还...

经验教程

146

收藏

15
微博分享 QQ分享 QQ空间 手机页面 收藏网站 回到头部