示例#1
0
文件: rws.cs 项目: kopciuch97/II-UWr
 public new string next()
 {
     if (poprzedni == int.MaxValue)
     {
         return("Error");
     }
     poprzedni += 1;
     while (!prime(poprzedni) && poprzedni < int.MaxValue)
     {
         poprzedni += 1;
     }
     if (poprzedni == int.MaxValue)
     {
         return("Error");
     }
     else
     {
         string x = "";
         for (int i = 0; i < poprzedni; i++)
         {
             x += RandomLetter.GetLetter();
         }
         return(x);
     }
 }
示例#2
0
 public string next()
 {
     if (val == int.MaxValue)
     {
         return("Blad");
     }
     val += 1;
     while (!prime(val) && val < int.MaxValue)//szukanie dlugosci wyrazu bedacej liczba pierwsza
     {
         val += 1;
     }
     if (val == int.MaxValue)
     {
         return("Blad");
     }
     else
     {
         string word = "";
         for (int i = 0; i < val; i++)
         {
             word += RandomLetter.GetLetter();//dodawanie losowych liter do stringa
         }
         return(word);
     }
 }