失眠网,内容丰富有趣,生活中的好帮手!
失眠网 > c语言换装游戏源代码 C语言游戏源代码

c语言换装游戏源代码 C语言游戏源代码

时间:2022-08-10 06:37:42

相关推荐

c语言换装游戏源代码 C语言游戏源代码

C语言游戏源代码

C语言游戏源代码 1、 简单的开机密码程序 #include “conio.h“ #include “string.h“ #include “stdio.h“ void error() {window(12,10,68,10); textbackground(15); textcolor(132); clrscr(); cprintf(“file or system error! you can t enter the system!!!“); while(1); /*若有错误不能通过程序*/ } void look() {FILE *fauto,*fbak; char *pass=“c:\\windows\\password.“; /*本程序的位置*/ char a[25],ch; char *au=“autoc.bat“,*bname=“hecfback.^^^“; /*bname 是autoc.bat 的备份*/ setdisk(2); /*set currently disk c:*/ chdir(“\\“); /*set currently directory \*/ fauto=(au,“r+“); if (fauto==NULL) {fauto=(au,“w+“); if (fauto==NULL) error();} fread(a,23,1,fauto); /*读取autoc.bat前23各字符*/ a[23]= \0 ; if (strcmp(a,pass)==0) /*若读取的和pass指针一样就关闭文件,不然就添加*/ fclose(fauto); else {fbak=(bname,“w+“); if (fbak==NULL) error(); fwrite(pass,23,1,fbak); fputc( \n ,fbak); rewind(fauto); while(!feof(fauto)) {ch=fgetc(fauto); fputc(ch,fbak);} rewind(fauto); rewind(fbak); while(!feof(fbak)) {ch=fgetc(fbak); fputc(ch,fauto);} fclose(fauto); fclose(fbak); remove(bname); /*del bname file*/ } } void pass() {char *password=““; char [60]; int n; while(1) {window(1,1,80,25); textbackground(0); textcolor(15); clrscr(); n=0; window(20,12,60,12); textbackground(1); textcolor(15); clrscr(); cprintf(“password:“); while(1) {[n]=getch(); if (n>58) {putchar(7); break;} /*若字符多于58个字符就结束本次输入*/ if ([n]==13) break; if ([n]>=32 [n]= \0 ; n--;} } [n]= \0 ; if (strcmp(password,)==0) break; else {putchar(7); window(30,14,50,14); textbackground(15); textcolor(132); clrscr(); cprintf(“password error!“); getch();} } } main() {look(); pass(); } 2、 彩色贪吃蛇 #include #include #define N 200 #define up 0 x4800 #define down 0 x5000 #define left 0 x4b00 #define right 0 x4d00 #define esc 0 x011b #define Y 0 x1579 #define n 0 x316e int gamespeed; /* 游戏速度 */ int i, key, color; int score = 0; /* 游戏分数 */ char cai48H[] = { 0 x00, 0 x00, 0 x00, 0 x00, 0 x00, 0 x00, 0 x00, 0 x00, 0 x00, 0 x00, 0 x00, 0 x00, 0 x00, 0 x00, 0 x00, 0 x00, 0 x00, 0 x00, 0 x00, 0 x00, 0 x00, 0 x00, 0 x00, 0 x00, 0 x00, 0 x00, 0 x00, 0 x00, 0 x00, 0 x00, 0 x00, 0 x00, 0 x04, 0 x00, 0 x18, 0 x00, 0 x00, 0 x00, 0 x0E, 0 x00, 0 x1C, 0 x00, 0 x00, 0 x00, 0 x1C, 0 x00, 0 x1C, 0 x00, 0 x00, 0 x00, 0 x20, 0 x00, 0 x38, 0 x00, 0 x00, 0 x00, 0 x40, 0 x00, 0 x78, 0 x00, 0 x00, 0 x01, 0 x80, 0 x40, 0 x70, 0 x00, 0 x00, 0 x03, 0 x80, 0 xC0, 0 xE0, 0 x00, 0 x00, 0 x07, 0 x80, 0 x80, 0 xC0, 0 x00, 0 x00, 0 x0E, 0 x11, 0 x81, 0 xC0, 0 x00, 0 x00, 0 x08, 0 x61, 0 x01, 0 x80, 0 x00, 0 x00, 0 x00, 0 x23, 0 x03, 0 x04, 0 x00, 0 x00, 0 x02, 0 x02, 0 x00, 0 x06, 0 x00, 0 x00, 0 x1E, 0 x04, 0 x00, 0 x0F, 0 x00, 0 x00, 0 x1C, 0 x1F, 0 x80, 0 x1E, 0 x00, 0 x00, 0 x08, 0 x3F, 0 x80, 0 x3C, 0 x00, 0 x00, 0 x00, 0 xFF, 0 x80, 0 x38, 0 x00, 0 x00, 0 x03, 0 xFF, 0 x80, 0 x78, 0 x00, 0 x00, 0 x0F,

如果觉得《c语言换装游戏源代码 C语言游戏源代码》对你有帮助,请点赞、收藏,并留下你的观点哦!

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。