Thursday, December 20, 2012

Fizz Buzz in APL

I came across the Fizz Fuzz programmers test and just couldn't help myself programming it in APL:

p←0=3 5∘.|l←i←⍳100
l[,p[1;]/i]←⊂'Fizz'
l[,p[2;]/i]←⊂'Fuzz'
l[(,∧⌿p)/i]←⊂'Fizz Buzz'

And that is the way it is done (the code is self explanatory :))


http://www.codinghorror.com/blog/2007/02/why-cant-programmers-program.html

No comments:

Post a Comment