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.

Rise

From Esolang
Jump to navigation Jump to search

rise is my esoteric programming language. rise has 6 commands: 0 - end. 1 x y - adds y to stack element in x position. 2 x y - adds stack element in y position to stack element in x position. 3 x y - substracts y from stack element in x position. 4 x y - substracts stack element in y position from stack element in x position. 5 x y - if stack element in x position equals 0, machine going forward in code for y+3 chars. rise interpreter on C(code is c variable in interpreter, write code length in [] and numbers through , in {}):

int main(void){
    const char c[1]={};
    unsigned char i;
    char s[255]={};
    while(c[i]){
        if(c[i]==1)s[c[i+1]]+=c[i+2];
        else if(c[i]==2)s[c[i+1]]+=s[c[i+2]];
        else if(c[i]==1)s[c[i+1]]-=c[i+2];
        else if(c[i]==4)s[c[i+1]]-=s[c[i+2]];
        else if(c[i]==5&&s[c[i+1]]==0)i+=s[c[i+2]];
        i+=3;
    }
    return 0;
}