Anonymous user
Substitution cipher: Difference between revisions
m
→{{header|Haskell}}
Line 882:
shuffle 0 xs = xs
shuffle n xs = iterate go xs !! n
where
go xs = go (drop 2 xs) <> take 2 xs
convert :: [(Char, Char)] -> String -> String
Line 889 ⟶ 890:
convert m (x:xs) = case lookup x m of
Just c -> c : convert m xs
Nothing ->
runCommand :: Command -> String
|