コード例 #1
0
ファイル: phrase.cpp プロジェクト: swanyriver/ASSIGNMENT-4
void MakeThemeDictionary ( const string filename , const int maxLenght =
      MAX_WORD_LENGTH ) {
   myDict = ThemeDictionary( maxLenght , filename );
   myMenu.SetIntro(
         Banner() + HOW_MANY_WORDS
               + swansonString::GetString( myDict.NumWords() ) + " words!!!" );
   if ( !myDict.Filled() )
      usePreFabDict();
}
コード例 #2
0
ファイル: phrase.cpp プロジェクト: swanyriver/ASSIGNMENT-4
void PlainDict () {
   //Constructs a dict of MaxWordLength letter long words
   myDict = Dictionary( MAX_WORD_LENGTH );
   myMenu.SetIntro(
         Banner() + HOW_MANY_WORDS
               + swansonString::GetString( myDict.NumWords() ) + " words!!!" );

   if ( !myDict.Filled() )
      usePreFabDict();
}
コード例 #3
0
ファイル: phrase.cpp プロジェクト: swanyriver/ASSIGNMENT-4
void usePreFabDict () {
   myDict = Dictionary( PreFabDict::getSet() );

   myMenu.SetIntro(
         Banner() + HOW_MANY_WORDS
               + swansonString::GetString( myDict.NumWords() ) + " words!!!" );

   if ( myDict.Filled() ) {
      cout << endl
            << "something strange has happend, we had an empty dictionary"
            << " but don't worry, we can still play with my limited stored vocabulary";
      cout << endl << "press anything to continue:";
      getchar();
   } else {
      cout << endl
            << "something has gone very wrong here, we have no words, we cannot play";
      cout << endl << "press anything to exit:";
      exit( 1 );
   }
}
コード例 #4
0
ファイル: multiGame.cpp プロジェクト: swanyriver/assignment6
/**************************************************************
 *
 * * Entry: none
 *
 * * Exit: inflated dictionary with maxLength as its longest word(s)
 *
 * * Purpose: change word length to match difficulty
 *
 * ***************************************************************/
void SetDictionary ( int maxLength ) {
   myDict = Dictionary( maxLength );
   if ( !myDict.Filled() )
      myDict = PreFabDict::UsePreFabDict();
}