7 ms·
If you like this may I also recommend [0] which has fizzbuzz in: Java, VBA, php, cobol, forth, C++, brainfuck, python, Groovu, BASIC, JavaScript, CoffeeScript,
by KineticLensman 8y ago
If you like this may I also recommend [0] which has fizzbuzz in:
Java, VBA, php, cobol, forth, C++, brainfuck, python, Groovu, BASIC, JavaScript, CoffeeScript, sh, PowerShell, Clojure, Ruby, C#, Haskell, ABAP, Lua, Matlab, Common Lisp, Oracle PL/SQL, Scala, F#, Bash, C, LOLCODE, golang, Enterprise Java, MySQL, Visual FoxPro, Perl, shakespeare
Of course, if you want it in Malboge [1], you can refer to a prior HN discussion [2] of FizzBuzz in multiple languages.
[0] http://wiki.c2.com/?FizzBuzzTest http://wiki.c2.com/?FizzBuzzTest
[1] https://en.wikipedia.org/wiki/Malbolge https://en.wikipedia.org/wiki/Malbolge
[2] https://news.ycombinator.com/item?id=4921651 https://news.ycombinator.com/item?id=4921651
- happimess 8y agoThe "Haskell implementation using monoids" on this page is the only solution I've seen where adding a new behavior (e.g. "FizzBuzzWoof") only requires a modification in one spot. (d 3 "Fizz" <> d 5 "Buzz") becomes (d 3 "Fizz" <> d 5 "Buzz" <> d 13 "Woof") eta: And just below it is a similar solution in Python. Cool!
- duckerude 8y agoWith similar properties, but more disgusting: for n in range(1, 101): print(n, end='\r') if n % 3 == 0: print("Fizz", end='') if n % 5 == 0: print("Buzz", end='') print()
- drfuchs 8y agoExtra points for deviousness, but this won't produce the correct visual result when logged in on a hardcopy terminal (e.g. DECwriter); or even on a glass tty (e.g. DEC VT100) if you set the upper limit to 10001. It will also always fail a correctness test of diffing against the proper output. You should definitely consider entering the Obfuscated C contest, though.