Newbie Help- Need to trim down under 5k

Hi all

I am just starting to dabble with arduino and programming.

Well I need help in reducing program size. I was working on a program with a Mega. Finished and fairly happy with my very first attempt. of controlling Neo Pixel ring of 16 LED from Adafruit. Using hardware debounced switch to poll and add random effects when switch pressed. Very simple i am sure to "you all", but a major accomplishment for me. XD
I purchased a Gemma from Adafruit as well so that I could program and leave with project not likely to touch ever again. Well my program was like 7K. Looking at the tech data on this Gemma with the Heart of ATtiny85 it can hold 8K but 2.75 used by bootloader so 5.2 or ~5K left for program. So I start to comment out sections of code, and more, and more, I have almost nothing left. Dang. It sure seems like other examples can do a lot. So I guess my sloppy code is cause. It now does like only a 1/10 of what I had working fine but only lowered my code to 5.7k Still a bunch over. =(

Would someone mind if I sent them this simple code. And maybe point out what I am doing wrong.
or is there a place to post code

Thanks much for any feedback

Chris

black_hole_pinball_4_casesworking.ino (7.1 KB)

void ballhit(){
int randNumber = random(6);
  switch (randNumber){{{{{{
    
  case 0:
    uint16_t i, j;
    int num_steps = 100;
    fade_up(50, 10, 0,0,50); //fade up blue
    break;
    
  }
  case 1:
    colorWipe(med_white, 40);    // Med white wipe ccw direction 
    colorWipe(turnoff,1);// turn off
    break; 
}
  case 2:
    RandomWhite(20,20);
    break;
}
  case 3:
    colorWipe(turnoff,1);// turn off
    colorWipe(med_blue,50); //Blue wipe
    break;
}
  case 4:
    colorWipe(turnoff,1);//turn off
    fade_up(40,10,0,40,40);
    break;
}
  case 5:
    colorWipe(turnoff,10);//turn off
    colorWipe2(med_blue,50);// blue wipe cw
    break;
}
}

All the cases for the switch statement go in ONE set of curly braces!

The curly brace that ends a for loop block does NOT need a semicolon after it.

Tools + Auto Format would do a lot to make that mess your code readable.

In the end, the question is exactly how much of the 5K space you have does the Adafruit_NeoPixel library use?

make all these numbers like 50 100 etc into varables like fifty hundred etc.
this means the number is only once in software
and make it byte if < 255 iinstead now using 4 bytes every time.