I'm developing 4 video games to help build cyber security awareness among high-school kids. For one game I'm taking them thru a series of steps which help them in creating a strong password. One of the steps requires them to enter the acronym of the phrase they entered initially and I need a way for the game to validate if they entered the correct acronym before allowing them to move forward.
Basically I'm trying to write a function to "acronymize" text entered into a textbox by the user via the keyboard.
For example, if the user enters the phrase "hey what's cooking good looking", initially, this text is saved to text variable say "UserPhrase", then the user is prompted to enter the acronym of this phrase, the game/function should compute the acronym of this stored phrase and compare it to the acronym entered by the user, if it is correct, a corresponding text object should display the result which in this case would be "hwcgl" and allow the user to move forward in the game.
I know how to carry this out in C++ but I am having a high degree of difficulty translating it to Construct 2.
using namespace std;
string acronym(string str);
cout << "\nPlease enter a string: ";
if (str == "")
cout << "\n\nThe acronym is \"" << acronym(str) << "\"" << "\n";
string acronym(string str)
string phrase = "";
phrase = str;
for (int i = 0; i < str.length(); i++)
if (str == ' ')
phrase += str[i+1];
Can anyone show me how to achieve this using Regex?