Created
September 18, 2023 20:10
-
-
Save EntaltsevSN/7fcf6263b0bb36d8c474c41e35fb58b4 to your computer and use it in GitHub Desktop.
Find a ball
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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