Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace tane_superior_sr3
- {
- class Helper
- {
- public static bool ShutdownChecker()
- {
- int initResp = (int)default;
- bool success = (bool)default;
- bool response = (bool)default;
- while (!success)
- {
- initResp = IntReader();
- if (initResp == 1)
- {
- success = true;
- response = false;
- }
- else
- {
- if (initResp == 2)
- {
- success = true;
- response = true;
- }
- else Console.WriteLine("Incorrect input, try again");
- }
- }
- return response;
- }
- public static int IntReader()
- {
- int num = (int)default;
- bool success = (bool)default;
- while (!success)
- {
- if (int.TryParse(Console.ReadLine(), out num) && num > 0 && num < 69420)
- {
- success = true;
- }
- else
- {
- Console.WriteLine("Incorrect input, try again");
- }
- }
- return num;
- }
- }
- class Cat
- {
- public static Random rng = new Random();
- string name;
- public string meow;
- string[] meowArray = new string[7]{"meow", "Meow.", "mEOW", "nigga", "le meau", "myat", "Epstein didnt kill himself"};
- public Cat(int n)
- {
- name = $"Cat{n+1}";
- int sample = rng.Next(0, n);
- meow = this[sample];
- }
- public string this[int index]
- {
- get
- {
- string kostyl = null;
- try
- {
- kostyl = meowArray[index];
- }
- catch(Exception ex)
- {
- Console.WriteLine(ex);
- }
- return kostyl;
- }
- }
- }
- class Program
- {
- static void Main(string[] args)
- {
- bool shutdown = (bool)default;
- while (!shutdown)
- {
- Console.WriteLine("enter N");
- int n = Helper.IntReader();
- Cat[] kittyArray = new Cat[n];
- for (int i = 0; i < n; i++)
- kittyArray[i] = new Cat(i);
- Console.WriteLine("kote myaukayut \n");
- for (int i = 0; i < n; i++)
- Console.WriteLine($"{kittyArray[i].meow}\n");
- Console.WriteLine("Continue? 1 to proceed, 2 to exit");
- shutdown = Helper.ShutdownChecker();
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement