Ask your own question, for FREE!
Computer Science 13 Online
OpenStudy (anonymous):

anypne here know about rot13?

OpenStudy (anonymous):

i have made a program for it

OpenStudy (anonymous):

but i have problems with inputting when its non alphabet

OpenStudy (usman1995):

whats a rot13

OpenStudy (e.mccormick):

@Usman1995 http://en.wikipedia.org/wiki/ROT13

OpenStudy (anonymous):

@omniscience it's difficult to point out the flaw in your logic without seeing your logic. That said, rather than using the numeric value of the letter when shifting, use the index of the original letter plus the distance/shift/K (13 in rot13) mod 26 to get the index of the replacement letter. For example, if you have a zero index list of letters abcdefghijklmnopqrstuvwxyz say the letter to be rotated is T. it's index is 18. add 13 to it to get 31, mod 26 equals 5 'F'

OpenStudy (anonymous):

and apparently the answer is actually G, but that's just because i was counting on my fingers, not because the logic is bad.

OpenStudy (anonymous):

and T was 19, not 18, that's where the actual error was, when i switched to counting on my toes.

OpenStudy (usman1995):

thanks @e.mccormick

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!