怎样用C++编一个英文单词填空游戏

来源:百度知道 编辑:UC知道 时间:2024/05/10 21:41:31
根据英语学习的特点,编制一款可帮助学生背英文单词的小软件,要求具有以下功能:从词库中随机抽取一个单词,显示在屏幕上时,该单词被随机隐藏了一个、或两个、或三个字母,用户正确填空后,可得分;当得分累积到某些分值时,系统给予鼓励。
单词词库可以是任何合理的形式,如数组、字符串、文件等。用户可以设置每次使用时练习的单词组。用户填空时,可以有提示信息。

怎么没人回答啊,我也在等啊,冬瓜你多加些分啊!
#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);
//Checks current letter and adds it to letters chosen output if not entered already
void lchosen(char letter,string& letterchosen,int& check,int& chosencounte