Exemplo n.º 1
0
void PlayGame()
{
	int32 MaxTries = BCGame.GetMaxTries();
	// Get a guess from the player and repeat it back to them.
	while(!BCGame.IsGameWon() && BCGame.GetCurrentTry() <= MaxTries)
	{
		FText Input = GetGuess();
		FBullCowCount BullCowCount = BCGame.SubmitValidGuess(Input);
		std::cout << "Number of Bulls: " << BullCowCount.Bulls << std::endl;
		std::cout << "Number of Cows: " << BullCowCount.Cows << std::endl << std::endl;
	}
	PrintGameSummary(BCGame.IsGameWon());
	return;
}
Exemplo n.º 2
0
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
}
Exemplo n.º 3
0
//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;
}
Exemplo n.º 4
0
void PrintGameSummary(){
    if (BCGame.IsGameWon()){
        std::cout << "Well Done - YOU WIN!\n";
    }
    else{
        std::cout << "Better luck next time !\n";
    }
}
Exemplo n.º 5
0
void PrintGameSummary()
{
	if (BCGame.IsGameWon())
	{
		std::cout << "Congratulations, you won!! \n";
	}
	else
	{
		std::cout << "Sorry, you lose! \n";
	}
}
Exemplo n.º 6
0
void PrintGameSummary()
{
    if (BCGame.IsGameWon() == true)
    {
        std::cout << "WELL DONE - YOU WIN!" << std::endl;
    }
    else
    {
        std::cout << "Better luck next time!" << std::endl;
    }
}
Exemplo n.º 7
0
void PrintGameSummmary()
{
	if (!BCGame.IsGameWon())
	{
		std::cout << "Sorry, you weren't able to figure out the isogram in the specified number of tries.\nBetter luck next time!\n\n";
	}
	else
	{
		std::cout << "Congratulations you won!\n\n";
	}
}
Exemplo n.º 8
0
void PrintGameSummary()
{
	if (BCGame.IsGameWon())
	{
		std::cout << "Hurraaah ! You won the Game !\n";
	}
	else
	{
		std::cout << "Opps ! Better luck next time !\n";
	}
	return;
}
Exemplo n.º 9
0
// 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();
}
Exemplo n.º 10
0
// 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;
}
Exemplo n.º 11
0
// 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;
}
Exemplo n.º 12
0
// 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);

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

	PrintGameSummary();
	return;
}
Exemplo n.º 13
0
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;
}
Exemplo n.º 14
0
void PrintGameSummary()
{
	if (BCGame.IsGameWon()) { std::cout << "Congrats!! You win!\n\n"; }
	else { std::cout << "You lost :/.. Do you wanna try again?\n\n"; }
}