Cypher

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

Question.cs (927B)


      1 using System;
      2 using System.Collections.Generic;
      3 using System.Linq;
      4 using System.Text;
      5 using System.Threading.Tasks;
      6 
      7 namespace Cypher
      8 {
      9     internal class Question
     10     {
     11         public string Questions(string text, bool exsis)
     12         {
     13             Console.WriteLine(text);
     14             string answer = Console.ReadLine();
     15             if (exsis)
     16             {
     17                 while (answer != null && File.Exists(answer) == false)
     18                 {
     19                     Console.WriteLine("You have not typed anything or you are specifying a file that does not exist");
     20                     answer = Console.ReadLine();
     21                 }
     22             }
     23             else
     24             {
     25                 while (answer == null)
     26                 {
     27                     Console.WriteLine("Plese type anything");
     28                     answer = Console.ReadLine();
     29                 }
     30             }
     31             return answer;
     32         }
     33     }
     34 }