Here is my PseudoCode based on my flowchart:
// Fill out your copyright notice in the Description page of Project Settings.
#include "BullCowCartridge.h"
void UBullCowCartridge::BeginPlay() // When the game starts
{
Super::BeginPlay();
// Welcomeing The Player
PrintLine(TEXT("Welcome to Bull Cow!"));
PrintLine(TEXT("Guess the 4 letter word!")); // Magic number remove
PrintLine(TEXT("Press enter to mooove forward"));
// Setting Up Game
HiddenWord = TEXT("word"); // Set the HiddenWord
// Set Lives
// Prompt Player Guess
}
void UBullCowCartridge::OnInput(const FString& Input) // When the player hits enter
{
ClearScreen();
// Checking the PlayerGuess
FString HiddenWord = TEXT("word");// Move outside this function
// PrintLine(Input);-- removed because do not need to parrot answers
if (Input == HiddenWord)
{
//More Words to Complete?
// If Yes, Print: You Completed this Word --> Ask if Want to continue playering?
// set NextWord
// Set Lives
// Prompt for PlayerGuess
//if No,Print below
PrintLine(TEXT("You Win!"));
//Prompt Play again?
// If Yes Restart
// If No: QuitGame
}
else
{
PrintLine(TEXT("You Lose..."));
}
// Isogram?
// Prompt to GuessAgain
// Right Number of Characters?
// Prompt to GuessAgain
// Repeated Letters?
// Prompt to GuessAgain
// Remove life
// Lives > zero?
// If Yes, GuessAgain
// Show Lives Left
// If No Show GameOver --> Show Hidden word?
// Prompt to Play Again, Press Enter to Player Again?
// Check User Input
// Play Again or Quit?
}