I am currently working in an exercise to make a caesar cipher, but for to finish that i need to find items in a table. It's a table which is offset to right by 3 elements.
There is my table:
table :: [(Char, Char)]
table = zip ['a'..'z'] (['d'..'z'] ++ ['a'..'c'])
[('a','d'),('b','e'),('c','f'),('d','g'),('e','h'),('f','i'),('g','j'),('h','k'),('i','l'),('j','m'),('k','n'),('l','o'),('m','p'),('n','q'),('o','r'),('p','s'),('q','t'),('r','u'),('s','v'),('t','w'),('u','x'),('v','y'),('w','z'),('x','a'),('y','b'),('z','c')]
And I need to find an alphabetic character to give back it's pair. Like:
shift :: [(Char, Char)] -> Char -> Char
shift table 'z' ...
result:
shift table 'y'
'b'
I haven't find anything on books or on the internet, that's why i am asking. Thank you for your help!