We are currently working on new rules for what content should and shouldn't be allowed on this website, and are looking for feedback! See Esolang:2026 topicality proposal to view and give feedback on the current draft.

OISCalypse II

From Esolang
Jump to navigation Jump to search

OISCalypseII is an OISC version of Brainpocalypse II. It is a Turing-complete esoteric programming language with one instruction, named Joapi: short for Jump Or Addition Pointer Increment. This is what it looks like in C pseudocode:

if(*p+A<0) { (*p)++; ip=0; };
else *p+=A;
p++;

Memory Model

The Memory Model of OISCalypse II consists of a tape of 1024 cells, each containing an arbitrary-precision integer. The pointer is a 10-bit zero-indexed pointer, and therefore cell 1024 is equal to cell 0.

Commands, or should I say Command

Remember this?

if(*p+A<0) { (*p)++; ip=0; };
else *p+=A;
p++;

Well, for those who did not understand this C pseudocode, allow me to give an explanation. Each command is an integer, which we will refer to as "A", what this instruction does, is it checks if the value on the tape that the pointer is pointing to, plus the integer "A" is less than 0. If so, it increments the value on the tape that the pointer is pointing to, and jumps to the start of the program. Else, it sets the value on the tape that the pointer is pointing to to itself, plus that integer "A". And after that, it increments the pointer.

Interpreter

Python

code=list(map(int,input().split()))
tape=[0]*1024
ip,p=0,0
while ip<len(code):
    a=code[ip]
    if tape[p]+a<0:
        tape[p] += 1
        ip=-1
    else:
        tape[p]+=a
        p+=1 
        if p==1024: 
            p=0
    ip+=1 
    #print(tape)

See Also