Word.h
上传用户:kf1822
上传日期:2021-06-02
资源大小:2156k
文件大小:9k
- #include <graphics.h>
- char shi32H[]={
- /* 以下是 '是' 的 32点阵黑体 字模,128 byte */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x01,0xFF,0xFF,0x80,0x01,0x80,0x01,0x80,
- 0x01,0x80,0x01,0x80,0x01,0x80,0x01,0x80,
- 0x01,0xFF,0xFF,0x80,0x01,0x80,0x01,0x80,
- 0x01,0x80,0x01,0x80,0x01,0x80,0x01,0x80,
- 0x01,0xFF,0xFF,0x80,0x01,0xFF,0xFF,0x80,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x1F,0xFF,0xFF,0xF8,0x1F,0xFF,0xFF,0xF8,
- 0x00,0x01,0x80,0x00,0x00,0x01,0x80,0x00,
- 0x00,0x01,0x80,0x00,0x00,0x81,0x80,0x00,
- 0x01,0x81,0xFF,0xC0,0x01,0x81,0x80,0x00,
- 0x01,0xC1,0x80,0x00,0x03,0x21,0x80,0x00,
- 0x02,0x19,0x80,0x00,0x06,0x07,0x80,0x00,
- 0x0C,0x01,0xFF,0xF8,0x18,0x00,0x0F,0xF8,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- };
- char jiu32H[]={
- /* 以下是 '就' 的 32点阵黑体 字模,128 byte */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,
- 0x00,0xC0,0x0C,0x00,0x00,0x40,0x0C,0x40,
- 0x00,0x00,0x0C,0x60,0x00,0x00,0x0C,0x30,
- 0x3F,0xFF,0x0C,0x00,0x00,0x00,0x0C,0x00,
- 0x00,0x00,0x0C,0x00,0x00,0x00,0x7F,0xFC,
- 0x0F,0xFC,0x0D,0x80,0x0F,0xFC,0x0D,0x80,
- 0x0C,0x04,0x09,0x80,0x0C,0x04,0x09,0x80,
- 0x0C,0x04,0x09,0x80,0x0F,0xFC,0x09,0x80,
- 0x0F,0xFC,0x09,0x80,0x00,0x40,0x19,0x80,
- 0x00,0x40,0x19,0x80,0x00,0x44,0x11,0x80,
- 0x04,0x44,0x11,0x80,0x0C,0x42,0x31,0x80,
- 0x08,0x42,0x21,0x80,0x18,0x40,0x61,0x80,
- 0x10,0x40,0x41,0x8C,0x00,0x40,0xC1,0x8C,
- 0x00,0x41,0x80,0xF8,0x01,0xC1,0x00,0x70,
- 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- };
- char xia32H[]={
- /* 以下是 '下' 的 32点阵黑体 字模,128 byte */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x3F,0xFF,0xFF,0xF8,
- 0x00,0x03,0x00,0x00,0x00,0x03,0x00,0x00,
- 0x00,0x03,0x00,0x00,0x00,0x03,0x00,0x00,
- 0x00,0x03,0x00,0x00,0x00,0x03,0x00,0x00,
- 0x00,0x03,0x00,0x00,0x00,0x03,0x1C,0x00,
- 0x00,0x03,0x0E,0x00,0x00,0x03,0x07,0x00,
- 0x00,0x03,0x03,0x80,0x00,0x03,0x01,0xC0,
- 0x00,0x03,0x00,0xE0,0x00,0x03,0x00,0x60,
- 0x00,0x03,0x00,0x40,0x00,0x03,0x00,0x00,
- 0x00,0x03,0x00,0x00,0x00,0x03,0x00,0x00,
- 0x00,0x03,0x00,0x00,0x00,0x03,0x00,0x00,
- 0x00,0x03,0x00,0x00,0x00,0x03,0x00,0x00,
- 0x00,0x03,0x00,0x00,0x00,0x03,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- };
- char yi32H[]={
- /* 以下是 '一' 的 32点阵黑体 字模,128 byte */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x1F,0xFF,0xFF,0xFC,
- 0x1F,0xFF,0xFF,0xFC,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- };
- char bai32H[]={
- /* 以下是 '百' 的 32点阵黑体 字模,128 byte */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x3F,0xFF,0xFF,0xFC,
- 0x3F,0xFF,0xFF,0xFC,0x00,0x01,0x80,0x00,
- 0x00,0x03,0x00,0x00,0x00,0x03,0x00,0x00,
- 0x00,0x03,0x00,0x00,0x00,0x03,0x00,0x00,
- 0x01,0xFF,0xFF,0x80,0x01,0xFF,0xFF,0x80,
- 0x01,0x80,0x01,0x80,0x01,0x80,0x01,0x80,
- 0x01,0x80,0x01,0x80,0x01,0x80,0x01,0x80,
- 0x01,0x80,0x01,0x80,0x01,0xFF,0xFF,0x80,
- 0x01,0xFF,0xFF,0x80,0x01,0x80,0x01,0x80,
- 0x01,0x80,0x01,0x80,0x01,0x80,0x01,0x80,
- 0x01,0x80,0x01,0x80,0x01,0x80,0x01,0x80,
- 0x01,0xFF,0xFF,0x80,0x01,0xFF,0xFF,0x80,
- 0x01,0x80,0x01,0x80,0x01,0x80,0x01,0x80,
- 0x01,0x80,0x01,0x80,0x00,0x00,0x00,0x00,
- };
- char ceng32H[]={
- /* 以下是 '层' 的 32点阵黑体 字模,128 byte */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x03,0xFF,0xFF,0xE0,0x03,0xFF,0xFF,0xE0,
- 0x02,0x00,0x00,0x20,0x02,0x00,0x00,0x20,
- 0x02,0x00,0x00,0x20,0x02,0x00,0x00,0x20,
- 0x03,0xFF,0xFF,0xE0,0x03,0xFF,0xFF,0xE0,
- 0x02,0x00,0x00,0x00,0x02,0x00,0x00,0x00,
- 0x02,0x00,0x00,0x00,0x02,0x1F,0xFF,0xE0,
- 0x02,0x00,0x00,0x00,0x02,0x00,0x00,0x00,
- 0x06,0x00,0x00,0x00,0x06,0x00,0x00,0x00,
- 0x06,0x7F,0xFF,0xFC,0x06,0x00,0xC0,0x00,
- 0x04,0x00,0x80,0x00,0x04,0x01,0x80,0x00,
- 0x0C,0x03,0x03,0x00,0x08,0x06,0x01,0x80,
- 0x08,0x0C,0x00,0x80,0x18,0x1C,0x00,0xC0,
- 0x30,0x3F,0xFF,0xE0,0x00,0x10,0x00,0x20,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- };
- char di24H[]={
- /* 以下是 '地' 的 24点阵华文行楷 字模,72 byte */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x08,
- 0x06,0x00,0x0E,0x04,0x00,0x06,0x04,0x40,
- 0x07,0x04,0x60,0x07,0x0C,0xC0,0x1E,0x34,
- 0xC0,0x3E,0x24,0xC0,0x1C,0x57,0x80,0x0C,
- 0x49,0x00,0x0F,0x48,0x00,0x0C,0x40,0x00,
- 0x38,0x00,0x0C,0x00,0x0F,0xE0,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- };
- char xia24H[]={
- /* 以下是 '下' 的 24点阵华文行楷 字模,72 byte */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0xC0,0x00,0x07,0xF0,0x00,
- 0x3F,0xE0,0x01,0xF8,0x00,0x0F,0xD8,0x00,
- 0x0F,0x18,0x00,0x02,0x1B,0x80,0x00,0x19,
- 0xC0,0x00,0x19,0x80,0x00,0x18,0x00,0x00,
- 0x18,0x00,0x00,0x18,0x00,0x00,0x18,0x00,
- 0x00,0x18,0x00,0x00,0x18,0x00,0x00,0x18,
- 0x00,0x00,0x08,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- };
- char ceng24H[]={
- /* 以下是 '层' 的 24点阵华文行楷 字模,72 byte */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
- 0x80,0x00,0x3F,0xC0,0x00,0x21,0x80,0x00,
- 0x01,0x00,0x00,0x03,0x00,0x00,0x08,0x00,
- 0x00,0x40,0x00,0x00,0x03,0x00,0x00,0x0E,
- 0x00,0x00,0x88,0x00,0x00,0x00,0xE0,0x00,
- 0x07,0x80,0x01,0xF2,0x00,0x00,0x44,0x80,
- 0x02,0x08,0x60,0x00,0x3F,0x60,0x00,0x30,
- 0x20,0x08,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- };
- void drawmat(char *mat,int matsize,int x,int y,int color)
- /*依次:字模指针、点阵大小、起始坐标(x,y)、颜色*/
- {
- int i, j, k, n;
- n = (matsize - 1) / 8 + 1;
- for(j = 0; j < matsize; j++)
- for(i = 0; i < n; i++)
- for(k = 0;k < 8; k++)
- if(mat[j * n + i] & (0x80 >> k)) /*测试为1的位则显示*/
- putpixel(x + i * 8 + k, y + j, color);
- }
- void drawMainBoard() /* 游戏开始画面的所有字 */
- {
- drawmat(shi32H,32,128,100,LIGHTCYAN);
- drawmat(jiu32H,32,282,100,LIGHTCYAN);
- drawmat(xia32H,32,330,100,LIGHTCYAN);
- drawmat(yi32H,32,378,100,LIGHTCYAN);
- drawmat(bai32H,32,426,100,LIGHTCYAN);
- drawmat(ceng32H,32,474,100,LIGHTCYAN);
- settextstyle(DEFAULT_FONT,0,4);
- setcolor(LIGHTRED);
- outtextxy(176,102,"Man");
- settextstyle(DEFAULT_FONT,0,1);
- setcolor(WHITE);
- outtextxy(215,230,"Start Exit");
- }
- void beginBack(int color[],int n) /* 游戏开始画面的上下彩带 */
- {
- int i;
- for(i=0;i<62;i++)
- {
- if(i%2==1)
- {
- setfillstyle(1,color[n]);
- bar(10+i*10,10,19+10*i,19);
- setfillstyle(1,color[n-1]);
- bar(10+i*10,330,19+10*i,339);
- }
- else
- {
- setfillstyle(1,color[n-1]);
- bar(10+i*10,10,19+10*i,19);
- setfillstyle(1,color[n]);
- bar(10+i*10,330,19+10*i,339);
- }
- }
- }
- void changeColor(int color[],int n) /* 彩带的颜色转换 */
- {
- int temp;
- temp=color[n];
- color[n]=color[n-1];
- color[n-1]=temp;
- }
- void endBoard() /* 描绘游戏结束画面 */
- {
- settextstyle(DEFAULT_FONT,0,2);
- setcolor(LIGHTRED);
- outtextxy(226,80,"Game Over !");
- settextstyle(DEFAULT_FONT,0,1);
- setcolor(LIGHTGREEN);
- outtextxy(255,150,"One More Try ?");
- settextstyle(DEFAULT_FONT,0,1);
- setcolor(WHITE);
- outtextxy(215,230,"Start Exit");
- }
- void drawPrBoard(int pr) /* 记分牌 */
- {
- char buf[10];
- setfillstyle(1,GREEN);
- bar(81,13,246,32);
- setcolor(RED);
- rectangle(81,2,246,43);
- drawmat(di24H,24,97,12,BLACK);
- drawmat(xia24H,24,128,12,BLACK);
- drawmat(ceng24H,24,215,12,BLACK);
- sprintf(buf,"%d",pr);
- setcolor(RED);
- settextstyle(DEFAULT_FONT,0,2);
- outtextxy(160,16,buf);
- }
- void drawSpBoard()/* 生命牌 */
- {
- char buf[11];
- setfillstyle(1,GREEN);
- bar(249,13,416,32);
- setcolor(RED);
- rectangle(249,2,416,43);
- outtextxy(310,15,"Life:");
- }
- void drawLife(int live)
- {
- int i;
- setfillstyle(1,GREEN);
- bar(249,13,416,32);
- setcolor(RED);
- rectangle(249,2,416,43);
- settextstyle(DEFAULT_FONT,0,0);
- outtextxy(310,15,"Life:");
- for(i=0;i<live;i++)
- {
- setfillstyle(1,MAGENTA);
- bar(253+i*17,26,253+(i+1)*16,31);
- }
- for(i=0;i<10;i++)
- {
- setcolor(DARKGRAY);
- rectangle(253+i*17,26,253+(i+1)*16,31);
- }
- }