49 lines
1.6 KiB
C#
49 lines
1.6 KiB
C#
namespace esconde_esconde;
|
|
|
|
class Program
|
|
{
|
|
static void Main()
|
|
{
|
|
Console.WriteLine("Qual o seu nome?");
|
|
string? nome = Console.ReadLine();
|
|
Console.WriteLine(" Vamos jogar um jogo,escreva o numero SECRETO DE 0 ATÉ 20");
|
|
int numerosecreto = 7;
|
|
int numerodousuario = int.Parse(Console.ReadLine());
|
|
while (numerodousuario != numerosecreto)
|
|
{
|
|
if (numerodousuario <= 5)
|
|
{
|
|
Console.ForegroundColor = ConsoleColor.Red;
|
|
Console.WriteLine("BAIXO");
|
|
}
|
|
|
|
if (numerodousuario == 6)
|
|
{
|
|
Console.ForegroundColor = ConsoleColor.Green;
|
|
Console.WriteLine("BAIXINHO");
|
|
}
|
|
|
|
if (numerodousuario == 8)
|
|
{
|
|
Console.ForegroundColor = ConsoleColor.Green;
|
|
Console.WriteLine("ALTINHO");
|
|
}
|
|
|
|
if (numerodousuario >= 9)
|
|
{
|
|
Console.ForegroundColor = ConsoleColor.Red;
|
|
Console.WriteLine("ALTO");
|
|
}
|
|
|
|
Console.ForegroundColor = ConsoleColor.DarkRed;
|
|
Console.WriteLine("ERROU, TENTE DENOVO ,por favor");
|
|
Console.ForegroundColor = ConsoleColor.White;
|
|
numerodousuario = int.Parse(Console.ReadLine());
|
|
}
|
|
if (numerodousuario == numerosecreto)
|
|
{
|
|
Console.ForegroundColor = ConsoleColor.DarkGreen;
|
|
Console.WriteLine($"PARABENS,{nome} ACERTOU O NUMERO SECRETO");
|
|
}
|
|
}
|
|
} |