Console.WriteLine("The goal of this game is to crack the (randomly) generated Code of which the Length will the determined by the chosen difficulty.\nIn this tutorial the Code will have a length of 4.\n Start by guessing 4 different Numbers with the Range 0 - 9 (0 and 9 are included).");
foreach(intnintutorialGuess)//fill array that saves guesses of the user
{
intinput=0;
intinput=0;//used for user input
boolret_1=false;
do
{
ret_1=int.TryParse(Console.ReadLine(),outinput);
if(ret_1)//ret_1 is a bool, when false if is false; when true if is true
ret_1=int.TryParse(Console.ReadLine(),outinput);//check if user input a number
if(ret_1==false||input.ToString().Length!=1)//check if user input is a number and if it is a single digit
{
ret_1=true;
tutorialGuess[n]=input;
Console.WriteLine("Please write a single number between 0 and 9.");//if user didn't input Number --> display message to guide User
}
Console.WriteLine("Please Write a Number between 0 and 9.");
}
while(ret_1);//ret_1 is a bool, when false if is false; when true if is true
while(ret_1==false);//repeat if user didn't input a Number
//when user did input a Number --> write in array that saves user input