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 PReS Language

(version 4.2)

Date:03/28/11
Author:Romain VALERI
URL:http://romainvaleri.online.fr
Comments:0
Info:http://www.printsoft.com/products/Composition-PReS-Suite
Score: (2.91 in 11 votes)
RECORD
INTERNAL
	ALPHA	iaText			L20000
	ALPHA	iaLine			L100
	ALPHA	iaData1			L100
	ALPHA	iaData2			L100
	ALPHA	iaData3			L100
	ALPHA	iaI				L7
	NUMERIC	inI
	
START
	iaData1 = "@ bottles of beer on the wall, @ bottles of beer."
	iaData2 = "Take one down and pass it around, @ bottles of beer on the wall."
	iaData3 = "Go to the store and buy some more, 99 bottles of beer on the wall."
	
	inI = 99
	WHILE (inI GE 0) {
		IF (inI NE 99) APPEND iaText, "\n\n"
		iaLine = iaData1
		CONVERT iaI, inI, 'L'
		IF (iaI EQ "0") iaI = "no more"
		REPLACE iaLine, "@", iaI L=CALCULATE
		IF (inI EQ 0) iaLine[0] L=1 = "N"
		IF (inI EQ 1) REPLACE iaLine, "bottles", "bottle"
		APPEND iaText, iaLine
		inI -= 1
		iaLine = iaData2
		CONVERT iaI, inI, 'L'
		IF (iaI EQ "0") iaI = "no more"
		REPLACE iaLine, "@", iaI L=CALCULATE
		IF (inI EQ 1) REPLACE iaLine, "bottles", "bottle"
		IF (inI EQ -1) iaLine = iaData3
		APPEND iaText, iaLine, "\n"
	}
	iaText = iaText L=CALCULATE
	WRITE "out.txt", iaText L=CALCULATE
EXIT

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: