文档下载 文档下载导航
设为首页 | 加入收藏
搜索 请输入内容:  
 导航当前位置: 文档下载 > 所有分类 > 高等教育 > 工学 > 用C语言编写的Simple Simon游戏源代码
侵权投诉

用C语言编写的Simple Simon游戏源代码

C语言编写简单游戏Simple Simon,猜字游戏,是基于控制台应用程序的简单应用。

用C语言编写的Simple Simon游戏源代码:

//Program 4.13 Simple Simon

#include <stdio.h>

#include <ctype.h>

#include <stdbool.h>

#include <stdlib.h>

#include <time.h>

int main(void)

{

char another_game = 'Y';

const unsigned int DELAY = 1;

bool correct = true;

unsigned int tries = 0;

unsigned int digits = 0;

time_t seed = 0;

unsigned int number = 0;

time_t wait_start = 0;

clock_t start_time = 0;

unsigned int score = 0;

unsigned int total_digits = 0;

unsigned int game_time = 0;

//Describe how the game is played

printf("\nTo play Simple Simon, ");

printf("watch the screen for a sequence of digits.");

printf("\nWatch carefully, as the digits are only displayed"

" for %u second%s ", DELAY, DELAY > 1 ? "s!":"!"); printf("\nThe computer will remove them, and then prompt you ");

printf("to enter the same sequence.");

printf("\nWhen you do, you must put spaces between the digits.\n");

printf("\nGood Luck!\nPress Enter to play\n");

scanf("%c", &another_game);

//Game loop - one outer loop iteration is a complete game

do

{

//Initiate game

correct = true;

tries = 0;

digits = 2;

start_time = clock();

//Inner loop continues as long as sequences are entered correctly

第1页

热门文档

相关文档

  • 用C语言编写2048游戏源代码

    用C语言编写2048游戏源代码_计算机软件及应用_IT/计算机_专业资料 暂无评价0人阅读0次下载举报文档 用C语言编写2048游戏源代码_计算机软件及应用_IT/计算机_...

  • C语言编写的扫雷游戏源代码

    C语言编写的扫雷游戏源代码_IT/计算机_专业资料。C语言编写的扫雷游戏源代码课程设计说明书 C 语言编写的扫雷游戏源代码 No.1 /*5.3.4 源程序*/ #include <...

  • C语言编写的迷宫小游戏_源代码

    C语言编写的迷宫小游戏_源代码_计算机软件及应用_IT/计算机_专业资料 暂无评价0人阅读0次下载举报文档 C语言编写的迷宫小游戏_源代码_计算机软件及应用_IT/...

  • C语言编写的推箱子游戏源代码

    C语言编写的推箱子游戏源代码_IT/计算机_专业资料。C语言编写的推箱子游戏源代码/* 一个 C 语言编写的推箱子游戏源代码 */ #include <dos.h> #include <stdi...

  • C语言编写的迷宫小游戏 源代码

    C语言编写的迷宫小游戏 源代码_IT/计算机_专业资料。C语言编写的迷宫小游戏 源代C 语言编写的迷宫小游戏 源代码 #include <graphics.h> #include <stdlib.h> ...

  • C语言编写的黑白棋游戏源代码

    课程设计说明书 No.1 C 语言编写的黑白棋游戏源代码 /*3.3.4 源程序*/ #include "graphics.h" /*图形系统头文件*/ #define LEFT 0x4b00 /*光标左键值*...

  • 用C语言编写的Tic-Tac-Toe游戏源代码(井字过三关)

    用C语言编写的Tic-Tac-Toe游戏源代码(井字过三关)_工学_高等教育_教育专区。C语言的简单运用,设计循环和数组的基本语法,适合初学者入门用...

  • 纯c语言编写的打字游戏代码

    纯c语言编写的打字游戏代码_计算机软件及应用_IT/计算机_专业资料。纯C语言,简单模式的代码,适合初学者。北京信息科技大学 软件工程 1301 SHERO 组 #include <std...

  • C语言编写的壁球小游戏的源代码

    C语言编写的壁球小游戏的源代码。C++编写的壁球小游戏的源代码求C 语言编写的壁球小游戏的源代码,谢谢。 语言编写的壁球小游戏的源代码,谢谢。浏览次数:1297 次悬...

  • 用C语言编的射箭游戏代码

    用C语言编的射箭游戏代码_理学_高等教育_教育专区。注释很详细#include <graphics.h> #include <stdlib.h> #include <dos.h> #include <conio.h> #include ...

站点地图 | 文档上传 | 侵权投诉 | 手机版
本站所有资源均来自互联网,本站只负责收集和整理,均不承担任何法律责任,如有侵权等其它行为请联系我们.
文档下载 Copyright 2013 doc.guandang.net All Rights Reserved.  -  email