You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
//Console.WriteLine and Console.Write are the same thing but with the first "command" uses the whole line
31
+
Console.WriteLine(titolo);//prints on the console the string titolo
32
+
Console.Title="Calabrese#0001 - Pronto";//changes console's title
33
+
Console.BackgroundColor=ConsoleColor.DarkGreen;//changes font color
34
+
Console.Write("Numero >");//prints on the screen "Numero >" (translated into english: Number >)
35
+
Console.BackgroundColor=ConsoleColor.Black;//resets font color
36
+
37
+
Console.Write(" ");//prints space on the console for the input
38
+
longa=Convert.ToInt64(Console.ReadLine());//listens for input, long (integer) "a" will become the number you'll type
39
+
Console.Clear();//clears the console from texts
40
+
Console.BackgroundColor=ConsoleColor.DarkGreen;//changes font color
41
+
Console.WriteLine("Caricamento...");//prints "Caricamento..." on the console (translated in english: Loading...)
42
+
Console.BackgroundColor=ConsoleColor.Black;//resets font color
43
+
Thread.Sleep(1000);//took from System.Threading declared at the top of the code, it makes the program wait 1000 ms (1s) making the loading... effect
44
+
Console.Clear();//clears the console from texts
45
+
if(a<0||a==0)//this boolean expression (it means that can return True [happened] or False [Didn't happen]) checks if the number you typed is negative or equal to zero
46
+
{
47
+
Console.BackgroundColor=ConsoleColor.DarkRed;//changes font color
48
+
Console.Write("Coglione il numero deve essere positivo e diverso da zero!");//prints on the console an italian expression to say "you did something wrong" because we don't wanna that the number we typed go under 0
49
+
Console.ReadKey();//waits for user key (enter, space...)
50
+
return;//it stops the program process
51
+
}
52
+
Console.BackgroundColor=ConsoleColor.DarkCyan;//changes font color
53
+
Console.WriteLine(a);//writes the number you typed
54
+
Console.BackgroundColor=ConsoleColor.Black;//resets font color
0 commit comments