C++小游戏代码

来源:百度知道 编辑:UC知道 时间:2024/05/30 16:04:03
根据英语学习的特点,编制一款可帮助学生背英文单词的小软件,要求具有以下功能:从词库中随机抽取一个单词,显示在屏幕上时,该单词被随机隐藏了一个、或两个、或三个字母,用户正确填空后,可得分;当得分累积到某些分值时,系统给予鼓励。
单词词库可以是任何合理的形式,如数组、字符串、文件等。用户可以设置每次使用时练习的单词组。用户填空时,可以有提示信息。
我晕,我要的是简单的代码,不是楼下的P话,请不要在这说什么胡言乱语,没本事不要占楼位,谢谢你了!

http://www.pudn.com/downloads97/sourcecode/others/detail399517.html
#include<iostream> //Standard input/output
#include<string> //String manipulation
#include<cctype> //Character manipulation and testing
#include<fstream> //File stream
#include<cstdlib> //Used for random function
#include<time.h> //Used for better random number
#include"draw.h" //run the draw.h file

using namespace std;
//Function declerations
void instruction(int& choice); //Give instructions and gets choice
void usergame(int i); //Plays 2nd user game
void compgame(int i); //Plays against computer
//Tests current letter and raplaces starred word
void test(string word,char letter,int& numwrong,string& temp,int i);