Language CONNECT built-in script language
(CONNECT is NC-like MSDOS shell)
| Date: | 10/15/08 |
| Author: | Dmitry Terentiev |
| URL: | n/a |
| Comments: | 0 |
| Info: | http://www.softpanorama.org/OFM/Paradigm/Ch03/cn__connect.shtml |
| Score: |
take = "take on down and pass it around, "
ofbeer = " of beer"
wall = " on the wall"
cnt = 99
Loop:
GOSUB Gbottle
GOSUB GNum
str = CONCAT(CONCAT(num, bottle), ofbeer)
str = CONCAT(CONCAT(str, CONCAT(wall, ", ")), CONCAT(str, ".^M"))
GOSUB Cap
PUTSTR(str);
cnt = cnt - 1
GOSUB Gbottle
GOSUB GNum
IF (cnt <> -1) THEN GOSUB Take; GOTO loop
PUTSTR("Go to the store and buy some more, 99 bottles of beer on the wall.")
STOP()
GBottle: bottle = " bottle"
IF (cnt <> 1) THEN bottle = CONCAT(bottle, "s")
RET
GNum: IF (cnt > 0) THEN num = FMTSTR(cnt, "d") ELSE num = "no more"
RET
Cap: str = CONCAT(UPCASE(COPY(str, 1, 1)), DELETE(str, 1, 1))
RET
Take:
str = CONCAT(take, CONCAT(num, CONCAT(bottle, CONCAT(wall, "."))));
GOSUB Cap;
PUTSTR(str)
PUTSTR("^M^M")
RET
Download Source | Write Comment
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!
Comments