Remove Line Numbers

From Esolang
Jump to navigation Jump to search

Remove Line Numbers (you can use RLN for short), is a joke esolang created by User:None1.

Syntax

RLN's syntax is:

<line-number><spaces><text>

Line number must be a positive decimal integer, and represents exactly the line number of the text. For example:

1 a

is correct, but

-1 a
0x0f a
4.5 a
2 a
(0110110001)[2] a
5+1 a
4^2 a
sin(90deg) a

are all incorrect.

Note that text can be empty.

Execution

When running, the interpreter/compiled executable simply removes all the line numbers from its source code and prints all the text.

Example Programs

Hello World:

1 Hello World!

99 bottles of beers:

1 99 bottles of beer on the wall, 99 bottles of beer.
Take one down and pass it around, 98 bottles of beer on the wall.

1 98 bottles of beer on the wall, 98 bottles of beer.
Take one down and pass it around, 97 bottles of beer on the wall.

1 97 bottles of beer on the wall, 97 bottles of beer.
Take one down and pass it around, 96 bottles of beer on the wall.

1 96 bottles of beer on the wall, 96 bottles of beer.
Take one down and pass it around, 95 bottles of beer on the wall.

1 95 bottles of beer on the wall, 95 bottles of beer.
Take one down and pass it around, 94 bottles of beer on the wall.

1 94 bottles of beer on the wall, 94 bottles of beer.
Take one down and pass it around, 93 bottles of beer on the wall.

1 93 bottles of beer on the wall, 93 bottles of beer.
Take one down and pass it around, 92 bottles of beer on the wall.

1 92 bottles of beer on the wall, 92 bottles of beer.
Take one down and pass it around, 91 bottles of beer on the wall.
--snip--

Interpreters

C++ as Windows executable (64bit)

#include<cstdio>
#include<cstdlib>
char line[1000000];
int Gets(char *line){
	int i=0,flag=0;
	while(1){
		char c=getchar();
		if(c==EOF||c=='\n') line[i]=0;
		if(c==EOF) return EOF;
		if(c=='\n') return 0;
		if(c!=' ') flag=1;
		if(!flag) continue;
		line[i]=c;
		i++;
	}
}
void error(){
	puts("Invalid syntax");
	exit(1);
}
#define gets Gets
int main(){
	int l=0;
	while(1){
		l++;
		int x=-1;
		if(scanf("%d",&x)==EOF) break;
		if(x!=l) error();
		gets(line);
		puts(line);
	}
	return 0;
}

See Also