本文整理汇总了C++中FBullCowGame::SubmitGuess方法的典型用法代码示例。如果您正苦于以下问题:C++ FBullCowGame::SubmitGuess方法的具体用法?C++ FBullCowGame::SubmitGuess怎么用?C++ FBullCowGame::SubmitGuess使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FBullCowGame
的用法示例。
在下文中一共展示了FBullCowGame::SubmitGuess方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PlayGame
void PlayGame(){
int32 MaxTries = BCGame.GetMaxTries();
std::cout << MaxTries << std::endl;
//BCGame() = FBullCowGame();
// loop for the number of turns asking for entries
//constexpr int NUMBER_OF_TURNS = 5;
//TODO: Change from For to a While loop once we are validating tries
while (BCGame.IsGameWon()==false && BCGame.GetCurrentTry() <= MaxTries) {
//std::cout<< "Status of Game is : " <<BCGame.IsGameWon() << "\n\n";
//for (int32 count = 1; count <= MaxTries; count++) {
FText Guess = GetValidGuess();
//TODO: Make check for valid guesses.
// Submit valid guess to the game
FBullCowCount BullCowCount = BCGame.SubmitGuess(Guess);
// Print number of bulls and cows
std::cout << "Bulls = " << BullCowCount.Bulls << " \n";
std::cout << "Cows = " << BullCowCount.Cows << " \n";
std::cout << "You entered >> " << Guess << " <<, thank you, let me check.\n";
std::cout << std::endl;
//std::cout<< "Status of Game is : inside FOR Loop " <<BCGame.IsGameWon() << "\n\n";
}
PrintGameSummary();
return; //TODO: HELLO
}
示例2: PlayGame
//play the game
void PlayGame()
{
BCGame.Reset();
int32 MaxTries = BCGame.GetMaxTries();
//loop asking for guess while
//game is NOT won and their are still tries remainging
while(!BCGame.IsGameWon() && BCGame.GetCurrentTry() <= MaxTries)
{
FText Guess = GetValidGuess();
//submit a valid guess to game
FBullCowCount BullCowCount = BCGame.SubmitGuess(Guess);
std::cout << "Bull = " << BullCowCount.Bulls;
std::cout << ". Cows = " << BullCowCount.Cows;
std::cout << std::endl;
}
PrintGameSummary();
return;
}
示例3: PlayGame
void PlayGame(){
BCGame.Reset();
PrintIntro();
// Loop for the number of turns asking for guesses
for (int32 count = 1; count <= BCGame.GetMaxTries(); count++) {
FText guess = GetGuess();
EWordStatus status = BCGame.CheckGuessValidity(guess);
switch (status) {
case EWordStatus::OK: {
FBullCowCount bullCowCount = BCGame.SubmitGuess(guess);
// print the number of bulls and cows
std::cout << "Bulls " << bullCowCount.Bulls;
std::cout << " Cows " << bullCowCount.Cows;
std::cout << std::endl;
break;
}
case EWordStatus::Wrong_Length: {
std::cout << "Wrong length! Try again.\n";
break;
}
case EWordStatus::Not_Lowercase : {
std::cout << "Not Lowercase! Try again.\n";
break;
}
default: {
std::cout << "Not Valid! Try again.\n";
break;
}
}
if (status == EWordStatus::OK) {
}
}
return;
}
示例4: PlayGame
void PlayGame()
{
BCGame.Reset();
int32 MaxTries = BCGame.GetMaxTries();
//Loop for the number of turns asking for guesses
//TODO change from for to while loop
for (int32 count = 0; count < MaxTries; count++)
{
FText Guess = GetGuess(); //TODO make loop checking valid
//Submit valid guess to the game
FBullCowCount BullCowCount = BCGame.SubmitGuess(Guess);
//Print number of bulls and cows
std::cout << "Bulls = " << BullCowCount.Bulls;
std::cout << "Cows = " << BullCowCount.Cows;
std::cout << std::endl;
}
//TODO summarise game
}