Cypher

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

commit 86a9aba6deba72f2dab84f461f842dd55a300588
parent 1ee987c4abbe91aaf239815a916ec2cd2b3410d5
Author: Minerva_juppiter <94231606+minerva-jupiter@users.noreply.github.com>
Date:   Mon, 25 Apr 2022 22:49:23 +0900


Diffstat:
MProgram.cs | 47++++++++++++++++++++++++++++++-----------------
1 file changed, 30 insertions(+), 17 deletions(-)

diff --git a/Program.cs b/Program.cs @@ -2,34 +2,47 @@ using System; using System.IO; + +string answers; Console.WriteLine("Hello world. I woke up."); -string answer; -answer = Question("What do you want to do?"); -while(answer != "help") -{ - Console.WriteLine("createKey is creating keyFile for Cryptography."); - Console.WriteLine("encrypt is encrypting the date file you want with created keyFile."); - Console.WriteLine("sort is sorting the encrypted file with keyFile."); -} -if(answer == "createKey") -{ - createKey(); -} -else +do{ + answers = Control(); +}while (answers != "end") ; + +static string Control() { - if(answer == "encrypt") + string answer; + answer = Question("What do you want to do?"); + if(answer == "help") { - encrypt(); + Console.WriteLine("createKey is creating keyFile for Cryptography."); + Console.WriteLine("encrypt is encrypting the date file you want with created keyFile."); + Console.WriteLine("sort is sorting the encrypted file with keyFile."); + } + + if(answer == "createKey") + { + createKey(); } else { - if(answer == "sort") + if(answer == "encrypt") + { + encrypt(); + } + else { - sort(); + if(answer == "sort") + { + sort(); + } } } + return answer; + answer = null; } + static string Question(string text) { Console.WriteLine(text);