Giter Site home page Giter Site logo

jrelo / fizzbuzz-polyglot Goto Github PK

View Code? Open in Web Editor NEW

This project forked from keith-s-thompson/fizzbuzz-polyglot

0.0 2.0 0.0 275 KB

FizzBuzz in multiple languages

Ada 1.95% Awk 1.86% Limbo 3.08% Visual Basic 5.15% Shell 37.06% C 5.00% Common Lisp 1.75% COBOL 6.01% C++ 1.82% C# 2.43% Makefile 14.58% Dart 2.16% Erlang 1.81% Fortran 4.88% Forth 2.05% GDB 1.58% Go 2.21% Groovy 1.31% Scheme 2.23% Haskell 1.07%

fizzbuzz-polyglot's Introduction

FizzBuzz is a nearly trivial programming exercise, sometimes used in job interviews to weed out candidates who say they can program but really can't.

References:

The requirements are simple:

Write a program that prints the numbers from 1 to 100. But for multiples of three print "Fizz" instead of the number and for the multiples of five print "Buzz". For numbers which are multiples of both three and five print "FizzBuzz".

In my fizzbuz-c project I present multiple (86 at last count) C solutions.

NOTE : This is not intended as a collaborative project. It is my own personal playground. A few people have submitted pull requests for languages I haven't covered, which I certainly appreciate, but I won't be accepting them. If you're interested in collaborating on something similar, see Rosetta Code. Bug reports are quite welcome.

Here I present multiple implementations, one in each language. The current set of languages (92 of them) is:

Many of these are inspired by http://99-bottles-of-beer.net/.

tail and cat are simply the standard Unix/Linux utilities, not real scripting languages. The cat implementation in particular is an ugly cheat, depending on the existence of the expected-output.txt file.

JavaScript and Node.js aren't really distinct languages, but Node.js is a sufficiently different environment than plain JavaScript that I thought it was worth having both.

curl is a URL transfer utility, not a programming language. fizzbuzz.curl, like fizzbuzz.cat, depends on the existence of expected-output.txt, but on this GitHub project page rather than in the current directory. It also requires an Internet connection.

The verify script executes each program and confirms that its output is correct. It works on my system, x86_64 Ubuntu 16.10, with required packages installed as documented in each source file.

fizzbuzz.b is not tested with an actual B compiler; see that file for details.

fizzbuzz.sh6 failed due to a problem with the external goto command. I'm in touch with the maintainer to (I hope) get a fix for this. See the sh6-bug subdirectory for details. (For now I've worked around this problem by using osh rather than sh6. osh is an enhanced implementation of sh6 that has goto as a built-in command.)

The Whitespace web page is currently down, so I'm using the Perl implementation from here. I'll update the "comments" in the source file later (that's difficult to do, since I have to preserve existing whitespace).

I'm keeping an informal list of languages I intend to add in TODO.md.

Do not take this too seriously.

fizzbuzz-polyglot's People

Contributors

keith-s-thompson avatar

Watchers

James Cloos avatar hed0rah avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.