#include<stdio.h>
#include<malloc.h>
#include<conio.h>
#include<math.h>
#define OK 1
#define ERROR 0
#define OVERFLOW -1
typedef int Status;
typedef int ElemType;
typedef int bool;
/* WIN-TC BGI 图形编程模板 */
#include "Conio.h"
#include "graphics.h"
#include "dos.h"
#define closegr closegraph
void initgr(void) /* BGI初始化 */
{
int gd = DETECT, gm = 0; /* 和gd = VGA,gm = VGAHI是同样效果 */
registerbgidriver(EGAVGA_driver);/* 注册BGI驱动后可以不需要.BGI文件的支持运行 */
initgraph(&gd, &gm, "");
}
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);
}
char zhan64H[]={
/* 以下是 '栈' 的 64点阵华文隶书 字模,512 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,0x00,0x00,0x00,0x00,
0x00,0x00,0x30,0x00,0x1C,0x00,0x00,0x00,
0x00,0x00,0x38,0x00,0x1C,0x01,0x80,0x00,
0x00,0x00,0x78,0x00,0x1C,0x03,0xC0,0x00,
0x00,0x00,0x7C,0x00,0x1C,0x03,0xC0,0x00,
0x00,0x01,0xFF,0x80,0x3F,0xFF,0xF0,0x00,
0x00,0x0F,0xFF,0xE3,0xFF,0xFF,0xFF,0x00,
0x01,0xFF,0xFF,0xF7,0xFF,0xFF,0xFF,0x00,
0x01,0xFF,0xFF,0xF7,0xFF,0xFF,0xFE,0x00,
0x03,0xFF,0xFF,0xE7,0xFF,0xFF,0xFC,0x00,
0x03,0xFF,0xFF,0xC7,0xFF,0x00,0x00,0x00,
0x03,0xFF,0xFF,0x80,0x0F,0x00,0x00,0x00,
0x03,0xFF,0xFC,0x00,0x0F,0x00,0x00,0x00,
0x03,0xFE,0x78,0x00,0x0F,0x9F,0xF8,0x00,
0x01,0xE0,0x70,0x00,0x3F,0xFF,0xFE,0x00,
0x00,0x00,0x78,0x07,0xFF,0xFF,0xFE,0x00,
0x00,0x00,0xFC,0x0F,0xFF,0xFF,0xFC,0x00,
0x00,0x01,0xFE,0x0F,0xFF,0xFF,0xF8,