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

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!

Interpreters

C++ as Windows executable (64bit) (faster link)

#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