We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The cipher code doesn't cycle around the letters when for example "zZ" is inputted as the string: it instead goes to the next unicode letters.
While a function using ord/chr and mods is feasible, I instead just used a recursive function that used a large number of guard blocks:
enumCipher :: String -> Int -> String enumCipher str shift | shift < 0 = enumCipher str (mod (26 - shift) 26) | shift > 26 = enumCipher str (mod shift 26) | shift == 0 = str | otherwise = enumCipher (map shiftFunc str) (shift - 1) where shiftFunc chr | chr == 'z' = 'a' | chr == 'Z' = 'A' | otherwise = succ chr
The text was updated successfully, but these errors were encountered:
No branches or pull requests
The cipher code doesn't cycle around the letters when for example "zZ" is inputted as the string: it instead goes to the next unicode letters.
While a function using ord/chr and mods is feasible, I instead just used a recursive function that used a large number of guard blocks:
The text was updated successfully, but these errors were encountered: