Voting

Category

esoteric language

Bookmarking

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

Language UC4

(UC4 script)

Date:08/14/09
Author:Noah Pratt
URL:n/a
Comments:0
Info:http://www.uc4.com/
Score: (2.00 in 1 votes)
! UC4 Operations Manager is an enterprise job scheduling system: http://www.uc4.com/
! "99 Bottles" example in pure UC4 Script
! Noah Pratt, 2009-08-13

:SET &BOTTLES# = "99"
:SET &PLURAL# = "s"
:SET &QUANT# = "one"

:WHILE &BOTTLES# > 0
:  PRINT "&BOTTLES# bottle&PLURAL# of beer on the wall,"
:  PRINT "&BOTTLES# bottle&PLURAL# of beer."
:  PRINT "Take &QUANT# down and pass it around,"
:  SET &BOTTLES# = SUB(&BOTTLES#,1)

!  Integers are always 16 digits, padded with leading zeros if necessary
!  -- the FORMAT() function strips 'em off.
:  SET &BOTTLES# = FORMAT(&BOTTLES#)

:  IF &BOTTLES# > 0
:    IF &BOTTLES# = 1
:      SET &PLURAL# = ""
:      SET &QUANT# = "it"
:    ENDIF
:    PRINT "&BOTTLES# bottle&PLURAL# of beer on the wall!"
:    PRINT ""
:  ELSE
:    PRINT "No more bottles of beer on the wall!"
:  ENDIF

:ENDWHILE

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: