Voting

Category

real language

Bookmarking

Del.icio.us Digg Diigo DZone Earthlink Google Kick.ie
Windows Live LookLater Ma.gnolia Reddit Rojo StumbleUpon Technorati

Language Plain English

Date:02/16/06
Author:The Osmosian Order
URL:http://www.osmosian.com
Comments:15
Info:http://www.osmosian.com
Score: (3.52 in 60 votes)
To sing the beer song:
  Put 99 into a number.
  Loop.
  If the number is 0, break.
  Format a string given the number and "bottle" and "bottles".
  Write the string then " of beer on the wall, " then the string then " of beer.".
  Format another string given the number minus 1 and "bottle" and "bottles".
  Write "Take one down and pass it around, " then the other string then " of beer on the wall.".
  Skip a line.
  Subtract 1 from the number.
  Repeat.
  Write "No more bottles of beer on the wall, no more bottles of beer.".
  Write "Go to the store and buy some more, 99 bottles of beer on the wall.".

To format a string given a number and a singular string and a plural string:
  If the number is 0, put "no more " then the plural into the string; exit.
  If the number is 1, put "1 " then the singular into the string; exit.
  Put the number then " " then the plural into the string.

Download Source | Write Comment

Alternative Versions

Comments

>>  FMaz said on 04/29/06 00:38:05

FMaz I still prefer the whitespace language... it's a way more simple to read.
plain english has too much text, my eyes gets tired really fast.

>>  Chris Steffen said on 09/25/06 18:00:58

Chris Steffen This source code was WAY too vague. I had to set my compiler to "interpretive mode" so as to not make mistakes as to which string you were talking about when, and what you wanted me to do, exactly.

Dangerous work.

>>  Jacques Troux said on 01/03/07 02:39:01

Jacques Troux Worst language ever.

>>  Freddy said on 01/03/07 13:15:34

Freddy What absolute rubbish.

>>  Gerry said on 01/06/07 21:55:41

Gerry It curious that all of the comments so far - both pro and con - have been written in Plain English! :)

>>  The Grand Negus said on 01/11/07 23:29:22

The Grand Negus By the way, the Plain English Compiler is written entirely in Plain English and can recompile itself - with all of its development tools - in less than 3 seconds on a bottom-of-the-line Dell.

>>  Sam said on 07/05/07 11:32:29

Sam Evil

>>  Adam R. said on 08/14/07 08:43:38

Adam R. Uhm, wtf, how can it recompile itself? That's like...writing PHP5 in PHP5. Impossible.

>>  fruttenboel said on 08/24/07 00:44:26

fruttenboel Apparently the 'Plain English' source code was written after the last bottle was taken off the wall.

>>  The Grand Negus said on 08/31/07 11:02:15

The Grand Negus Adam R: Write me (help@osmosian.com) and I'll show you how Plain English can recompile itself. No cost or obligation. It's not quite like writing PHP5 in PHP5; it's like writing PHP5 using PHP4.

>>  Ben Standeven said on 10/13/07 00:44:47

Ben Standeven I can't seem to get this program to work right; it just keeps printing these lines:
"99 bottles of beer on the wall, 99 bottles of beer."
"Take one down, pass it around, -1 bottles of beer on the wall."
"Go to the store, buy some more, 99 bottles of beer on the wall."

Is there something wrong with my compiler?

>>  Doug Bell said on 10/19/07 20:27:31

Doug Bell One of the main tasks of a programming language is to "bootstrap the compiler", which basically means to write an X compiler in the X programming language.

If the language is sufficiently powerful, it's possible.

>>  Frank Eriksson said on 01/13/08 13:38:33

Frank Eriksson This was intresting but is there a free compiler around somewhere?
if not i will create one...

visit my blog at: http://nano-systems.blogspot.com/ and tell me if you are with me ;-)

>>  calle94-1337 said on 01/14/08 17:00:54

calle94-1337 Is'nt it frre? i got it from https://www.osmosian.com/cal-3037.zip ? it seams to be fixeb to fulscreen windows appz. ca'nt u make on for linux?

>>  Scott said on 04/03/08 06:47:12

Scott GCC (C++ compiler) was written in C++

Download Source | Write Comment

Add Comment

Please provide a value for the fields Name, Comment and Security Code.
This is a gravatar-friendly website.
E-mail addresses will never be shown.
Enter your e-mail address to use your gravatar.

Please don't post large portions of code here! Use the form to submit new examples or updates instead!

Name:

eMail:

URL:

Security Code:
  
Comment: