Six years ago I publish on YouTube channel short video named “C# Tutorial 3: Game “Guess the number”. This video collected gigantic 797 views! This is absolute record on my channel and for this reason I decide write post to explain what going on in this tutorial.
Recipe: To make program from this video you will need Windows 7, 8, 10 computer and Visual Studio Community Edition.
What is Visual Studio: Visual Studio is IDE (integrated development environment), special program to create other programs in Windows environment. Visual Studio is industrial standard in Windows development sphere. If you want develop programs for Windows mostly probably you will be use Visual Studio.
What is Console application: Console application is apps running in terminal. If you read this text in Windows system use Win + R combination, then type “cmd” and click Enter. Windows open Terminal – boring black window.
Our app will be run in boring black window too. But we will coloring process by our fun and happy mood.
Process: What I do in this video. I create new console project, then I write code. I create two variables to save first number(number that player1 is set)and to save second number (number that player2 is guessed). For these purpose I use method Console.WriteLine() to output text in console to showing text to user, and I use method Console.ReadLine() to read value that player input from keyboard to console window. Then I use IF ELSE construction to check of match between number1 and number2.
That’s all. Thank you for reading/watching! See you soon