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.

Varl

From Esolang
Jump to navigation Jump to search

varl is my programming language. varl has 3 commands: 2 - end. 3 x - if code element in x position is 0, it will be replaced by 1, and if it is not 0, it will be replaced by 0. 4 x y - if code element in x position is 0, machine going in code on y chars(forward if y>0, else backward). Machine ignores other chars, so it can be 0/1, and you can change this chars. varl interpreter on C(code is c variable in interpreter, write code length in [] instead of 2 and numbers through , in {}):

int main(void){
    char c[1]={2};
    unsigned char i;
    while(c[i]!=2){
        if(c[i]==3){
            c[c[i+1]]=!c[c[i+1]];
            i++;
        }
        else if(c[i]==4){
            if(!c[c[i+1]])i+=c[i+2];
            i+=2;
        }
        i++;
    }
    return 0;
}