Bulls & Cows (2019 Version) challenges

My system has only one monitor and I prefer to use the same layout as in the videos because it is easier to find menus, buttons, e. t. c. and repeat activities after lecturer.

I use keyboard + mouse method to move in UE editor. FPS movement style is the most suitable for me.

Here are my actor transforms:

My World:

My code from the lecture “Using The In Game Terminal” executed first time as I expected. I had no problems with it.

Here are strings wrapped within the TEXT macro:

Here is my vision of “Bulls & Cows” basic game loop:

Coding The Basic Game Loop lecture challenge.
I see the following issues in my code:

  1. The code doesn’t follow the flowchart.
  2. I have to change number of letters in ask for guess every time the length of HiddenWord changes because it is hard coded.

I had some issues with the challenge in lecture “Member Variables”. Whatever word I’ve entered (correct or incorretc) the message was “You have lost”. It has happend because of two my mistakes:
I’ve typed HiddenWord == TEXT(“map”); instead of HiddenWord = TEXT(“map”); in BeginPlay() function. In OnInput function PrintLine(Input) was not deleted. Now my code works as I intended it to.

The full game loop:

Here is my pseudo code:

Creating Our First Function challenge:
My first function InitGame() went without any issues.

“The C++ Dot Operator” lecture challenge results:
My input length chek worked incorrectly because it was declared after ClearScreen() function but not as nested in else statement. This bug ))) was fixed and now it works fine.
Code:


Result:

Formatting FStrings challenge:
Here are actual numbers instead of hard coded:

Additional checks done:

Checks order thought experiment (micro challenge):

I think the best order of checks is words equality check, words length check and finally isogram check.
The one of the reasons (maybe the only reason) of changing order of checks is optimizing performance of code.

1 Like

Aww the cow is trapped. Can we set the cow free?

Of course we can! :slightly_smiling_face:

IsIsogram() pseudocode:

Player Guess output:

HiddenWord outptu:

Checking the first character against all the others:

Privacy & Terms