If(j)invert()if(l)change()if(q)input()if(t)output(x);

From Esolang
Jump to: navigation, search

INTERPRETER

Especifications:

J - invert the bit pointed
L - invert the pointer
Q - input and put in the pointer
T - output the pointer

Interpreter in c:

int[] mem = [0, 0];
int pointer = 0;
int ip = 0;
for(;;){
  char x = scanf('%s', x);
  switch(x){
    case('j'){
      if(mem[pointer] == 0){ mem[pointer] = 1;}else{ mem[pointer] = 0;}break;}
    case('l'){
      if(pointer == 0){ pointer = 1; }else{ pointer = 0;}break;}
    case('q'){
      mem[pointer] = scanf('%i', mem[pointer]);break;}
    case('t'){
      printf('%c', mem[pointer]); break;}
    default{
      printf('%c', x); break;}
  }
}

(It uses scanf, and it needs to be better)

SAMPLES

Hello World:

He11o Wor1d

More elaborated hello world:

Hell11ojl ljworl1d

Any program that don't uses the characters jlqt is already a quote.

Cat is limited to

QTQTQTQTQTQTQTQTQTQTQTQTQTQTQTQTQTQTQT

or more.

Add more samples, please...