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 SPITBOL

Date:04/20/05
Author:D.H.
URL:n/a
Comments:1
Info:n/a
Score: (2.86 in 7 votes)
* MaxSPITBOL version (SPITBOL implementation on
* the Macintosh from Catspaw, Inc. (Salida, CO).
* NOTE:  I have no connection w/them other than being
* a long-time satisfied user of their product
* D.H.  <hedges@pilot.njin.net>

     p0 = "NO MORE" ;  p1 = " BOTTLE" ; p2 = "S" ; p3 = " OF BEER"
     p4 = " ON THE WALL" ; p5 = "TAKE ONE DOWN, PASS IT AROUND"

     b = 99
     p6 = ((NE(b,0) b, p0) p1 (NE(b,1) p2,) p3)
A1   OUTPUT = p6 p4 ; OUTPUT = p6 ; OUTPUT = p5
     b = b - 1
     p6 = ((NE(b,0) b, p0) p1 (NE(b,1) p2,) p3)
     OUTPUT = p6 p4 ; OUTPUT = ; NE(b,0)                   :S(A1)
END

Download Source | Write Comment

Alternative Versions

VersionAuthorDateCommentsRate
Exact "official" lyrics, incl caseGordon E. Peterson II08/14/070
this one uses pattern matchingGordon E. Peterson II08/14/070

Comments

>>  Gordon E. Peterson II said on 08/14/07 16:29:34

Gordon E. Peterson II Interesting, although this could be improved on... p5 for example is only used once, so could as easily be coded that one place as a literal. I also would like to see the multiple outputs reduced to one (by explicitly outputting the CR/LF) and perhaps collapsing the whole thing into a single pattern match, eliminating the label and goto. I'm tempted to submit my own alternative. I guess I need to study the rules about what the 'official lyrics' are supposed to be at the end (since the SNOBOL version and SPITBOL version, at least, generate somewhat different outputs).

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: