资源描述:
《C语言编写象棋软件源代码》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、/*--------------------chess.c----------------------*/#include"dos.h"#include"stdio.h"/*----------------------------------------------------*/#defineRED7#defineBLACK14#definetrue1#definefalse0#defineSELECT0#defineMOVE1#defineRED_UP0x1100#defineRED_DOWN0x1f00#defineRED_LEFT0x1e00#defineRED_R
2、IGHT0x2000#defineRED_DO0x3900#defineRED_UNDO0x1000#defineBLACK_UP0x4800#defineBLACK_DOWN0x5000#defineBLACK_LEFT0x4b00#defineBLACK_RIGHT0x4d00#defineBLACK_DO0x1c00#defineBLACK_UNDO0x2b00#defineESCAPE0x0100#defineRED_JU1#defineRED_MA2#defineRED_XIANG3#defineRED_SHI4#defineRED_JIANG5#defineRE
3、D_PAO6#defineRED_BIN7#defineBLACK_JU8#defineBLACK_MA9#defineBLACK_XIANG10#defineBLACK_SHI11#defineBLACK_JIANG12#defineBLACK_PAO13#defineBLACK_BIN14/*----------------------------------------------------*/intfirsttime=1;intsavemode;charpage_new=0,page_old=0;intfinish=false,turn=BLACK,winner=
4、0;intkey;intredstate=SELECT,blackstate=SELECT;intboard[10][9];/*----------------------------------------------------*/char*chessfile[15]={"","bmp\rju.wfb","bmp\rma.wfb","bmp\rxiang.wfb","bmp\rshi.wfb","bmp\rjiang.wfb","bmp\rpao.wfb","bmp\rbin.wfb","bmp\bju.wfb","bmp\bma.wfb","bmp
5、bxiang.wfb","bmp\bshi.wfb","bmp\bjiang.wfb","bmp\bpao.wfb","bmp\bbin.wfb"};char*boardfile[10][9]={{"bmp\11.wfb","bmp\1t.wfb","bmp\1t.wfb","bmp\14.wfb","bmp\15.wfb","bmp\16.wfb","bmp\1t.wfb","bmp\1t.wfb","bmp\19.wfb"},{"bmp\21.wfb","bmp\2c.wfb","bmp\2c.wfb","bmp\24.wfb","b
6、mp\25.wfb","bmp\26.wfb","bmp\2c.wfb","bmp\2c.wfb","bmp\29.wfb"},{"bmp\21.wfb","bmp\3a.wfb","bmp\3t.wfb","bmp\34.wfb","bmp\3t.wfb","bmp\36.wfb","bmp\3t.wfb","bmp\3a.wfb","bmp\29.wfb"},{"bmp\41.wfb","bmp\4t.wfb","bmp\4a.wfb","bmp\4t.wfb","bmp\4a.wfb","bmp\4t.wfb","bmp\4a
7、.wfb","bmp\4t.wfb","bmp\49.wfb"},{"bmp\51.wfb","bmp\52.wfb","bmp\5t.wfb","bmp\54.wfb","bmp\5t.wfb","bmp\56.wfb","bmp\5t.wfb","bmp\58.wfb","bmp\59.wfb"},{"bmp\61.wfb","bmp\62.wfb","bmp\6t.wfb","bmp\64.wfb","bmp\6t.wfb","bmp\66.wfb","bmp\6t.wfb