in reply to Yet Another Rosetta Code Problem (Perl, Ruby, Python, Haskell, ...)
My take on solution in Erlang:
Shahzad Bhatti-module(rosetta). -compile(export_all). test() -> lists:reverse(lists:foldl(fun rosetta/2, [], "ZYEEEEEABBCCCDDDDF")). rosetta(H, [[H|T]|TT]) -> [[H,H|T]|TT]; rosetta(H, L) -> [[H]|L].
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Yet Another Rosetta Code Problem (Perl, Ruby, Python, Haskell, ...)
by Anonymous Monk on Sep 22, 2007 at 10:09 UTC |
In Section
Meditations