Hi all,
I am having troubles understanding the user input part. Below is my code, which is basically copy-paste from the tutorial video, with a few slight modifications and it works just fine. Nonetheless, being quite new to programming with C# and having only practiced on console programs up until now, I am used to a different type of procedure to retrieve an user input. I would be using the following command:
string userInput = Console.ReadLine();
The variable userInput, I could then use in an if loop and trigger an adequate reaction.
In our tutorial code however, I do not understand exactly how the input “retrieval” is taking place. We define a method called OnUserInput and a string type variable called input. But to me it is not really clear how the actual input from the user is saved into our variable input. For all I know, we could call the variable cucumber. Is there any hidden method / function running in the background, or what else am I missing here? Could you help me out please? Much appreciated!
Looking forward to hearing from you!
Best Regards,
Ilmay