Closed ghost closed 3 years ago
pr's are welcome
didn't know anyone will take interest over this simple project, I am a very beginner with Nim :sweat_smile: and this project was just meant for practice :sweat_smile:
btw, for the code, .. it was on purpose to be re-usable for other rotation ciphers, not only rot13
:blush:
I have accepted this change. Thank you very much for mentioning a better approach @Yardanico ...
I learned something from the code itself. :blush:
Rot13 is a straightforward algorithm - it basically shifts letters by 13 positions. Why not just use basic math over chars? An example from Rosetta Code https://rosettacode.org/wiki/Rot-13#Nim adapted to strings (and a bit optimized with preallocation):