{"id":22039564,"url":"https://github.com/mpolinowski/consoleapplication","last_synced_at":"2025-07-24T13:42:05.243Z","repository":{"id":111482788,"uuid":"93701542","full_name":"mpolinowski/consoleApplication","owner":"mpolinowski","description":"A simple word game designed to teach the basics of C++ and Unreal Engine coding standards","archived":false,"fork":false,"pushed_at":"2017-07-29T13:36:40.000Z","size":21,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-23T13:15:11.743Z","etag":null,"topics":["cplusplus","game-development","game-engine","unreal-engine","unreal-engine-4","unrealengine"],"latest_commit_sha":null,"homepage":"https://www.udemy.com/unrealcourse/","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mpolinowski.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-06-08T02:58:55.000Z","updated_at":"2023-03-08T01:08:12.000Z","dependencies_parsed_at":"2023-04-27T13:02:24.502Z","dependency_job_id":null,"html_url":"https://github.com/mpolinowski/consoleApplication","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mpolinowski/consoleApplication","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mpolinowski%2FconsoleApplication","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mpolinowski%2FconsoleApplication/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mpolinowski%2FconsoleApplication/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mpolinowski%2FconsoleApplication/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mpolinowski","download_url":"https://codeload.github.com/mpolinowski/consoleApplication/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mpolinowski%2FconsoleApplication/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260322131,"owners_count":22991773,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cplusplus","game-development","game-engine","unreal-engine","unreal-engine-4","unrealengine"],"created_at":"2024-11-30T11:11:16.238Z","updated_at":"2025-06-17T08:33:08.834Z","avatar_url":"https://github.com/mpolinowski.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Unreal Engine Coding Standards\n\nThis is a fork of the first section of the [Unreal Course](https://github.com/UnrealCourse) teaching C++ coding standards for the Unreal Game Engine.\n\nThe Source Code can be found in [consoleApplication](https://github.com/mpolinowski/consoleApplication)\n\nThe following is the commented Course Journal:\n\n\n### Intro, Notes \u0026 Section 2 Assets ###\n\n+ Welcome to the first actual coding video.\n+ Why we’re doing this in the IDE only.\n+ What you’ll be building, see resources.\n+ You’ll learn types, loops, routines, classes.\n+ We’ll follow Unreal’s coding style, and re-use.\n+ Notes and resources are attached.\n\n### S02 Game Design Document (GDD) ###\n\n+ How much planning should we do?\n+ Define the emotional problem the game solves\\*\n+ Chose concept, rules \u0026 requirements.\n+ Start to think about the architecture.\n+ _Copy_ as much as possible into the code!\n+ Document now what may change later.\n\n**Useful Links**\n+ \\* [McConnell, Steve. _Code Complete._ Microsoft Press 2004. Chapter 3.3](https://www.amazon.com/gp/product/0735619670/)\n\n### How Solutions \u0026 Projects Relate ###\n\n+ How projects and solutions relate.\n+ Setting up a new command line project.\n+ An overview of the structure of our solution.\n+ (Adding main.cpp to our project).\n\n### C++ Function Syntax ###\n\n+ The difference between an engine and a library.\n+ How this relates to this console application.\n+ What is building / compiling code?\n+ How the console knows where to find our code.\n+ The syntax of a function in C++.\n+ Write the minimal C++ program to remove error.\n+ Testing our application runs without error.\n\n```cpp\n// Standard C++ library automatically included by Visual Studio\n#include \"stdafx.h\"\n\nint main() {\n  return 0;\n}\n```\n\nCreated a C++ function \"main\" in a file \"main.cpp\" that can be run CTRL+F5 without errors and returns integer 0.\n\n### Using, #include and Namespaces ###\n\n+ **#** represents a “preprocessor directive”.\n+ **#include** copies-and-pastes other code.\n+ The idea of using library code.\n+ Use \u003c\u003e for standard libraries.\n+ Use “ “ for files you have created yourself.\n+ Notice the namespace icon in autocomplete.\n+ Import **iostream** library and use **std** namespace\n+ Clean up your code by removing **std::** that is no longer needed\n\n```cpp\n#include \"stdafx.h\"\n#include \u003ciostream\u003e\n\nint main()\n{\n  std::cout \u003c\u003c \"Welcome to Bulls and Cows\" \u003c\u003c std::endl;\n  return 0;\n}\n```\n\nBy defining the std namespace we can simplify our code:\n\n```cpp\n#include \"stdafx.h\"\n#include \u003ciostream\u003e\n\nusing namespace std;\n\nint main()\n{\n  cout \u003c\u003c \"Welcome to Bulls and Cows\" \u003c\u003c endl;\n  return 0;\n}\n```\n\n### Magic Numbers and Constants ###\n\n+ What a “magic number” is.\n+ Why it’s a good idea to avoid them.\n+ **constexpr** means “evaluated at compile time”.\n+ Introduce coding standards\\*.\n+ Use a constant expression for the word length.\n\n```cpp\nint main()\n{\n  // introduce the game\n  constexpr int WORD_LENGTH = 9;\n  cout \u003c\u003c \"Welcome to Bulls and Cows\" \u003c\u003c endl;\n  cout \u003c\u003c \"Can you guess the \u003c\u003c WORD_LENGTH;\n  cout \u003c\u003c \" letter isogram I'm thinking of?/n\";\n\n  cout \u003c\u003c endl;\n  return 0;\n}\n```\n\nThere are 2 ways to break to a new line - \"endl\" and \"/n\". The latter does not flush the output buffer - otherwise identical.\n\n**Useful Links**\n+ \\* [Unreal Engine - Coding Standard](https://docs.unrealengine.com/latest/INT/Programming/Development/CodingStandard/index.html)\n\n### Variables and cin for Input ###\n\n+ Introducing pseudocode programming - add a comment to describe the function before you start programming\n+ Why we need to **#import \\\u003cstring\\\u003e**\n+ Getting input using **cin**\n+ cin breaks consuming input at space - you cannot input more then 1 word\n\n```cpp\n// string library is needed for the \"\u003e\u003e\" operator\n#include \u003cstring\u003e\n\nint main()\n{\n  // introduce the game\n  // ...\n\n  // get a guess from player\n  cout \u003c\u003c \"Enter your guess: \";\n  string Guess = \"\";\n  cin \u003e\u003e Guess;\n\n  // return guess to player\n  cout \u003c\u003c \"Your guess was: \" \u003c\u003c Guess \u003c\u003c endl;\n\n  cout \u003c\u003c endl;\n  return 0;\n}\n```\n\n### Using getline() ###\n\n+ Solve the problem that you cannot enter a guess with more then one word\n+ **getline()** reads through spaces and discards input stream @endl\n+ Where to find C++ documentation =\u003e www.cplusplus.com\n\n```cpp\nint main()\n{\n  // introduce the game\n  // ...\n\n  // get a guess from player\n  cout \u003c\u003c \"Enter your guess: \";\n  string Guess = \"\";\n  getline (cin,Guess);\n\n  // return guess to player\n  cout \u003c\u003c \"Your guess was: \" \u003c\u003c Guess \u003c\u003c endl;\n\n  cout \u003c\u003c endl;\n  return 0;\n}\n```\n\n### Simplifying With Functions ###\n\n+ Programming is all about managing complexity.\n+ We want to think about a few things at a time.\n+ The idea of abstraction and encapsulation -\u003e the scope of the constexpr WORD_LENGTH is now limited to the PrintIntro function.\n+ Always use **return** at the end of your functions.\n\n+ Wrap the code Intro code into function to make our code more readable.\n+ The PrintIntro() then be called from within main()\n\n*PrintIntro* function:\n\n```cpp\nvoid PrintIntro()\n  {\n    // introduce the game\n    constexpr int WORD_LENGTH = 9;\n    cout \u003c\u003c \"Welcome to Bulls and Cows\" \u003c\u003c endl;\n    cout \u003c\u003c \"Can you guess the \u003c\u003c WORD_LENGTH;\n    cout \u003c\u003c \" letter isogram I'm thinking of?/n\";\n    cout \u003c\u003c endl;\n    return;\n  }\n\n  //Entry point of application\n  int main()\n  {\n    // introduce the game\n    PrintIntro ();\n\n    // get a guess from player\n    // ...\n\n    // return guess to player\n    // ...\n\n    return 0;\n  }\n```\n\nThe collection of functions used by main() should be at the end of the document. We have to put the identifier for the function PrintIntro() on top of the document. This way we can put the body PrintIntro(){} below main()\n\n```cpp\nvoid PrintIntro():\n\n//Entry point of application\nint main()\n{\n  // introduce the game\n  PrintIntro ();\n\n  // get a guess from player\n  // ...\n\n  // return guess to player\n  // ...\n\n  return 0;\n}\n\nvoid PrintIntro()\n  {\n    // introduce the game\n    constexpr int WORD_LENGTH = 9;\n    cout \u003c\u003c \"Welcome to Bulls and Cows\" \u003c\u003c endl;\n    cout \u003c\u003c \"Can you guess the \u003c\u003c WORD_LENGTH;\n    cout \u003c\u003c \" letter isogram I'm thinking of?/n\";\n    cout \u003c\u003c endl;\n    return;\n  }\n```\n\nThis makes it easy to spot main() inside the document. Descriptive identifier for each function inside main() make our code readable / **self-documenting**\n\nRepeat this process with all other functions inside main():\n\n```cpp\nvoid PrintIntro():\nstring GetGuessAndPrintBack();\n\n//Entry point of application\nint main()\n{\n  PrintIntro ();\n  GetGuessAndPrintBack ();\n  return 0;\n}\n\n// introduce the game\nvoid PrintIntro() {...}\n\n// get a guess from player and print back\nstring GetGuessAndPrintBack()\n{\n  cout \u003c\u003c \"Enter your guess: \";\n  string Guess = \"\";\n  getline(cin, Guess);\n  //print guess back to player\n  cout \u003c\u003c \"Your guess was: \" \u003c\u003c Guess \u003c\u003c endl;\n  return Guess;\n}\n```\n\n\n### Iterating With For \u0026 While Loops ###\n\n+ Use loops to prevent typing the same code repeatedly\n+ When to use **for** vs **while** -\u003e \"When you know what you in **FOR**\" / \"When you are looping for a **WHILE**\" -\u003e use for-loop when you know the number of loops at compile time.\n+ The syntax of a for-loop: **for** (**Initialization**: count = 1; **Condition**: count \u003c= limit; **Increase**: count = count +1) {**Statement**}\n+ Think carefully about the first \u0026 last loop.\n+ Write a **for** loop to repeat the game.\n\n```cpp\nint main()\n{\n  // introduce the game\n  PrintIntro ();\n\n  // get a guess from player and loop for number of turns\n  constexpr int NUMBER_OF_TURNS = 5;\n\n  for (int i = 0; i \u003c NUMBER_OF_TURNS; i++)\n\t{\n\t\tGetGuessAndPrintBack();\n    cout \u003c\u003c endl;\n\t}\n\n  return 0;\n}\n```\n\n**Useful Links**\n+ \\* [www.cplusplus.com](http://www.cplusplus.com/doc/tutorial/control)\n+ \\* [msdn.microsoft.com](https://msdn.microsoft.com/en-us/library/b80153d8.aspx)\n\n### Clarity is Worth Fighting For ###\n\n+ More about levels of abstraction.\n+ A word on being clever.\n+ Using Visual Studio’s Extract “Extract Function”\n+ What a header file (.h) is.\n+ What’s refactoring, and why we do it.\n+ Removing side-effects.\n+ Where to find the course code. [UnrealCourse](http://www.unrealcourse.com/) \u0026 [Github.com](https://github.com/UnrealCourse)\n\nEncapsulate for-loop in PlayGame() to clean up main():\n\n```cpp\nvoid PrintIntro();\nvoid PlayGame():\nstring GetGuessAndPrintBack();\n\nint main()\n{\n  PrintIntro ();\n  PlayGame ();\n\n  return 0; //Exit application\n}\n\nvoid PlayGame()\n{\n  // get a guess from player and loop for number of turns\n  constexpr int NUMBER_OF_TURNS = 5;\n  for (int i = 0; i \u003c NUMBER_OF_TURNS; i++)\n\t{\n\t\tGetGuessAndPrintBack();\n    cout \u003c\u003c endl;\n\t}\n}\n```\n\nAll functions should only do one thing - removing PrintBack from GetGuess:\n\n```cpp\nvoid PlayGame()\n{\n  // get a guess from player and loop for number of turns\n  constexpr int NUMBER_OF_TURNS = 5;\n  for (int i = 0; i \u003c NUMBER_OF_TURNS; i++)\n\t{\n\t\tGetGuess();\n    string Guess = GetGuess();\n    cout \u003c\u003c \"Your guess was: \" \u003c\u003c Guess \u003c\u003c endl;\n\t}\n}\n\nstring GetGuess()\n{\n  cout \u003c\u003c \"Enter your guess: \";\n  string Guess = \"\";\n  getline(cin, Guess);\n  return Guess;\n}\n```\nTo rename all instances of a function identifier in VisualStudio, select it and press **CTRL+R** twice!\n\n### Booleans and comparisons ###\n\n+ What a boolean is, and how to use it.\n+ Only use when completely clear what you mean.\n+ Use **==** for comparison.\n+ Use **\u0026\u0026** for logical AND.\n+ Use **||** for logical OR.\n+ Use **[n]** to access a string, starting at n=0.\n+ Use **‘ ‘** for characters, and **“ “** for strings.\n\nAdd true/false boolean for asking to restart the game after a completed run.\n\n```cpp\nvoid PrintIntro();\nvoid PlayGame():\nstring GetGuessAndPrintBack();\nbool AskToPlayAgain();\n\nint main()\n{\n  PrintIntro ();\n  PlayGame ();\n  AskToPlayAgain();\n\n  return 0; //Exit application\n}\n\nbool AskToPlayAgain()\n{\n  cout \u003c\u003c \"Do you want to play again? y/n \";\n  string Response = \"\";\n  getline(cin, Response);\n\n  return (Response[0] == 'y') || (Response[0] = 'Y');\n}\n```\n\nResponse[0] takes the first character from the Response string. Compare to character y/Y and return true or false.\n\n### Using do and while in C++ ###\n\n+ A **do while** loop is: do {code to repeat} while (condition);\n+ A do/while code is always executed at least once and repeated until the condition is reached.\n+ Making our game play multiple times.\n\n```cpp\nint main()\n{\n  bool bPlayAgain = false;\n\n  do\n  {\n    PrintIntro ();\n    PlayGame ();\n    bPlayAgain = AskToPlayAgain();\n  }\n\n  while (bPlayAgain);\n\n  return 0;\n}\n```\n\nThe boolean bPlayAgain is set to **false** at the beginning of the loop - AskToPlayAgain sets it to **true** if player types \"yes\".\nThe do/while loop is repeated until while is set to false.\n\n### Introducing Classes ###\n\n+ Lookup the Turing machine.\n+ A quick overview of the MVC pattern.\n+ User defined types (classes).\n+ About working at an interface level (black box).\n+ An overview of class **FBullCowGame**\n\n### Using Header Files as Contracts ###\n\n+ Introducing .h header files in C++.\n+ Why the added complexity is worth it.\n+ Defining the interface to our class.\n+ Writing our first draft of FBullCowGame.\n\n```cpp\n#pragma once\n#include \u003cstring\u003e\n\nclass FBullCowGame\n{\npublic:\n  void Reset();\n  int GetMaxTries();\n  int GetCurrentTry();\n  bool IsGameWon();\n  bool CheckGuessValidity(std::string);\n\nprivate:\n  int MyCurrentTry;\n  int MyMaxTries;\n}\n```\n\n### Including Our Own Header File ###\n\n+ NEVER use using namespace in a .h\n+ In fact, why use it at all?\n+ Create your .cpp files and **#include**\n+ Don’t create chains of includes.\n\nRemove **using namespace std;** from main.cpp - add std:: to all instances of cout, cin, string, endl, getline\n\nAdd *.cpp file to header - select void Reset(); right-click it, choose Quick-Action and Create Definition - this creates FBullCowGame.cpp. Repeat this for all methods in header file:\n\n```cpp\n#include FBullCowGame.h\n\nvoid FBullCowGame::Reset()\n{\n  return;\n}\n\nint FBullCowGame::GetCurrentTry()\n{\n  return 0;\n}\n\nint FBullCowGame::GetMaxTries()\n{\n  return 0;\n}\n\nbool FBullCowGame::IsGameWon()\n{\n  return false,\n}\n\nvoid FBullCowGame::CheckGuessValidity(std::string)\n{\n  return false;\n}\n```\n\n### Instantiating Your Class ###\n\n+ Relax, they’re just user defined types!\n+ string FirstName; creates a string object\n+ FBullCowGame BCGame; works the same way\n+ These instances are initialised by “constructors”\n+ Instantiating means “creating an instance of”\n+ So we’re simply creating a FBullCowGame game instance \"BCGame\".\n\n```cpp\n#include \"FBullCowGame.h\"\n\nint main()\n{...}\n\nvoid PlayGame()\n{\n  FBullCowGame BCGame;\n\n  constexpr int NUMBER_OF_TURNS = 5;\n  for (int i = 0; i \u003c NUMBER_OF_TURNS; i++)\n  {\n    std::string Guess = GetGuess();\n    std::cout \u003c\u003c \"Your guess was: \" \u003c\u003c Guess \u003c\u003c std::endl;\n    std::cout \u003c\u003c std::endl;\n  }\n}\n```\n\n### Writing \u0026 Using Getter Methods ###\n\n+ Use GetMaxTries to GET number of turns / maxTries\n+ Why we never access variables directly\n+ How to call a method using the dot operator\n+ Pros and cons of initializing in at compile time\n+ Using “Rebuild Project” to make VS behave!\n\nInitialize MyMaxTries/MyCurrentTry in FBullCowGame.h at compile time (will later be moved into constructor):\n\n**FBullCowGame.h**\n```cpp\nclass FBullCowGame {\npublic: ...\nprivate:\n\tint MyCurrentTry = 1;\n\tint MyMaxTries = 5;\n};\n```\n\nUse GetMaxTries/GetCurrentTry Method to access MyMaxTries/MyCurrentTry:\n\n**FBullCowGame.cpp**\n```cpp\nint FBullCowGame::GetMaxTries() { return MyMaxTries; }\nint FBullCowGame::GetCurrentTry() { return MyCurrentTry; }\n```\n\nMove the game Instantiating outside of the scope of PlayGame();, so the game instance becomes globally available to all following methods\nUse MyMaxTries in main.cpp instead of adding the \"magic number\" NUMBER_OF_TURNS.\nAdd MyCurrentTry in GetGuss();\n\n**main.cpp**\n```cpp\nFBullCowGame BCGame;\n\nint main()\n{...}\n\nvoid PlayGame()\n{\n\n  BCGame.GetMaxTries();\n\n  int MaxTries = BCGame.GetMaxTries();\n  for (int i = 0; i \u003c MaxTries; i++)\n  {\n    std::string Guess = GetGuess();\n    std::cout \u003c\u003c \"Your guess was: \" \u003c\u003c Guess \u003c\u003c std::endl;\n    std::cout \u003c\u003c std::endl;\n  }\n}\n\nstd::string GetGuess()\n{\n\tint CurrentTry = BCGame.GetCurrentTry();\n\n\tstd::cout \u003c\u003c \"Try \" \u003c\u003c BCGame.GetCurrentTry() \u003c\u003c \". Enter your guess: \";\n\tstd::string Guess = \"\";\n\tstd::getline(std::cin, Guess);\n\n\treturn Guess;\n}\n```\n\n### Introducing the Const Keyword ###\n\n+ **const**’s meaning depends on context\n+ Generally means “I promise not to change this”\n+ What this is depends on exactly where it appears\n+ At the end of a member function, for example **int GetCurrentTry() const;** it prevents the function from modifying any member variables\n+ This is a good safety feature.\n\nBy adding const at the end of a member function of a class, the variable is set at **compile time** and cannot be changed by the member function at **runtime** -\u003e changing value of MyMaxTries = 12 somewhere inside the class member function will now result in an Error: int FBullCowGame::GetMaxTries() const { MyMaxTries = 12; return MyMaxTries; }\n\n**FBullCowGame.h**\n```cpp\nint GetMaxTries() const;\nint GetCurrentTry() const;\nbool IsGameWon() const;\n```\n\n**FBullCowGame.cpp**\n```cpp\nint FBullCowGame::GetMaxTries() const { return MyMaxTries; }\nint FBullCowGame::GetCurrentTry() const { return MyCurrentTry; }\n\nbool FBullCowGame::IsGameWon() const\n{\n\treturn false;\n}\n```\n\n### Constructors For Initialisation ###\n\n+ Default constructor called when object created\n+ Initialize in constructor when decided at runtime\n+ Initialize in declaration if known at compile time\n+ Constructor syntax simply: **ClassName()**;\n+ Set the member variables in constructor\n+ Test this has worked.\n\nAdd constructor function to headerfile and move private variable Initialization to constructor in FBullCowGame.cpp - before they were initialized at compile time. the constructor now initializes them at runtime. Adding private: int MyCurrentTry = 666; in headerfile will now be overwritten by constructor at runtime!\n\n**FBullCowGame.h**\n```cpp\nclass FBullCowGame {\npublic:\n\tFBullCowGame(); // constructor initialize state at BCGame\n  ...\nprivate:\n  // see FBullCowGame constructor for initialization\n  int MyCurrentTry;\n\tint MyMaxTries;\n}\n```\n\n**FBullCowGame.cpp**\n```cpp\nFBullCowGame::FBullCowGame() // constructor initialize state at BCGame start\n{\n  int MyCurrentTry = 1;\n\tint MyMaxTries = 5;\n}\n```\n\nMyCurrentTry and MyMaxTries are now no longer set at compile time - can be BCGame.Reset() at the end of a game to allow the player to play again:\n\n**main.cpp**\n```cpp\nvoid PlayGame()\n{\n\tBCGame.Reset();\n\tint MaxTries = BCGame.GetMaxTries();\n\n\t// loop for the number of turns asking guesses\n\tfor (int i = 0; i \u003c MaxTries; i++)\n\t{\n\t\tstd::string Guess = GetGuess();\n\t\tstd::cout \u003c\u003c \"Your guess was: \" \u003c\u003c Guess \u003c\u003c std::endl;\n\t\tstd::cout \u003c\u003c std::endl;\n\t}\n}\n```\n\nThe constructor should also just call the Reset() and set the runtime default values:\n\n**FBullCowGame.cpp**\n```cpp\nFBullCowGame::FBullCowGame() { Reset(); }\n\nvoid FBullCowGame::Reset()\n{\n\tconstexpr int MAX_TRIES = 5;\n\n\tMyMaxTries = MAX_TRIES;\n\tMyCurrentTry = 1;\n\n\treturn;\n}\n```\n\n### Pseudocode Programming ###\n\n+ More on Pseudocode Programming Practice (PPP)\n+ Reviewing our code and architecture\n+ Using **// TODO** as a comment prefix\n+ Introducing Visual Studio’s Task List: View/Task List -\u003e all your TODOs show up in that list\n+ Planning our next wave of coding.\n\n**main.cpp**\n```cpp\nvoid PlayGame()\n{\n\tBCGame.Reset();\n\tint MaxTries = BCGame.GetMaxTries();\n\n\t// loop for the number of turns asking guesses\n\t// TODO change from for- to while-loop once we use try validation\n\tfor (int i = 0; i \u003c MaxTries; i++)\n\t{\n\t\tstd::string Guess = GetGuess(); // TODO make loop check validity\n\n\t\t// submit only valid guesses to the game\n\t\t// print number of bulls and cows\n\t\tstd::cout \u003c\u003c \"Your guess was: \" \u003c\u003c Guess \u003c\u003c std::endl;\n\t\tstd::cout \u003c\u003c std::endl;\n\t}\n\t// TODO Summarize game\n}\n```\n\n### Using using for Type Aliases ###\n\n+ We’re substituting types to be “Unreal ready”\n+ The declaration is **using \\\u003calias\\\u003e = \\\u003ctype\\\u003e;**\n+ For example **using int32 = int;**\n+ Why Unreal uses **int32** rather than **int**\n+ **FText** is for output, **FString** is “mutable”\n+ Where to use each type of string\n+ Map **FText** and **FString** to **std::string**\n\n### Using struct for Simple Types ###\n\n+ **struct** is almost identical to **class**\n+ It’s member variables (data) is public by default\n+ Ideal for simple value types like **BullCowCount**\n+ Outline **BullCowCount SubmitGuess(FString)**\n\n### Using if Statements in C++ ###\n\n+ Why we need conditionals (selection)\n+ Use **if** when it reads better (e.g. few conditions)\n+ Use **switch** for multiple, simple conditions\n+ (for loads of statements consider a table lookup)\n+ The syntax of an **if** statement\n+ Using **if** to write count bulls and cows.\n\n### Debugging 101 ###\n\n+ A very brief intro to Visual Studio’s debugger\n+ Set a break-point by clicking in margin\n+ Watch values by highlighting in debug mode\n+ Use “Continue” to cycle back to breakpoint.\n\n### A Place for Everything ###\n\n+ Centralising the hidden word length\n+ Making this a property of the game class\n+ Writing a getter to access this value\n+ Updating our intro to vary with word length.\n\n### Introducing enumerations ###\n\n+ An **enum**erated type consists of named values\n+ Use instead of coded meaning\n+ Makes the code more readable and meaningful\n+ Only defined values can be used - more robust\n+ A benefit of C++ 11’s strongly typed enums\n+ Creating an **enum class** for error checking.\n\n### Writing Error Checking Code ###\n\n+ Use **else if** for the first time\n+ Outline or **CheckGuessValidity()** method\n+ Write working code for checking guess length\n+ Use the debugger to test the return values.\n\n### Using switch Statements ###\n\n+ Use our error values to communicate with user\n+ All our user interaction is via **GameManager.cpp**\n+ We’ll use **FText** in this file, as it’s UI text\n+ We can “switch” what we say based on the error\n+ The syntax of a **switch** statement\n+ Remember your **break** keywords!\n\n### Warm Fuzzy Feelings ###\n\n+ _Don’t_ get comfortable with compiler warnings\n+ Refactor **GetValidGuess()** to remove warning\n+ Rename **SubmitGuess()** to **SubmitValidGuess()**\n+ Improve readability of **SubmitValidGuess()**\n+ Get a warm fuzzy feeling!\n\n### Handling Game Win Condition ###\n\n+ Change our **PlayGame()** loop to a **while**\n+ Implement our **IsGameWon()** function\n\n### Win or Lose \"Screen\" ###\n\nWrite a method to print a game summary to the screen once the game is over.\n\n### Introducing Big O Notation ###\n\n+ Algorithm: the recipe for solving a problem\n+ or: 45th US Vice President’s dance style\n+ Introducing the complexity of algorithms\n+ A quick introduction to “Big O” notation\n+ Comparing three ways of checking for isograms.\n\n### TMap and map Data Structures ###\n\n+ The importance of knowing your data types\n+ Introducing the **std::map** data type\n+ **#define TMap std::map** to keep it ‘Unreal’\n+ How we’ll be using the map\n+ **TMap\\\u003cchar, bool\\\u003e LetterSeen;** to declare\n+ Using **LetterSeen[Letter]** to access\n+ Wiring-up and pseudocoding **IsIsogram()**\n\n### Range-based for Loop ###\n\n+ Introducing containers and iterators\n+ Using a range-based for loop in Unreal\\*\n+ Gently introducing the auto keyword\n+ Finishing our IsIsogram()\n\n**Useful Links**\n\n+ \\* [Unreal Engine - Ranged Based For Loops](https://www.unrealengine.com/blog/ranged-based-for-loops)\n\n### Design a Helper Function ###\n\n+ Gain confidence with a multi-stage challenge\n+ A word on implicit dependencies\n\n### Playtesting Your Game ###\n\n+ Having someone else play test your game is vital\n+ Silently take notes, or record screen if possible\n+ Immediately go away and fix obvious bugs\n+ For improvements consider 2nd or 3rd opinion\n+ Repeat until the bug / issue rate plateaus.\n\n### Difficulty \u0026 Play Tuning ###\n\n+ About the flow channel\\*\n+ **map** word length to max tries\n+ Play test to determine correct difficulty.\n\n**Useful Links**\n\n+ \\* Read more in [Sylvester, T. Designing Games - O’Reilly](https://www.amazon.com/dp/B00AWKX1FO/)\n\n### Polishing \u0026 Packaging ###\n\n+ First impressions count (think reviews)\n+ Don’t ship a half-baked product, even if digital\n+ Check through your code (polish)\n+ Ship to your customers (package).\n\n### Section 2 Wrap-Up ###\n\n+ HUGE congratulations on your progress\n+ Over 5 hours of pure C++ learning\n+ Over 30 challenges you’ve completed\n+ The journey has only just begun\n+ Share your source code for others to play\n+ Here are some suggested improvements\n+ Next we take the game logic into Unreal :-)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmpolinowski%2Fconsoleapplication","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmpolinowski%2Fconsoleapplication","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmpolinowski%2Fconsoleapplication/lists"}