[杂项项目]纯C语言实现控制台小游戏——数字拼图

一年前写的小游戏,当时感觉小有成就,现在发现缺陷真的很多。不禁感叹,当时为什么会用那么多goto呢。在这里真的建议大家不要用goto。只是现在懒得改了,毕竟是小程序。贴出来供大家参考。如果有时间后序再添加注释。如有问题欢迎评论。#include <stdio.h>#include <stdlib.h>#include<math.h>#include &lt...
摘要由CSDN通过智能技术生成

一年前写的小游戏,当时感觉小有成就,现在发现缺陷真的很多。不禁感叹,当时为什么会用那么多goto呢。在这里真的建议大家不要用goto。只是现在懒得改了,毕竟是小程序。贴出来供大家参考。如果有时间后序再添加注释。如有问题欢迎评论。

#include <stdio.h>
#include <stdlib.h>
#include<math.h>
#include <time.h>
#define max 10
int x, y, step, label = 0;
typedef struct score {
	int steps, steps2;
	double times;
	char name[18];
}score;
score sco[max + 1];
char ch, buff[3];
bool flag, flag1 = false;
clock_t start, finish;
bool over(){
	system("cls");
	printf("\n\n\n\n\t\t\t您共用了 %d 步 ,耗时 %.3f 分钟\n", step, (double)(finish - start) / 40000);
	system("pause");
	system("cls");
	printf("\n\n\n\n\n\n\n\n\t*******************  您是否重新开始游戏 (Y/N) ?  *******************\n\n");
	scanf("%s", buff);
	ch = buff[0];
	if (ch != 'n'&&ch != 'N') {
		return false;
	}
	else {
		printf("\n\n\n\n\t++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n");
		printf("\t+++++++++++++++++++++++++   感谢您的使用   +++++++++++++++++++++++++\n", step);
		        printf("\t+++++++++++++++++++
  • 2
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值