2023

From Esolang
Jump to navigation Jump to search

2023 is an esolang invented by User:None1. In 2023 B. C. E., this esolang is the same as brainfuck, otherwise it deletes the program and the interpreter.

The esolang had faded into uselessness for quite a long time, even before the first computers, so it is never useful.

Interpreters

The first interpreter, in Python, is written in 2024:

import sys,datetime,os
def bf(code):
    s=[]
    matches={}
    tape=[0]*1000000
    for i,j in enumerate(code):
        if j=='[':
            s.append(i)
        if j==']':
            m=s.pop()
            matches[m]=i
            matches[i]=m
    cp=0
    p=0
    while cp<len(code):
        if code[cp]=='+':
            tape[p]=(tape[p]+1)%256
        if code[cp]=='-':
            tape[p]=(tape[p]-1)%256
        if code[cp]==',':
            c=sys.stdin.read(1)
            tape[p]=(ord(c) if c else 0)%256
        if code[cp]=='.':
            print(chr(tape[p]),end='')
        if code[cp]=='<':
            p-=1
        if code[cp]=='>':
            p+=1
        if code[cp]=='[':
            if not tape[p]:
                cp=matches[cp]
        if code[cp]==']':
            if tape[p]:
                cp=matches[cp]
        cp+=1
if datetime.date.today==-2023:
 bf(open(sys.argv[1]).read())
else:
 os.remove(sys.argv[0])
 os.remove(sys.argv[1])