Ok, yes I guess it’s a bit “backwards” not using classes fully.
Still, as for the class as kind-of-struct - method, I just realized it’s simpler without a constructor.
Pair test;
void setup() {
test = new Pair();
test = doubleHalf(3);
//test.a = 34;
//test.b = 5.5;
println("Result : " + test.a + " and " + test.b);
exit();
}
Pair doubleHalf(int val) {
Pair temp = new Pair();
temp.a = val * 2;
temp.b = val / 2.0;
return temp;
}
class Pair {
int a;
float b;
}