It was easy enough to use the same method to do an applet one. It did get kind of ridiculous though. I would like to see a shorter version.
This
Code:byte[]a =
{118, 111, 105, 100, 32, 115, 101, 116, 117, 112, 40, 41, 32, 123, 10, 32,
32, 115, 105, 122, 101, 40, 52, 48, 48, 44, 56, 48, 48, 41, 59,
10, 32, 32, 80, 70, 111, 110, 116, 32, 102, 111, 110, 116, 32, 61,
32, 99, 114, 101, 97, 116, 101, 70, 111, 110, 116, 40, 34, 65, 114,
105, 97, 108, 34, 44, 32, 49, 48, 44, 32, 102, 97, 108, 115, 101,
41, 59, 10, 32, 32, 116, 101, 120, 116, 70, 111, 110, 116, 40, 102,
111, 110, 116, 41, 59, 10, 125, 10, 118, 111, 105, 100, 32, 100, 114,
97, 119, 40, 41, 32, 123, 10, 32, 32, 83, 116, 114, 105, 110, 103,
32, 115, 32, 61, 32, 34, 34, 59, 10, 32, 32, 115, 32, 43, 61,
32, 34, 98, 121, 116, 101, 91, 93, 97, 32, 61, 92, 110, 123, 34,
59, 10, 32, 32, 102, 111, 114, 40, 105, 110, 116, 32, 105, 61, 48,
59, 32, 105, 60, 97, 46, 108, 101, 110, 103, 116, 104, 59, 32, 105,
43, 43, 41, 32, 123, 10, 32, 32, 32, 32, 115, 32, 43, 61, 32,
97, 91, 105, 93, 59, 10, 32, 32, 32, 32, 105, 102, 40, 105, 33,
61, 97, 46, 108, 101, 110, 103, 116, 104, 45, 49, 41, 32, 115, 32,
43, 61, 32, 34, 44, 32, 34, 59, 10, 32, 32, 32, 32, 105, 102,
40, 105, 33, 61, 48, 32, 38, 38, 32, 105, 37, 49, 53, 61, 61,
48, 41, 32, 115, 32, 43, 61, 32, 34, 92, 110, 34, 59, 10, 32,
32, 125, 10, 32, 32, 115, 32, 43, 61, 32, 34, 125, 59, 92, 110,
34, 59, 10, 32, 32, 115, 32, 43, 61, 32, 106, 111, 105, 110, 40,
115, 116, 114, 40, 99, 104, 97, 114, 40, 97, 41, 41, 44, 34, 34,
41, 59, 10, 32, 32, 116, 101, 120, 116, 40, 115, 44, 32, 49, 48,
44, 32, 50, 48, 41, 59, 10, 125};
void setup() {
size(400,700);
PFont font = createFont("Arial", 10, false);
textFont(font);
}
void draw() {
String s = "";
s += "byte[]a =\n{";
for(int i=0; i<a.length; i++) {
s += a[i];
if(i!=a.length-1) s += ", ";
if(i!=0 && i%15==0) s += "\n";
}
s += "};\n";
s += join(str(char(a)),"");
text(s, 10, 20);
}
should work if you have Arial. Looks like the forum screws up the formatting but it should be okay when you copy and paste.