Some Pseudo Code to plan the game:

Here’s my pseudocode - constructive criticism appreciated!

// Fill out your copyright notice in the Description page of Project Settings.

#include "BullCowCartridge.h"

void UBullCowCartridge::BeginPlay() // When the game starts

{

    Super::BeginPlay();

    HiddenWord = TEXT("isogram"); //Set the HiddenWord

    // Set the lives

    PrintLine(TEXT("Welcome to the Bull Cow game!"));

    PrintLine(TEXT("Press the Tab key to start."));

    PrintLine(TEXT("Guess a (#)-letter word,")); //add code to check how many letters the HiddenWord has.

    PrintLine(TEXT("then press enter to continue."));

}

void UBullCowCartridge::OnInput(const FString& Input) // When the player hits enter

{

    ClearScreen();

    PrintLine(TEXT("You guessed: "));

    PrintLine(Input);

    //IF: Input is not an isogram, tell player and ask them to guess again

    //IF: Input is not the right number of letters, tell player and ask them to guess again

    if(Input == HiddenWord)

    {

        PrintLine(TEXT("You have won!"));

        //ask if they would like to play again

    }

    else

    {

        PrintLine(TEXT("Incorrect!"));

        //subtract a life

        //check if there are lives remaining.

        //IF lives remain:

            //Display remaining lives to player.

            //Calculate Bulls and Cows and display to player

            //Ask player to guess the HiddenWord again and tell them how many letters are in it

        //ELSE, tell player they lost and ask if they want to play again        

    }

}
1 Like

So far looks good.

Here my pseudo code