21 lines
717 B
Haskell
21 lines
717 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
|
|
let decryptedText = decryptCaesar alphabet caesarShift encryptedTextFromBits
|
|
putStrLn $ take 30 decryptedText |