コード例 #1
0
ファイル: TopicMet.cs プロジェクト: stone1234765/Flashcards
 public bool FindOrCreateTopic()
 {
     Topic     = userInteractor.QuestionAnswer("Write a need topic");
     PathTopic = $"{PathAllTopics}\\{Topic}\\Flashcards.json";
     fileMaster.CreateDirectory($"{PathAllTopics}\\{Topic}");
     foreach (var topic in topics)
     {
         if (topic == Topic)
         {
             return(true);
         }
     }
     topics.Add(Topic);
     return(false);
 }
コード例 #2
0
 private void BadStudy(TypesOfStudy typeOfTranslation, Random rand)
 {
     while (true)
     {
         var(question, answer, transcription) = FindNeedCardData(typeOfTranslation, rand);
         var word = userInteractor.QuestionAnswer(question);
         if (word == answer)
         {
             userInteractor.WriteLine("You are right");
         }
         else
         {
             userInteractor.WriteLine("You are wrong");
         }
         var key = userInteractor.QuestionAnswerKey($"{answer},\n\r" +
                                                    $"tr - {transcription}");
         if (key == UserAction.Escape)
         {
             return;
         }
     }
 }