// 2d massivi - UZD2 - Maksims Gutovs
using System;
class HelloWorld
{
  static void Main()
  {
    int par1; //skaits paroles
    int par2; //skaits simboli
    string par3;//lieli burti
    string par4;//cipori un simboli
    
    Console.Write("Ievadiet parolu SKAITU kas ir lielaks par 4: ");
    par1 = Convert.ToInt32(Console.ReadLine());
    if (par1 < 5)
        {
            Console.Write("Kluda - ievadits nekorekts skailtis");
            return;
        }
    Console.Write("Ievadiet GARAKO paroles simbolu skaitu, kas ir lielaks par 9: ");
    par2 = Convert.ToInt32(Console.ReadLine());
    if (par2 < 10)
        {
            Console.Write("Kluda - ievadits nekorekts skailtis");
            return;
        }
    
    Console.Write("Vajag lielos burtus simbolie, (y/n): ");
    par3 =Console.ReadLine();
    if (par3 == ("y") || par3 == ("n")) {}
    else
        {
            Console.Write("Kluda - ievadits nekorekts burts");
            return;
        }
    Console.Write("Vajag ciparus un simbolus simboliem, (y/n): ");
    par4 =Console.ReadLine();
    if (par4 == ("y") || par4 == ("n")) {}
    else
        {
            Console.Write("Kluda - ievadits nekorekts burts");
            return;
        }
    
    Random rnd = new Random();
    string type = par3+par4;
    int selectrndtype;
    string[] paroles = new string[par1];
    char[] saturs = new char[par2];
    
    for (int i = 0; i < paroles.Length; i++)
    {
        for (int j = 0; j < saturs.Length; j++)
        {
            switch(type)
            {
                case "yy":
                    selectrndtype = rnd.Next(0,2); //burts vai simbols
                    if (selectrndtype == 1)
                        {
                            selectrndtype = rnd.Next(0,2); //liels vai mazais
                            if (selectrndtype == 0) //lielais
                                {
                                    selectrndtype = rnd.Next(65,91);
                                }
                            else
                                {
                                    selectrndtype = rnd.Next(97,123);
                                }
                        }
                    else
                        {
                        selectrndtype = rnd.Next(0,3); // no kadas vietas no ASCI tabulas tik nemtas vertibas
                        if (selectrndtype == 0)
                            {
                                selectrndtype = rnd.Next(33,65); //no ! lidz @
                            }
                        else if (selectrndtype == 1)
                            {
                                selectrndtype = rnd.Next(91,97); //no [ lidz `
                            }
                        else
                            {
                                selectrndtype = rnd.Next(123,127); //no { lidz ~
                            }
                        }
                    saturs[j] = ((char)selectrndtype);
                    break;
                case "nn":
                    selectrndtype = rnd.Next(97,123);
                    saturs[j] = ((char)selectrndtype);
                    break;
                case "yn":
                    selectrndtype = rnd.Next(0,2); //liels vai mazais
                    if (selectrndtype == 0) //lielais
                        {
                            selectrndtype = rnd.Next(65,91);
                        }
                    else
                        {
                            selectrndtype = rnd.Next(97,123);
                        }
                    saturs[j] = ((char)selectrndtype);
                    break;
                case "ny":
                    selectrndtype = rnd.Next(0,2); //burts vai simbols
                    if (selectrndtype == 1)
                        selectrndtype = rnd.Next(97,123);
                    else
                        {
                        selectrndtype = rnd.Next(0,3); // no kadas vietas no ASCI tabulas tik nemtas vertibas
                        if (selectrndtype == 0)
                            {
                                selectrndtype = rnd.Next(33,65); //no ! lidz @
                            }
                        else if (selectrndtype == 1)
                            {
                                selectrndtype = rnd.Next(91,97); //no [ lidz `
                            }
                        else
                            {
                                selectrndtype = rnd.Next(123,127); //no { lidz ~
                            }
                        }
                    saturs[j] = ((char)selectrndtype);
                    break;
            }
        }
        for (int j = 0; j < saturs.Length; j++)
        {
            paroles[i] += saturs[j];
        }
    }
    int numurs = 0;
    foreach (string i in paroles)
    {
        numurs += 1;
        Console.WriteLine($"{numurs}. parole: {i}");
    }
  }
}