jumpToRとjumpToLを修正。滲み出るスキルの低さ。なんか冗長だし色々間違ってる気がするのでもう人のコードを見てしまおう…。
void jumpToR(){ if(buffer[ptr] != 0) return; int t = 1; while(t != 0){ char c = input.charAt(bfpos); if(c == ']'){ t--; }else if(c == '['){ t++; } bfpos++; } // while(input.charAt(bfpos) != ']'){ // bfpos++; // } } void jumpToL(){ if(buffer[ptr] == 0) return; int t = 1; while(t != 0){ bfpos--; char c = input.charAt(bfpos); if(c == ']'){ t++; }else if(c == '['){ t--; } } // while(input.charAt(bfpos) != '['){ // bfpos--; // } }