1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
|
//**** Global Variables
string theSword;
string theShint;
//*** End of Globals
void get_word()
{
enum fields {secertWord, Def, num_field};
const int NUM_WORDS = 15;
const string WORDS[NUM_WORDS][num_field] =
{
{"axiom", "A self-evident or universally recognized truth"},
{"logic", "The study of principles of reasoning"},
{"control", "To exercise restraint or direction over"},
{"reliance", "confident or trustful dependence"},
{"diference", "an instance or point of unlikeness or dissimilarity"},
{"point", "To indicate a position or direction"},
{"array", "to place in proper or desired order"},
{"vector", "a quantity possissing both magnitude and direction"},
{"construct", "To build or form by putthing togehter parts"},
{"function", "the purpose for which something is designed or exists"},
{"string", "A slender cord or thing thread used for binding or tying"},
{"enumeration", "a catalog or list"},
{"switch", "to shift or exchange"},
{"branch", "to divide into separate parts or subdivisions"},
{"program", "a plan of action to accomplish a specified end"}
};
srand( time(NULL));
int pick = (rand() % NUM_WORDS);
string theSword = WORDS[pick][secertWord];
string theShint = WORDS[pick][Def];
};
int main()
{
get_word();
cout<<"the secert word is"<<theSword<<"and the hint is :"<<theShint<<"\n";
stop();
return 0;
}
|