3 ms·
Erlang FizzBuzz Showdown (Part 2): Transferring PHP/Ruby/Python to Erlang
Following on from yesterday's guide to transferring skills from PHP/Ruby/Python over to Erlang
- draegtun 17y agoAlways had a fondness for this FizzBuzz in Perl... use List::Enumerator qw/E/; my $fizzbuzz = E(1)->countup ->zip( E("", "", "Fizz")->cycle, E("", "", "", "", "Buzz")->cycle ) ->map( sub { my ($n, $fizz, $buzz) = @$_; $fizz . $buzz || $n; }); $fizzbuzz->take(20)->each(sub { say $_; });