Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def reflectString(inputString)
- string_length = inputString.length
- x = 0
- outputString = ""
- while (x < string_length)
- if inputString[x] == 'a' then
- outputString[x] = 'z'
- end
- if inputString[x] == 'b' then
- outputString[x] = 'y'
- end
- if inputString[x] == 'c' then
- outputString[x] = 'x'
- end
- if inputString[x] == 'd' then
- outputString[x] = 'w'
- end
- if inputString[x] == 'e' then
- outputString[x] = 'v'
- end
- if inputString[x] == 'f' then
- outputString[x] = 'u'
- end
- if inputString[x] == 'g' then
- outputString[x] = 't'
- end
- if inputString[x] == 'h' then
- outputString[x] = 's'
- end
- if inputString[x] == 'i' then
- outputString[x] = 'r'
- end
- if inputString[x] == 'j' then
- outputString[x] = 'q'
- end
- if inputString[x] == 'k' then
- outputString[x] = 'p'
- end
- if inputString[x] == 'l' then
- outputString[x] = 'o'
- end
- if inputString[x] == 'm' then
- outputString[x] = 'n'
- end
- if inputString[x] == 'n' then
- outputString[x] = 'm'
- end
- if inputString[x] == 'o' then
- outputString[x] = 'l'
- end
- if inputString[x] == 'p' then
- outputString[x] = 'k'
- end
- if inputString[x] == 'q' then
- outputString[x] = 'j'
- end
- if inputString[x] == 'r' then
- outputString[x] = 'i'
- end
- if inputString[x] == 's' then
- outputString[x] = 'h'
- end
- if inputString[x] == 't' then
- outputString[x] = 'g'
- end
- if inputString[x] == 'u' then
- outputString[x] = 'f'
- end
- if inputString[x] == 'v' then
- outputString[x] = 'e'
- end
- if inputString[x] == 'w' then
- outputString[x] = 'd'
- end
- if inputString[x] == 'x' then
- outputString[x] = 'c'
- end
- if inputString[x] == 'y' then
- outputString[x] = 'b'
- end
- if inputString[x] == 'z' then
- outputString[x] = 'a'
- end
- x = x + 1
- end
- return outputString
- end
Advertisement
Add Comment
Please, Sign In to add comment