LAIN is a esoteric language developed by User:Valtsu0 as his first language. It was designed to be a self modifying language that lacks if statements. The name LAIN is not an acronym and is only capitalized to indicate that the name is supposed to be yelled out loud.
Any line that doesn't include a semicolon is printed. For example:
Anything after a semicolon is a comment.
LAIN is a dynamically typed language, that has two data type. They are integers and strings. Variable names cannot include a
; or a
string = "String"; integer = 3; var = string;
An operation can be performed during variable assignation, but only one can be performed at a time. This is the only time operators can be used. Operators are
max. Operator must be between two values or variables. The
+ will perform integer addition when both values next to it can be interpreted as integers. Otherwise it will perform string concatenation. Rest of the operators can only be used on integers.
integer = 5 max integer; string = 4 + "String";
# is always the line number of the next line.
Input is taken with a variable followed by a semicolon
goto is followed by a integer or string. Line indexing starts at 0 for all purposes. If given a string the destinations will be a label corresponding to that string and if no such label currently exists the destination will be the next line. A label is created by starting a line with
goto integer; goto 0; goto "label"; :label;
line command changes the specified line to the specified string.
line integer string; line 3 "Hello, world!";
var; var = var + 3; goto var; goto 6; 1 goto 4; 0
99 Bottles of beer on the wall
first = " bottles of beer on the wall,"; second = " bottles of beer."; fourth = " bottles of beer on the wall."; beer = 99; lyric = beer + first; line 6 lyric; lyric = beer + second; line 9 lyric; Take one down, pass it around, beer = beer - 1; lyric = beer + fourth; line 14 lyric; var = beer min 2; var = var + 18; goto var; goto 21; goto 4; 1 bottle of beer on the wall, 1 bottle of beer. Take one down, pass it around, No bottles of beer on the wall.