Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Project
- {
- class Program
- {
- //bool[] isAlives = { true, false, true };
- static void Main(string[] args)
- {
- Random rnd = new Random();
- Console.WriteLine("Hello, write you question");
- string[] botAnswers = { "Yes", "No", "Maybe", "Lol", "50|50" };
- string userQuestion = Console.ReadLine();
- int randomIndex = rnd.Next(0, botAnswers.Length);
- int randomRightIndex = rnd.Next(0, botAnswers.Length);
- SetUpColor(botAnswers, randomIndex);
- Console.WriteLine(botAnswers[randomIndex]);
- string rightAnswer = SetRigthAnswer(botAnswers, randomRightIndex);
- Console.WriteLine($"Right answer equals {rightAnswer}");
- }
- static string SetRigthAnswer(string[] botAnswers, int randomIndex)
- {
- return botAnswers[randomIndex];
- }
- static void SetUpColor(string[] botAnswers, int randomIndex)
- {
- switch (botAnswers[randomIndex])
- {
- case "Yes":
- Console.ForegroundColor = ConsoleColor.Red;
- break;
- case "No":
- Console.ForegroundColor = ConsoleColor.Green;
- break;
- case "Maybe":
- Console.ForegroundColor = ConsoleColor.Blue;
- break;
- case "Lol":
- Console.ForegroundColor = ConsoleColor.Magenta;
- break;
- case "50|50":
- Console.ForegroundColor = ConsoleColor.Yellow;
- break;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment