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 HTML/OS

Date:04/20/05
Author:Anonymous
URL:n/a
Comments:5
Info:http://aestiva.com/
Score: (2.52 in 46 votes)
See http://abooks.com/cgi-bin/htmlos.cgi/99bottles.html for working example
See http://aestiva.com/ for more informations about HTML/OS.

<HTML>

<<i=99
WHILE i > 0 DO
display i+" bottles of beer on the wall,<br>" /display
display i+" bottles of beer on the wall.<br>" /display
display "Take one down, pass it around,<br>" /display
i=i-1
display i+" bottles of beer on the wall.<br><br>" /display
/while
>>

</HTML>

Download Source | Write Comment

Alternative Versions

Comments

>>  S said on 05/10/05 20:41:18

S Awesome...very nice...I always wanted to be able to right 99 Bottles of Beer with a simple HTML code :)

>>  Stefan Scheler said on 05/14/05 08:38:40

Stefan Scheler Well, this is not plain HTML. HTML doesn't have loops.

"HTML/OS is a commercial operating system for the web. As such, it was built with platform independence and ease of use in mind. With the web becoming ever more complex, platform independence of any software has been long in coming, yet it's the only approach that really makes sense". <- This is what the vendor says.

In other words, it's imho a server-side scripting language like php etc.

>>  Omer Rozansky said on 10/29/06 22:08:12

Omer Rozansky This is stupid...
It won't work!
When it will reach 0 it will just stop without the last lines ("Go to the store and buy some more...";)
And it will stop at 1 bottle without the "No bottle at the walls".

It deserves 1 star and not 3.

>>  thanix said on 01/07/07 07:58:48

thanix Even the grammar is poor! When there is only one bottle, you should call it "bottle", not as "bottles"

"0 bottles of beer" should be phrased as "No more left, go to the store" or something similar.

>>  Drace said on 03/14/08 04:12:57

Drace Oh please...do not blame the script for poor programing. Just Like any logical language you can make separate cases for when i=1 or i=0

<<i=99
WHILE i > 0 DO
if i>1 then
display i+" bottles of beer on the wall,<br>" /display
display i+" bottles of beer.<br>" /display
display "Take one down, pass it around,<br>" /display
elif i=1 then
display i+" bottles of beer on the wall,<br>" /display
display i+" bottles of beer.<br>" /display
display "Take one down, pass it around,<br>" /display
/if
i=i-1
if i>1 then
display i+" bottles of beer on the wall.<br><br>" /display
elif i=1 then
display i+" bottle of beer on the wall.<br><br>" /display
else
display "No bottles of beer on the wall.<br><br>" /display
/while
# here you have two options, have the html/os display the last verse, or do it in the body of the page. I use the html/os /#

# rather than displaying each line with a separate set of display tags you can just do one like below. I prefer to use carrots (^) but (') or (";) are acceptable as well. (^)'s have the advantage as they will not interfere with ensuring that all attributes on html tags written by the script will be compliant and that you do not interfere with javascripts written by the script. /#

display
^No bottles of beer on the wall.<br>
No bottles of beer.<br>
Go to the store and buy some more.
99 bottles of beer on the wall.^
/display
>>

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: