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 LINC

Date:01/02/07
Author:igis
URL:n/a
Comments:2
Info:http://en.wikipedia.org/wiki/LINC_4GL
Score: (2.00 in 4 votes)
SD; SS-COUNT ED; N LE; 2
SD; SS-MESSAGE ED; A LE; 80

MV; (99)    SS-COUNT

BG;
    DW; SS-COUNT NOT = GLB.ZEROS
        MV; SS-COUNT                             SS-MESSAGE
    ELSE;
        MV; (No more)                            SS-MESSAGE
    END;
    DW; SS-COUNT NOT = (1)
        ATS; (bottles of beer on the wall,)      SS-MESSAGE
    ELSE; 
        ATS; (bottle of beer on the wall,)       SS-MESSAGE
    END;
    DW; SS-COUNT NOT = GLB.ZEROS
        MV; SS-COUNT                             SS-MESSAGE
    ELSE;
        MV; (No more)                            SS-MESSAGE
    END;
    DW; SS-COUNT > (1)
        ATS; (bottles of beer.)                  SS-MESSAGE
    ELSE; 
        ATS; (bottle of beer.)                   SS-MESSAGE
    END;
    ME; SS-MESSAGE
    
    DW; SS-COUNT NOT = GLB.ZEROS
        MV; (Take one down and pass it around,)  SS-MESSAGE
        SB; (1) SS-COUNT
    ELSE;
        MV; (Go to the store and buy some more,) SS-MESSAGE
        MV; (99) SS-COUNT
    END;
    DW; SS-COUNT > (1)
        ATS; SS-COUNT                            SS-MESSAGE
    ELSE;
        ATS; (no more)                           SS-MESSAGE
    END;
    ATS; (bottles of beer on the wall.)          SS-MESSAGE
    ME; SS-MESSAGE
END;

Download Source | Write Comment

Alternative Versions

Comments

>>  igis said on 01/04/07 17:41:29

igis The 4th and 5th MV; should actually be an ATS;, else the first half of the first lyric line is lost. Second thoughts are what happens when you don't run tests..

>>  SH said on 01/30/08 15:47:08

SH Won't this code loop infinitely? I'd put a BK; somewhere in here to break out of the loop once it's done.

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: