TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Erlang FizzBuzz Showdown (Part 2): Transferring PHP/Ruby/Python to Erlang

10 pointsby rudenoiseabout 16 years ago
Following on from yesterday's guide to transferring skills from PHP/Ruby/Python over to Erlang

1 comment

draegtunabout 16 years ago
Always had a fondness for this FizzBuzz in Perl...<p><pre><code> use List::Enumerator qw/E/; my $fizzbuzz = E(1)-&#62;countup -&#62;zip( E("", "", "Fizz")-&#62;cycle, E("", "", "", "", "Buzz")-&#62;cycle ) -&#62;map( sub { my ($n, $fizz, $buzz) = @$_; $fizz . $buzz || $n; }); $fizzbuzz-&#62;take(20)-&#62;each(sub { say $_; });</code></pre>