public static void Main() { var primeStream = new PrimeStream(); var intStream = new IntStream(); var stringStream = new RandomWordStream(); Console.WriteLine("How many strings do you want to generate?"); Console.WriteLine("(Enter a number smaller than 1 to generate the entire stream)"); var input = Console.ReadLine(); int amount; if (!int.TryParse(input, out amount)) { Console.WriteLine("Invalid input!"); return; } if (amount <= 0) { while (!stringStream.Eos()) { Console.WriteLine("{0}) {1} characters: {2}", intStream.Next(), primeStream.Next(), stringStream.Next()); } } else { for (int i = intStream.Next(); i < amount; i++) { Console.WriteLine("{0}) {1} characters: {2}", intStream.Next(), primeStream.Next(), stringStream.Next()); } } }