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
用C语言编写2048游戏源代码_计算机软件及应用_IT/计算机_专业资料 暂无评价0人阅读0次下载举报文档 用C语言编写2048游戏源代码_计算机软件及应用_IT/计算机_...
C语言编写的扫雷游戏源代码_IT/计算机_专业资料。C语言编写的扫雷游戏源代码课程设计说明书 C 语言编写的扫雷游戏源代码 No.1 /*5.3.4 源程序*/ #include <...
C语言编写的迷宫小游戏_源代码_计算机软件及应用_IT/计算机_专业资料 暂无评价0人阅读0次下载举报文档 C语言编写的迷宫小游戏_源代码_计算机软件及应用_IT/...
C语言编写的推箱子游戏源代码_IT/计算机_专业资料。C语言编写的推箱子游戏源代码/* 一个 C 语言编写的推箱子游戏源代码 */ #include <dos.h> #include <stdi...
C语言编写的迷宫小游戏 源代码_IT/计算机_专业资料。C语言编写的迷宫小游戏 源代C 语言编写的迷宫小游戏 源代码 #include <graphics.h> #include <stdlib.h> ...
课程设计说明书 No.1 C 语言编写的黑白棋游戏源代码 /*3.3.4 源程序*/ #include "graphics.h" /*图形系统头文件*/ #define LEFT 0x4b00 /*光标左键值*...
用C语言编写的Tic-Tac-Toe游戏源代码(井字过三关)_工学_高等教育_教育专区。C语言的简单运用,设计循环和数组的基本语法,适合初学者入门用...
纯c语言编写的打字游戏代码_计算机软件及应用_IT/计算机_专业资料。纯C语言,简单模式的代码,适合初学者。北京信息科技大学 软件工程 1301 SHERO 组 #include <std...
C语言编写的壁球小游戏的源代码。C++编写的壁球小游戏的源代码求C 语言编写的壁球小游戏的源代码,谢谢。 语言编写的壁球小游戏的源代码,谢谢。浏览次数:1297 次悬...
用C语言编的射箭游戏代码_理学_高等教育_教育专区。注释很详细#include <graphics.h> #include <stdlib.h> #include <dos.h> #include <conio.h> #include ...
热门文档