Skip to content

Instantly share code, notes, and snippets.

@EntaltsevSN
Created September 18, 2023 20:10
Show Gist options
  • Save EntaltsevSN/7fcf6263b0bb36d8c474c41e35fb58b4 to your computer and use it in GitHub Desktop.
Save EntaltsevSN/7fcf6263b0bb36d8c474c41e35fb58b4 to your computer and use it in GitHub Desktop.
Find a ball
bool[] thimbles = new bool[3] { false, true, false };
Console.WriteLine("Игра в наперстки");
Console.WriteLine();
Console.WriteLine("[1] [2] [3]");
Console.WriteLine();
Console.WriteLine("под одним из трех наперстков находится шарик. Попробуйте угадать в каком!");
Console.WriteLine();
Console.Write("Введите ваше число от 1 до 3: ");
int input = Convert.ToInt32(Console.ReadLine());
Console.WriteLine();
bool result = thimbles[input - 1];
if (result == true)
{
Console.WriteLine("Да! Вы нашли шарик!");
}
else
{
Console.WriteLine("Нет! Вы не угадали!");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment