当前位置: 首页>>代码示例>>C++>>正文


C++ FBullCowGame::Reset方法代码示例

本文整理汇总了C++中FBullCowGame::Reset方法的典型用法代码示例。如果您正苦于以下问题:C++ FBullCowGame::Reset方法的具体用法?C++ FBullCowGame::Reset怎么用?C++ FBullCowGame::Reset使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在FBullCowGame的用法示例。


在下文中一共展示了FBullCowGame::Reset方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: 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;
}
开发者ID:qalbhussain,项目名称:Section_02,代码行数:27,代码来源:main.cpp

示例2: PlayGame

// Plays a single game to completion
void PlayGame()
{
	BCGame.Reset();
	int32 MaxTries = BCGame.GetMaxTries();
	//Loop asking for guesses while the game is NOT won and there are still turns
	while (!BCGame.IsGameWon() && BCGame.GetCurrentTry() <= MaxTries) 
	{
		FText Guess = GetValidGuess(); 
		FBullCowCount BullCowCount = BCGame.SubmitValidGuess(Guess);
		std::cout << "Bulls = " << BullCowCount.Bulls;
		std::cout << ", Cows = " << BullCowCount.Cows << "\n\n";
	}
	PrintGameSummary();
}
开发者ID:dproctor331,项目名称:UnrealClass,代码行数:15,代码来源:main.cpp

示例3: main

int main(int32 argc, const char * argv[]) {

    // Do - While loop
    bool bPlayAgain = false;
    do
    {
        BCGame.Reset();
        PrintIntro(); // form of abstraction
        PlayGame();
        bPlayAgain = AskToPlayAgain();
    } while(bPlayAgain);
    return 0;
    //TODO: Hello world
}
开发者ID:nerminkuc,项目名称:git_test,代码行数:14,代码来源:main.cpp

示例4: PlayGame

// plays a single game to completion
void PlayGame()
{
	BCGame.Reset();
	int32 MaxTries = BCGame.GetMaxTries();

	// loop asking for guesses while the game
	// is NOT won and there are still tries remaining
	while(!BCGame.IsGameWon() && BCGame.GetCurrentTry() <= MaxTries)
	{
		FText Guess = GetValidGuess();

		// submit valid guess to the game, and receive counts
		FBullCowCount BullCowCount = BCGame.SubmitValidGuess(Guess);
		PrintGuess(BullCowCount);
	}

	return;
}
开发者ID:MikeyUchiha,项目名称:BullCowGame,代码行数:19,代码来源:main.cpp

示例5: PlayGame

// plays a single game to completion
void PlayGame()
{
	BCGame.Reset();
	int32 MaxTries = BCGame.GetMaxTries();


	while (!BCGame.IsGameWon() && BCGame.GetCurrentTry() <= MaxTries) {
		FText Guess = GetValidGuess();

		// submit valid guess to the game, and receive counts
		FBullCowCount BullCowCount = BCGame.SubmitValidGuess(Guess);

		std::cout << "Bulls = " << BullCowCount.Bulls;
		std::cout << ". Cows = " << BullCowCount.Cows << "\n\n";
	}

	PrintGameSummary();
	return;
}
开发者ID:mh122354,项目名称:BullCowGame,代码行数:20,代码来源:main.cpp

示例6: PlayGame

void PlayGame()
{
    BCGame.Reset();
    int MaxTries = BCGame.GetMaxTries();
    
    //loop asking for guesses while the game is NOT won
    while (!BCGame.IsGameWon() && BCGame.GetCurrentTry() <= MaxTries)
    {
        FText Guess = GetGuess();        //submit valid guess to game
        FBullCowCount BullCowCount = BCGame.SubmitValidGuess(Guess);
        
        //print number of bulls and cows
        std::cout << "Bulls = " << BullCowCount.Bulls;
        std::cout << " Cows = " << BullCowCount.Cows << "\n\n";
        
        std::cout << "Your guess was: " << Guess << std::endl;
        std::cout << std::endl;
    }
    PrintGameSummary();
    return;
}
开发者ID:Diocletian,项目名称:Learning,代码行数:21,代码来源:main.cpp

示例7: 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;
}
开发者ID:spadger1066,项目名称:BullsandCows,代码行数:39,代码来源:main.cpp

示例8: 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
}
开发者ID:NoPickles,项目名称:BullsandCows,代码行数:24,代码来源:Source.cpp


注:本文中的FBullCowGame::Reset方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。