So here is my attempt (below). Sadly it does not work:
Void methods cannot return a value
I am trying to use a recursive function. Can it be done?
void setup() {
noLoop();
}
void draw() {
for (int i = 0; i < 34; i++) {
String t = tern(i);
Println(t);
}
}
String tern(int dec) {
float a = dec/3;
int e = floor(a);
int q = dec % 3;
if (dec == 0) {
return str(0);
} else if (e == 0) {
return str(q);
} else {
return tern(e) + str(q);
}
}