资源描述:
《五阶魔方阵源代码_c语言课程设计》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、五阶魔方阵源代码_C语言课程设计主函数#include#include#include#include"wenjian.c"#include"sanjie.c"#include"sijie.c"#include"wujie.c"#include"donghua.c"voiddianz(void);voidupbar(inty);voiddownbar(inty);voidbanyuan(void);voidmenulist(void){intky,cmd,i;inty;intgdriver,mode;gdrive
2、r=DETECT;initgraph(&gdriver,&mode,"");setbkcolor(BLACK);setcolor(RED);/*rectangle(200,70,440,410);*/dianz();y=127.5;setwritemode(XOR_PUT);upbar(y);cmd=3;do{ky=bioskey(0);switch(ky){caseKey_3:五阶魔方阵源代码_C语言课程设计{cmd=3;ky=Key_ENTER;break;}caseKey_4:{cmd=4;ky=Key_ENTER;break;}caseKey_5:{cmd=5
3、;ky=Key_ENTER;break;}caseKey_q:caseKey_Q:{cmd=0;ky=Key_ENTER;break;}caseKey_DOWN:{{if(y<277.5){upbar(y);y+=75;downbar(y);cmd=cmd+1;if(cmd==6)cmd=0;}}break;}caseKey_UP:{if(y>127.5){{downbar(y);y-=75;downbar(y);if(cmd==0)cmd=6;cmd-=1;}}break;}}五阶魔方阵源代码_C语言课程设计}while(ky!=Key_ENTER);switch(
4、cmd){case0:exit(0);case3:{sanjie();break;}case4:{sijie();break;}case5:{wujie();break;}}}main(){donghua();while(1){tuxing();menulist();clrscr();getchar();}}voiddrawmat(char*mat,intmatsize,intx,inty,intcolor)五阶魔方阵源代码_C语言课程设计/*依次:字模指针、点阵大小、起始坐标(x,y)、颜色*/{inti,j,k,n;n=(matsize-1)/8+1;for(j=
5、0;j>k))/*测试为1的位则显示*/putpixel(x+i*8+k,y+j,color);}voiddianz(void){charsan64L[]={/*以下是'三'的64点阵隶书字模,512byte*/0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0
6、x00,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,0x08,0x00,0x0
7、0,0x00,0x00,0x00,0x00,0x00,0x1C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3E,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x78,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,0