Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re^2: Yet Another Rosetta Code Problem (Perl, Ruby, Python, Haskell, ...)

by Anonymous Monk
on Sep 22, 2007 at 10:09 UTC ( #640507=note: print w/ replies, xml ) Need Help??


in reply to Re: Yet Another Rosetta Code Problem (Perl, Ruby, Python, Haskell, ...)
in thread Yet Another Rosetta Code Problem (Perl, Ruby, Python, Haskell, ...)

Another erlangish
-module(rosetta). -compile(export_all). test() -> rosetta("ZYEEEEEABBCCCDDDDF"). rosetta([H|T]) -> rosetta([], [H], T). rosetta(L, [H|_]=Act, [H|T1]) -> rosetta(L, [H|Act], T1); rosetta(L, Act, [H|T]) -> rosetta([Act|L], [H], T); rosetta(L, Act, []) -> lists:reverse([Act|L]).
maciek
  • Comment on Re^2: Yet Another Rosetta Code Problem (Perl, Ruby, Python, Haskell, ...)
  • Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://640507]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (5)
As of 2016-06-30 19:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My preferred method of making French fries (chips) is in a ...











    Results (403 votes). Check out past polls.