- C20250060's blog
1
- 2023-6-2 17:14:56 @
#include <bits/stdc++.h>
//#include <pthread.h>
#include <windows.h>
#include <conio.h>
using namespace std;
inline int read(){int x;scanf("%d",&x);return x;}
int pl=2,step,rd,point[4][2]={{1,11},{11,1},{11,21},{21,11}},fx[4][2]={{-1,0},{0,-1},{0,1},{1,0}};
char a[25][25];
inline void print(){
system("cls");
//printf("ady cjb→cxe game\nmade by C20250001\n");
printf("djb->zcw game\nmade by C20250001\n");
for (int i=1;i<=21;i++){
for (int j=1;j<=21;j++)printf("%c",a[i][j]);
putchar('\n');
}
return;
}
void pt(){
memset(a,' ',sizeof(a));
a[11][11]='嘉';step=0;
while (step<1000){
char ch=_getch();
for (int i=0;i<4;i++)a[11+fx[i][0]][11+fx[i][1]]=' ';
if (ch=='w')a[10][11]='-';
if (ch=='a')a[11][10]='|';
if (ch=='s')a[11][12]='|';
if (ch=='d')a[12][11]='-';
rd=rand()%4;
for (int i=10;i>=1;i--){a[11][i]=a[11][i-1];a[i][11]=a[i-1][11];}
for (int i=12;i<=21;i++){a[11][i]=a[11][i+1];a[i][11]=a[i+1][11];}
a[point[rd][0]][point[rd][1]]='+';
step++;
print();
}
cout<<6987;
return;
}
//void yc();
void play(){
system("cls");printf("djb→zcw game\nmade by C20250001\n1:普通关\n2:隐藏关\n3:结束\n");
char c=' ';
while ((c<'1')||(c>'3'))c=_getch();
if (c=='3'){pl=3;return;}
if (c=='1')pt();
//pthread_exit(NULL);
return;
}
int main(){
while (1)
{
printf("djb love zcw\n");
}
srand(time(NULL));
while (pl==2)play();
return 0;
}
made by djb,已获得作者转载权限。