Auto format in Processing 2.0 Beta 9
in
Integration and Hardware
•
4 months ago
I just downloaded the new Processing and auto format has changed. It now takes a bunch of one line conditionals like this:
- if (in[i] == 1) out += (i%4) + (i>>2);
- else if (in[i] == 2) out += abs((i%4)-1) + (i>>2);
- else if (in[i] == 3) out += abs((i%4)-2) + (i>>2);
- else if (in[i] == 4) out += abs((i%4)-3) + (i>>2);
- else if (in[i] == 5) out += (i%4) + abs((i>>2)-1);
- else if (in[i] == 6) out += abs((i%4)-1) + abs((i>>2)-1);
- else if (in[i] == 7) out += abs((i%4)-2) + abs((i>>2)-1);
- else if (in[i] == 8) out += abs((i%4)-3) + abs((i>>2)-1);
- else if (in[i] == 9) out += (i%4) + abs((i>>2)-2);
- else if (in[i] == 10) out += abs((i%4)-1) + abs((i>>2)-2);
- else if (in[i] == 11) out += abs((i%4)-2) + abs((i>>2)-2);
- else if (in[i] == 12) out += abs((i%4)-3) + abs((i>>2)-2);
- else if (in[i] == 13) out += (i%4) + abs((i>>2)-3);
- else if (in[i] == 14) out += abs((i%4)-1) + abs((i>>2)-3);
- else if (in[i] == 15) out += abs((i%4)-2) + abs((i>>2)-3);
- else if (in[i] == 0) continue;
And turns it into this (all one line):
- if (in[i] == 1) out += (i%4) + (i>>2); else if (in[i] == 2) out += abs((i%4)-1) + (i>>2); else if (in[i] == 3) out += abs((i%4)-2) + (i>>2); else if (in[i] == 4) out += abs((i%4)-3) + (i>>2); else if (in[i] == 5) out += (i%4) + abs((i>>2)-1); else if (in[i] == 6) out += abs((i%4)-1) + abs((i>>2)-1); else if (in[i] == 7) out += abs((i%4)-2) + abs((i>>2)-1); else if (in[i] == 8) out += abs((i%4)-3) + abs((i>>2)-1); else if (in[i] == 9) out += (i%4) + abs((i>>2)-2); else if (in[i] == 10) out += abs((i%4)-1) + abs((i>>2)-2); else if (in[i] == 11) out += abs((i%4)-2) + abs((i>>2)-2); else if (in[i] == 12) out += abs((i%4)-3) + abs((i>>2)-2); else if (in[i] == 13) out += (i%4) + abs((i>>2)-3); else if (in[i] == 14) out += abs((i%4)-1) + abs((i>>2)-3); else if (in[i] == 15) out += abs((i%4)-2) + abs((i>>2)-3); else if (in[i] == 0) continue;
This is really quite annoying, can it be set to the old way again somehow?
1