
6 Dec
2009
6 Dec
'09
2:46 p.m.
On Sat, Dec 5, 2009 at 10:02 PM, ??????? ??????
fct a n = (snd $ break (==a) ['a'..'z']) !! n
Not bad but you forgot that it might need to wrap around, besides break isn't really the best function to use here since we don't need the first part of the pair :
shift n ch = dropWhile (/=ch) (cycle ['a'..'z']) !! n
Still I think the ord and mod version will be faster. -- Jedaï