云题海 - 专业文章范例文档资料分享平台

当前位置:首页 > c语言推箱子代码

c语言推箱子代码

  • 62 次阅读
  • 3 次下载
  • 2025/5/31 12:34:22

#include #include void map1(); void map2(); void map3(); void show(); void move();

void main(int argc,char*argv[]) { time_t a,b; time(&a); system(\loop1: {

system(\刷屏 printf(\欢迎进入推箱子游戏\\n\\n\\t\\t\\t\\t 请按a b c选择游戏\\n\\n\\t\\t\\t\\t 按 d 键 结束\ int t=getch(); if(t=='d') { printf(\ \ } else { if(t=='a') { map1(); goto loop1; } if(t=='b') { map2(); goto loop1; } if(t=='c') { map3(); goto loop1; } else { printf(\ 请重新输入:\ goto loop1; } }

} time(&b); printf(\游戏总共用时%.3d秒\\n\\t\\t\\t \ getch();//等待读取回车符以结束程序 }

void map1() { time_t p,q,o; time(&p); int i=4,j=4,m=6,n=2,t=1,k=3;

system(\刷屏 system(\int x=1,y=7; char z,a[9][9]=

{ /*为背景设置初始资料*/ {'#','#','#','#','#','#','#','#','#'}, {'#','#','#', 3, 0 , 0 , 0 , 1 ,'#'}, {'#','#', 0 , 0 , 0 ,'#', 0 ,'#','#'}, {'#', 0 , 0 ,'#', 0 , 0 , 5 , 0 ,'#'}, {'#', 0 , 5 , 5 , 3 , 0 , 0 , 0 ,'#'}, {'#','#', 0 ,'#', 0 , 0 ,'#','#','#'}, {'#','#', 3 , 0 , 0 , 0 ,'#','#','#'}, {'#','#','#','#','#','#','#','#','#'}, {'#','#','#','#','#','#','#','#','#'} };

show(a);//调用输出函数 loop://语句标号 move(a,&x,&y,i,j,m,n,t,k,&z); if(a[i][j]=='!'&&a[m][n]=='!'&&a[t][k]=='!') {

system(\刷屏 show(a); printf(\ YOU ARE WIN!\\n\ time(&q); printf(\ 用时%.3d秒\\n\ printf(\回车重 新选择*******\\n\\t\\t\\t\\t\ getch(); } else { time(&o); if(z=='d') { return;

} if(o-p>30) { loop1: system(\刷屏 printf(\时间已过请重新回车选关!\ int g=getch(); if(g==13)//判断是否为回车符 { return; } else { goto loop1; } } system(\刷屏 show(a);//调用输出函数 goto loop; } }

void map2() {

time_t p,q,o; time(&p); int i=2,j=1,m=1,n=3,t=4,k=6; system(\刷屏 system(\ int x=4,y=1; char z,b[9][9]= { /*为背景设置初始资料*/ {'#','#','#','#','#','#','#','#','#'}, {'#','#','#', 3 , 0 ,'#','#','#','#'}, {'#', 3 ,'#', 0 , 0 , 0 , 0 ,'#','#'}, {'#', 0 , 5 , 0 ,'#','#', 0 , 0 ,'#'}, {'#', 1 , 0 , 5 , 0 , 0 , 3 , 0 ,'#'}, {'#', 0 , 0 , 0 , 0 , 0 , 0 ,'#','#'}, {'#','#','#', 0 , 0 , 5 ,'#','#','#'}, {'#','#','#','#', 0 , 0 ,'#','#','#'}, {'#','#','#','#','#','#','#','#','#'} }; show(b);//调用输出函数 loop://语句标号 move(b,&x,&y,i,j,m,n,t,k,&z); if(b[i][j]=='!'&&b[m][n]=='!'&&b[t][k]=='!')

{

system(\刷屏 show(b);

printf(\ YOU ARE WIN!\\n\time(&q);

printf(\ 用时%.3d秒\\n\ printf(\回车重 新选择*******\\n\\t\\t\\t\\t\ getch(); } else { time(&o); if(z=='d') { return; } if(o-p>30) { loop1: system(\刷屏 printf(\时间已过请重新回车选关!\ int g=getch(); if(g==13)//判断是否为回车符 { return; } else { goto loop1; } } system(\刷屏 show(b);//调用输出函数 goto loop; } }

void map3() {

time_t p,q,o; time(&p); int i=2,j=1,m=6,n=2,t=7,k=6; system(\刷屏 system(\ int x=3,y=6; char z,c[9][9]=

搜索更多关于: c语言推箱子代码 的文档
  • 收藏
  • 违规举报
  • 版权认领
下载文档10.00 元 加入VIP免费下载
推荐下载
本文作者:...

共分享92篇相关文档

文档简介:

#include #include void map1(); void map2(); void map3(); void show(); void move(); void main(int argc,char*argv[]) { time_t a,b; time(&a); system(\loop1: { system(\刷屏 printf(\欢迎进入推箱子游戏\\n\\n\\t\\t\\t\\t 请按a b c选择游戏\\n\\n\\t\\t\\t\\t 按 d 键 结束\ int t=getch(); if(t=='d') { printf(\ \ } else { if(t=='a') { map1();

× 游客快捷下载通道(下载后可以自由复制和排版)
单篇付费下载
限时特价:10 元/份 原价:20元
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信:fanwen365 QQ:370150219
Copyright © 云题海 All Rights Reserved. 苏ICP备16052595号-3 网站地图 客服QQ:370150219 邮箱:370150219@qq.com