diff --git a/lab3/app/Main.hs b/lab3/app/Main.hs index 38f4296..55a622c 100644 --- a/lab3/app/Main.hs +++ b/lab3/app/Main.hs @@ -22,6 +22,7 @@ main = do let sourceTextPath = "resources/biography.txt" let sourceImagePath = "resources/david.bmp" + let alphabetPath = "tmp/alphabet.txt" let encryptedTextPath = "tmp/biography_encrypted.txt" let encodedImagePath = "tmp/david_" ++ show bitsPerByte ++ "_" ++ show caesarShift ++ ".bmp" let decodedTextPath = "tmp/biography.txt" @@ -33,6 +34,8 @@ main = do putStrLn "\nШифрование текста" let alphabet = createAlphabetFromText inputText putStrLn $ "Размер алфавита: " ++ show (length alphabet) + writeFile alphabetPath alphabet + putStrLn $ "Алфавит сохранён в файл \"" ++ alphabetPath ++ "\"" let encryptedText = encryptCaesar alphabet caesarShift inputText putStrLn $ "10 символов шифра: \"" ++ take 10 encryptedText ++ "\"" writeFile encryptedTextPath encryptedText