result looks good, code looks TERRIBLE 8)
have a class (Digit) containing a two dimensional array for digits, each one containing booleans denoting which segments are lit for that digit.
then have a method that takes the digit number and lights up the relevant segments.
then this abomination:
Code:
void secSpot2(){
pushMatrix();
scale(0.8);
translate(411,414);
switch (s) {
case 1:
case 11:
case 21:
case 31:
case 41:
case 51:
num1();
break;
case 2:
case 12:
case 22:
case 32:
case 42:
case 52:
num2();
break;
case 3:
case 13:
case 23:
case 33:
case 43:
case 53:
num3();
break;
case 4:
case 14:
case 24:
case 34:
case 44:
case 54:
num4();
break;
case 5:
case 15:
case 25:
case 35:
case 45:
case 55:
num5();
break;
case 6:
case 16:
case 26:
case 36:
case 46:
case 56:
num6();
break;
case 7:
case 17:
case 27:
case 37:
case 47:
case 57:
num7();
break;
case 8:
case 18:
case 28:
case 38:
case 48:
case 58:
num8();
break;
case 9:
case 19:
case 29:
case 39:
case 49:
case 59:
num9();
break;
case 0:
case 10:
case 20:
case 30:
case 40:
case 50:
case 60:
num0();
break;
}
popMatrix();
}
can be replaced with
Code:
void secSpot2(){
pushMatrix();
scale(0.8);
translate(411,414);
Digit.draw(s % 10); // the new digit class
popMatrix();
}
% is modulo, or 'remainder' so 11 % 1 = 1.
(all the Spot1 code should use floor(s / 10) )
/ is divide and floor picks the integer part of the result
so 21 / 10 = 2.1 and floor(2.1) = 2
even if you move all the num0, num1... code into a method that takes a parameter, num(int digit) say, and use the above instead of those huge switch statements, that'd be a great improvement.
like i say, the result looks great but if you're repeating stuff over and over again like that it's a sign that something is wrong.