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 MAGIC/L

Date:04/20/05
Author:Eric Korpela
URL:n/a
Comments:0
Info:n/a
Score: (3.11 in 131 votes)
A procedural language written in Forth.  Originally ran on 
Z80's under CP/M and later available for IBM-PCs and Sun 3s.

; MAGIC/L version of the beer bottle song 
; (c) 1996 Eric Korpela (korpela@ssl.berkeley.edu)
; WARNING! All the spaces are necessary!
;
; Add the help entry....
.subject bottles
Usage:  bottles ( number )
.
; and here's the procedure
define bottles 
  integer number
  local integer current
;
  current := number
  while ( current > 1 )
    print current , " bottles of beer on the wall."
    print current , " bottles of beer."
    print "You take one down and pass it around."
    current := current - 1
    print current , " bottles of beer on the wall."
    print
  repeat
;
  print 1 , " bottle of beer on the wall."
  print 1 , " bottle of beer."
  print "You take one down and pass it around."
  print "No bottles of beer on the wall.
end

Download Source | Write Comment

Alternative Versions

Comments

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: