Jump to content

Chaocipher: Difference between revisions

m
m (→‎{{header|Haskell}}: Tidied one function in applicative terms.)
Line 858:
 
rotated :: Int -> [a] -> [a]
rotated n = take <$>. length <*> (drop n . cycle)
 
shifted :: Int -> Int -> [a] -> [a]
shifted src dst s = concat [x, rotated 1 y, b]
where
(a, b) = splitAt dst s
(x, y) = splitAt src a
 
 
encode = False
9,655

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.