📄 number.cpp
字号:
char temp[10],temp1[10]={0,0,0,0,0,0,0,0};
itoa(num,temp,10);
if(num>=0&&strlen(temp)==1){temp1[0]='0';temp1[1]='0';}
if(num>=0&&strlen(temp)==2){temp1[0]='0';}
if(num<0&&strlen(temp)==2){temp1[0]='-';temp[0]='0';}
strcat(temp1,temp);
while(temp1[i])
{
PutOne(x,y,(int)(temp1[i])-'0',back_color);
x+=16;
i++;
}
}
/***********************************************************************/
void drawface(int x,int y,int n)
{
char face[4][16][16]={
{
1,1,1,1,1,0,0,0,0,0,1,1,1,1,1,1,
1,1,1,0,0,14,14,14,14,14,0,0,1,1,1,1,
1,1,0,14,14,14,14,14,14,14,14,14,0,1,1,1,
1,0,14,14,14,14,14,14,14,14,14,14,14,0,1,1,
1,0,14,14,0,0,14,14,14,0,0,14,14,0,1,1,
0,14,14,0,14,14,0,14,0,14,14,0,14,14,0,1,
0,14,14,14,14,14,14,14,14,14,14,14,14,14,0,1,
0,14,14,14,14,14,14,14,14,14,14,14,14,14,0,1,
0,14,14,14,14,14,14,14,14,14,14,14,14,14,0,1,
0,14,14,14,14,14,14,14,14,14,14,14,14,14,0,1,
1,0,14,14,14,14,14,14,14,14,14,14,14,0,1,1,
1,0,14,14,14,0,14,14,0,14,14,14,14,0,1,1,
1,1,0,14,14,14,0,0,14,14,14,14,0,1,1,1,
1,1,1,0,0,14,14,14,14,14,0,0,1,1,1,1,
1,1,1,1,1,0,0,0,0,0,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
},
/*******************************************************/
{
1,1,1,1,1,0,0,0,0,0,1,1,1,1,1,1,
1,1,1,0,0,14,14,14,14,14,0,0,1,1,1,1,
1,1,0,14,14,14,14,14,14,14,14,14,0,1,1,1,
1,0,14,14,14,14,14,14,14,14,14,14,14,0,1,1,
1,0,14,14,14,14,14,14,14,14,14,14,14,0,1,1,
0,14,14,0,0,14,14,14,14,0,0,14,14,14,0,1,
0,14,14,0,0,14,14,14,14,0,0,14,14,14,0,1,
0,14,14,14,14,14,14,14,14,14,14,14,14,14,0,1,
0,14,14,14,14,14,14,14,14,14,14,14,14,14,0,1,
0,14,14,14,14,14,0,0,14,14,14,14,14,14,0,1,
1,0,14,14,14,0,14,14,0,14,14,14,14,0,1,1,
1,0,14,14,14,0,14,14,0,14,14,14,14,0,1,1,
1,1,0,14,14,14,0,0,14,14,14,14,0,1,1,1,
1,1,1,0,0,14,14,14,14,14,0,0,1,1,1,1,
1,1,1,1,1,0,0,0,0,0,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
},
/*******************************************************/
{
1,1,1,1,1,0,0,0,0,0,1,1,1,1,1,1,
1,1,1,0,0,14,14,14,14,14,0,0,1,1,1,1,
1,1,0,14,14,14,14,14,14,14,14,14,0,1,1,1,
1,0,14,0,14,14,0,14,0,14,14,0,14,0,1,1,
1,0,14,14,0,0,14,14,14,0,0,14,14,0,1,1,
0,14,14,14,0,0,14,14,14,0,0,14,14,14,0,1,
0,14,14,0,14,14,0,14,0,14,14,0,14,14,0,1,
0,14,14,14,14,14,14,14,14,14,14,14,14,14,0,1,
0,14,14,14,14,14,14,14,14,14,14,14,14,14,0,1,
0,14,14,14,14,14,14,14,14,14,14,14,14,14,0,1,
1,0,14,14,14,14,0,0,0,14,14,14,14,0,1,1,
1,0,14,14,14,0,14,14,14,0,14,14,14,0,1,1,
1,1,0,14,14,14,14,14,14,14,14,14,0,1,1,1,
1,1,1,0,0,14,14,14,14,14,0,0,1,1,1,1,
1,1,1,1,1,0,0,0,0,0,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
},
/*******************************************************/
{
1,1,1,1,1,0,0,0,0,0,1,1,1,1,1,1,
1,1,1,0,0,14,14,14,14,14,0,0,1,1,1,1,
1,1,0,14,14,14,14,14,14,14,14,14,0,1,1,1,
1,0,14,14,14,14,14,14,14,14,14,14,14,0,1,1,
1,0,14,14,14,14,14,14,14,14,14,14,0,0,1,1,
0,0,0,14,0,0,14,14,0,0,14,0,14,0,0,1,
0,14,14,0,0,0,0,0,0,0,0,14,14,14,0,1,
0,14,14,14,0,0,14,14,0,0,14,14,14,14,0,1,
0,14,14,14,14,14,14,14,14,14,14,14,14,14,0,1,
0,14,14,14,14,14,14,14,14,14,14,14,14,14,0,1,
1,0,14,14,14,14,14,14,14,14,14,14,14,0,1,1,
1,0,14,14,14,0,14,14,0,14,14,14,14,0,1,1,
1,1,0,14,14,14,0,0,14,14,14,14,0,1,1,1,
1,1,1,0,0,14,14,14,14,14,0,0,1,1,1,1,
1,1,1,1,1,0,0,0,0,0,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
}
};
int i,j;
for(i=0;i<16;i++)
for(j=0;j<16;j++)
if(face[n][i][j]!=1)
putpixel(x+j,y+i,face[n][i][j]);
return;
}
/*******************************************************/
void signature(int x,int y,int back_color)
{
char sign[10][16][16]={
{
0,0,0,0,0,0,0,0,0,15,0,0,0,0,0,0,
0,15,15,15,15,0,0,0,0,15,0,0,0,0,0,0,
0,15,0,0,15,0,15,15,15,15,15,15,15,15,15,0,
0,15,0,0,15,0,0,0,15,0,0,0,0,0,0,0,
0,15,0,15,0,0,0,15,0,0,0,0,0,0,0,0,
0,15,15,0,0,0,0,15,0,15,0,0,0,0,0,0,
0,15,0,15,0,0,15,0,0,15,0,0,0,0,0,0,
0,15,0,0,15,0,15,15,15,15,15,15,15,15,0,0,
0,15,0,0,15,0,0,0,0,15,0,0,0,0,0,0,
0,15,15,0,15,0,0,0,0,15,0,15,0,0,0,0,
0,15,0,15,0,0,15,0,0,15,0,0,15,0,0,0,
0,15,0,0,0,0,15,0,0,15,0,0,0,15,0,0,
0,15,0,0,0,15,0,0,0,15,0,0,0,15,15,0,
0,15,0,0,15,0,0,0,0,15,0,0,0,0,15,0,
0,15,0,0,0,0,0,15,0,15,0,0,0,0,0,0,
0,15,0,0,0,0,0,0,15,0,0,0,0,0,0,0
},
/*******************************************************/
{
0,0,0,0,0,0,15,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,15,0,0,0,0,0,0,0,0,0,0,
0,0,15,15,15,15,15,15,15,15,15,15,15,15,0,0,
0,0,15,0,0,0,0,0,0,0,0,0,0,15,0,0,
0,0,15,0,0,0,0,0,0,0,0,0,0,15,0,0,
0,0,15,0,0,15,15,15,15,15,15,0,0,15,0,0,
0,0,15,0,0,15,0,0,0,0,15,0,0,15,0,0,
0,0,15,0,0,15,0,0,0,0,15,0,0,15,0,0,
0,0,15,0,0,15,0,0,0,0,15,0,0,15,0,0,
0,0,15,0,0,15,0,0,0,0,15,0,0,15,0,0,
0,0,15,0,0,15,15,15,15,15,15,0,0,15,0,0,
0,0,15,0,0,15,0,0,0,0,15,0,0,15,0,0,
0,0,15,0,0,0,0,0,0,0,0,0,0,15,0,0,
0,0,15,0,0,0,0,0,0,0,0,15,0,15,0,0,
0,0,15,0,0,0,0,0,0,0,0,0,15,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
},
/*******************************************************/
{
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,15,15,15,15,15,0,0,15,15,15,15,15,0,
0,0,0,15,0,0,0,15,0,0,15,0,0,0,15,0,
0,0,0,15,0,0,0,15,0,0,15,0,0,0,15,0,
0,0,0,15,15,15,15,15,0,0,15,15,15,15,15,0,
0,0,0,15,0,0,0,15,0,0,15,0,0,0,15,0,
0,0,0,15,0,0,0,15,0,0,15,0,0,0,15,0,
0,0,0,15,15,15,15,15,0,0,15,15,15,15,15,0,
0,0,0,15,0,0,0,15,0,0,15,0,0,0,15,0,
0,0,0,15,0,0,0,15,0,0,15,0,0,0,15,0,
0,0,0,15,0,0,0,15,0,0,15,0,0,0,15,0,
0,0,0,15,0,0,0,15,0,0,15,0,0,0,15,0,
0,0,15,0,0,0,0,15,0,15,0,0,0,0,15,0,
0,0,15,0,0,15,0,15,0,15,0,0,15,0,15,0,
0,15,0,0,0,0,15,0,15,0,0,0,0,15,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
},
/*******************************************************/
{
0,0,15,0,0,15,0,0,0,0,0,0,0,15,0,0,
0,0,15,15,0,15,0,0,0,0,0,0,0,15,0,0,
0,0,15,0,0,15,0,0,0,0,15,0,0,15,0,0,
0,0,15,15,15,15,15,15,15,0,15,0,0,15,0,0,
0,15,0,0,0,15,0,0,0,0,15,0,0,15,0,0,
0,0,0,0,0,15,0,0,0,0,15,0,0,15,0,0,
0,15,15,15,15,15,15,15,15,0,15,0,0,15,0,0,
0,0,0,0,0,15,0,0,0,0,15,0,0,15,0,0,
0,0,15,15,15,15,15,15,15,0,15,0,0,15,0,0,
0,0,15,0,0,15,0,0,15,0,15,0,0,15,0,0,
0,0,15,0,0,15,0,0,15,0,15,0,0,15,0,0,
0,0,15,0,0,15,0,0,15,0,15,0,0,15,0,0,
0,0,15,0,0,15,0,0,15,0,0,0,0,15,0,0,
0,0,15,0,0,15,15,15,15,0,0,0,0,15,0,0,
0,0,0,0,0,15,0,15,0,0,0,15,0,15,0,0,
0,0,0,0,0,15,0,0,0,0,0,0,15,0,0,0
},
/*******************************************************/
{
0,0,0,0,15,0,0,0,15,0,0,0,0,0,0,0,
0,0,0,0,15,15,0,0,15,0,0,0,0,0,0,0,
0,0,0,0,15,0,0,15,0,0,0,0,0,0,0,0,
0,0,0,15,0,0,15,15,15,15,15,15,15,15,15,0,
0,0,0,15,0,0,15,0,15,0,0,0,0,0,0,0,
0,0,15,15,0,15,0,0,15,0,0,0,15,0,0,0,
0,15,0,15,0,0,0,0,15,15,15,15,15,15,0,0,
15,0,0,15,0,0,0,0,15,0,0,0,0,0,0,0,
0,0,0,15,0,0,0,0,15,0,0,0,0,0,0,0,
0,0,0,15,0,0,0,0,15,0,0,0,0,15,0,0,
0,0,0,15,0,0,0,0,15,15,15,15,15,15,15,0,
0,0,0,15,0,0,0,0,15,0,0,0,0,0,0,0,
0,0,0,15,0,0,0,0,15,0,0,0,0,0,0,0,
0,0,0,15,0,0,0,0,15,0,0,0,0,0,0,0,
0,0,0,15,0,0,0,0,15,0,0,0,0,0,0,0,
0,0,0,15,0,0,0,0,15,0,0,0,0,0,0,0
},
/*******************************************************/
{
0,0,0,15,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,15,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,15,0,0,0,15,15,15,15,15,15,15,0,0,
0,0,0,15,0,0,0,0,0,0,0,0,0,15,0,0,
15,15,15,15,15,15,15,0,0,0,0,0,0,15,0,0,
0,0,0,15,0,0,0,0,0,0,0,0,0,15,0,0,
0,0,0,15,0,15,0,0,0,0,0,0,0,15,0,0,
0,0,0,15,15,0,0,0,15,15,15,15,15,15,0,0,
0,0,15,15,0,0,0,0,0,0,0,0,0,15,0,0,
15,15,0,15,0,0,0,0,0,0,0,0,0,15,0,0,
0,0,0,15,0,0,0,0,0,0,0,0,0,15,0,0,
0,0,0,15,0,0,0,0,0,0,0,0,0,15,0,0,
0,0,0,15,0,0,0,15,15,15,15,15,15,15,0,0,
0,15,0,15,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,15,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
},
/*******************************************************/
{
0,0,0,0,12,12,12,12,12,12,12,12,12,12,0,0,
0,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,
0,0,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
0,0,12,0,0,0,0,0,12,0,0,0,0,0,12,0,
0,0,0,0,12,12,12,0,12,0,12,12,12,0,0,0,
0,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,
0,0,0,0,12,12,12,0,12,0,12,12,12,0,0,0,
0,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,
0,0,0,12,12,12,12,12,12,12,12,12,12,12,0,0,
0,0,0,12,0,0,0,0,12,0,0,0,0,12,0,0,
0,0,0,12,0,0,0,0,12,0,0,0,0,12,0,0,
0,0,0,12,12,12,12,12,12,12,12,12,12,12,0,0,
0,0,0,12,0,0,0,0,12,0,0,0,0,12,0,0,
0,0,0,12,0,0,0,0,12,0,0,0,0,12,0,0,
0,0,0,12,12,12,12,12,12,12,12,12,12,12,0,0,
0,0,0,12,0,0,0,0,0,0,0,0,0,12,0,0
},
/*******************************************************/
{
0,0,0,0,0,0,0,15,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,15,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,15,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,15,0,0,0,0,0,0,0,0,
0,0,0,0,15,0,0,15,0,15,0,0,0,0,0,0,
0,0,0,0,15,15,0,15,0,0,15,0,0,0,0,0,
0,0,0,15,15,0,0,15,0,0,0,15,0,0,0,0,
0,0,0,15,0,0,0,15,0,0,0,15,15,0,0,0,
0,0,15,0,0,0,0,15,0,0,0,0,15,15,0,0,
0,15,0,0,0,0,0,15,0,0,0,0,0,15,15,0,
15,0,0,0,0,0,0,15,0,0,0,0,0,15,0,0,
0,0,0,0,0,0,0,15,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,15,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,15,0,0,0,0,0,0,0,0,
0,0,0,0,0,15,0,15,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,15,0,0,0,0,0,0,0,0,0
},
/*******************************************************/
{
0,0,0,0,0,0,15,0,0,0,0,15,0,0,0,0,
0,0,0,0,0,0,15,0,0,0,0,15,0,0,0,0,
0,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,
0,0,0,0,0,0,15,0,0,0,0,15,0,0,0,0,
0,0,0,0,0,0,0,0,15,0,0,0,0,0,0,0,
0,0,0,0,15,15,15,15,15,15,15,15,15,0,0,0,
0,0,0,0,15,0,0,0,15,0,0,0,15,0,0,0,
0,0,0,0,15,0,0,0,15,0,0,0,15,0,0,0,
0,0,0,0,15,0,0,0,15,0,0,0,15,0,0,0,
0,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,
0,0,0,0,0,0,0,0,15,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,15,0,15,0,0,0,0,0,0,
0,0,0,0,0,0,15,0,0,0,15,0,0,0,0,0,
0,0,0,0,0,15,0,0,0,0,0,15,15,0,0,0,
0,0,0,0,15,0,0,0,0,0,0,0,15,15,15,0,
0,0,0,15,0,0,0,0,0,0,0,0,0,15,0,0
},
/*******************************************************/
{
0,0,0,15,0,0,0,0,15,0,15,0,0,0,0,0,
0,0,0,15,0,0,0,0,15,0,0,15,0,0,0,0,
0,0,0,15,0,0,0,0,15,0,0,15,0,0,0,0,
15,15,15,15,15,15,0,15,15,15,15,15,15,15,15,0,
0,0,15,0,0,0,0,15,0,0,0,15,0,0,0,0,
0,0,15,0,0,0,15,15,0,0,0,15,0,0,0,0,
0,0,15,0,15,0,0,15,15,15,15,15,15,15,0,0,
0,15,0,0,15,0,0,15,0,0,0,15,0,0,0,0,
0,15,0,15,0,0,0,15,0,0,0,15,0,0,0,0,
0,15,0,15,0,0,0,15,15,15,15,15,15,15,0,0,
15,0,15,0,0,0,0,15,0,0,0,15,0,0,0,0,
0,0,15,0,15,0,0,15,0,0,0,15,0,0,0,0,
0,15,0,0,0,15,0,15,0,0,0,15,0,0,0,0,
15,15,15,15,15,15,0,15,15,15,15,15,15,15,15,0,
0,0,0,0,0,15,0,15,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,15,0,0,0,0,0,0,0,0
}
};
int i,j,k;
for(k=0;k<10;k++)
{
for(i=0;i<16;i++)
for(j=0;j<16;j++)
if(sign[k][i][j])
putpixel(x+j,y+i,sign[k][i][j]);
else
putpixel(x+j,y+i,back_color);
x+=16;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -