Files
functional-programming/lab3/app/Main.hs
2024-11-17 20:10:32 +03:00

19 lines
599 B
Haskell

module Main (main) where
import Lib
caesarShift :: Int
caesarShift = 66
main :: IO ()
main = do
inputText <- readFile "resources/biography.txt"
putStrLn $ take 30 inputText
let alphabet = createAlphabetFromText inputText
putStrLn $ show (length alphabet)
let encryptedText = encryptCaesar alphabet caesarShift inputText
putStrLn $ take 30 encryptedText
let encryptedTextBits = textToBits encryptedText
putStrLn $ concat (take 30 (map show encryptedTextBits))
let encryptedTextFromBits = bitsToText encryptedTextBits
putStrLn $ take 30 encryptedTextFromBits