I found this gem, and well frankly, I've kind of lost hope. I will probably get to these later, when I'm bored, but I think I know when I'm licked. http://rosettacode.org/wiki/FizzBuzz
Here are some more for good measure http://en.wikipedia.org/wiki/Esoteric_programming_language http://esolangs.org/wiki/Esoteric_programming_language
- I'm a little off my rocker
- I wanted to learn some basics of various languages and expand my understanding, by using a common, simple program. The functional languages, in particular, taught me some interesting things.
- If a future employer wanted to ask me for a fizzbuzz test (laughable), I could just point them to this, and say "Hey, I've done it in over N languages!"
- I know what you're saying... "COBOL -- Really?" Yeah. I know.
- Why not!
- P.S. Brainf*ck loops are evil
- Python
- Perl
- JavaScript
- Ruby
- Go
- Lua
- Scala
- Rust
- Bash
- Java
- CofeeScript
- R
- Shell
I've tried to write files with the conventions of that particular language in mind, as best as I could find quickly and easily.
I've kept it very simple: to run, I use standard bash commands, and pipe the results to a file to run a diff and thus compare results (e.g. node fizzbuzz.js >> js-test.txt).
In many cases, you will need to install an interpreter to run each file.
Note: a couple files, notably R, output the contents of the file, as well as any stdout statements. I couldn't find a way to prevent that, though I am guessing it is some kind of flag when running the file via command line.
Some languages require compilation. You'll need to install the correct compiler in that case. For example, I use brew install [compiler-name] for all the languages that require it.
- Clojure
- Obj-c
- Scheme
- Pascal
- Cobol
- C++
- Brainfuck
- LISP
- ADA