C++ and The Unreal Engine (cont.)

HiddenWord = TEXT("Hello");
Lives = HiddenWord.Len();
PrintLine(TEXT("The HiddenWord is : %s"), *HiddenWord);
PrintLine(TEXT("The HiddenWord is %i characters long"), HiddenWord.Len());
PrintLine(TEXT("You have %i Lives left"), Lives);
if (Guess == HiddenWord)
{
PrintLine(TEXT("You have won!"));
EndGame();
}
else
{
PrintLine(TEXT("You have lost a life"));

--Lives;
if (Lives > 0)
{
if (Guess.Len() != HiddenWord.Len())
{
PrintLine(TEXT("Guess again!\nYou have %i lives left"), Lives);
}
}
else
{
PrintLine(TEXT("You have no lives left");
EndGame();
}
}
if (Guess == HiddenWord)  // Checks to see if word is correct
{
PrintLine(TEXT("You have won!");
EndGame();
return;
}
// Checks to see if Guess and Word are same length if (Guess.Len() != HiddenWord.Len())
{
PrintLine(TEXT("Guess again!\nYou have %i lives left"), Lives)
return;
}
// Removes the life if the guess is wrong
PrintLine("You have lost a life");
--Lives;

// Checks to see if there are any lives left
if (Lives <= 0)
{
PrintLine(TEXT("You have no lives left"));
EndGame();
return;
}
// Pre Incrementint32 a = 1;
int32 b = ++a;
PrintLine(TEXT("%i , %i"), a, b);

--

--

--

Full stack web developer with experience in Ruby on Rails, JavaScript, React and Redux and learning more!

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Selenium WebDriver Interview Questions — part 1

Continues Integration For Your Jupyter Notebooks On GitHub With GCP

Products, markets, people, and minds change; Old technical constraints

Why your team‘s work culture needs a disruption

Angular 9 HTML Dynamic Table

JSON format showing array of objects with properties and values

Presentational Attributes vs Inline Styles

CTSI is Now Listed on Binance’s Liquid Swap with a CTSI/BNB Pool!

What Sneaker Bots mean for the Sneaker business and how to write one

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Danny Padron

Danny Padron

Full stack web developer with experience in Ruby on Rails, JavaScript, React and Redux and learning more!

More from Medium

How Are C Programs Compiled?

“WHAT WE SHOULDN’T SAY IN BETWEEN FIGHTS?”

CS373 Spring 2022: Luca Santos

C# Naming Convention