Infinite loop (esolang)

From Esolang
Jump to navigation Jump to search
Not to be confused with Infinite loop.

Infinite loop (esolang) is an esolang created by User:None1.

Commands

There is only 1 command: [CODE], which executes CODE forever. Other characters are NOPs.

Since it just has commands for infinite loop, it has no I/O and is completely unusable for programming.

Examples

Infinite loop

[]

another one:

[][]

and another one:

[[]]

and another one:

[:D]

Interpreter

Python

prog=input()
prog=''.join(filter(lambda x:x in '[]',prog))
n=0
for i in prog:
    if i=='[':
        n+=1
    else:
        if not n:
            raise Exception('Unmatched ]')
        else:
            n-=1
if n:
    raise Exception('Unmatched [')
if prog:
    while 1:
        pass