How do I use variables in functions/procedures

this version has the data in your format


// -----------------------------------------------------------------------------
const int  L = 5;
const byte leds [][L] = {

  {    0,   0,   4,   0,   0, },  {    0,   0,   8,   0,   0, },
  {    0,   0,  16,   0,   0, },  {    0,   0,  32,   0,   0, },
  {    0,   0,  64,   0,   0, },  {    0,   0, 128,   0,   0, },
  {    0,   0,   0,   0,   1, },  {    0,   0,   0,   0,   2, },
  {    0,   0,   0,   0,   4, },  {    0,   0,   0,   0,   8, },
  {    0,   0,   0,   0,  16, },  {    0,   0,   0,   0,  32, },
  {    0,   4,   0,   0,   0, },  {    0,   8,   0,   0,   0, },
  {    0,   0,   0,   0,  64, },  {    0,   0,   0,   0, 128, },
  {    0,   0,   0,   1,   0, },  {    0,   0,   0,   2,   0, },
  {    0,  16,   0,   0,   0, },  {    0,  32,   0,   0,   0, },
  {    0,  64,   0,   0,   0, },  {    0, 128,   0,   0,   0, },
  {    0,   0,   0,   4,   0, },  {    0,   0,   0,   8,   0, },
  {    0,   0,   0,  16,   0, },  {    0,   0,   0,  32,   0, },
  {    1,   0,   0,   0,   0, },  {    2,   0,   0,   0,   0, },
  {    4,   0,   0,   0,   0, },  {    8,   0,   0,   0,   0, },
  {    0,   0,   0,  64,   0, },  {    0,   0,   0, 128,   0, },
  {    0,   0,   1,   0,   0, },  {    0,   0,   2,   0,   0, },
  {   16,   0,   0,   0,   0, },  {   32,   0,   0,   0,   0, },
};
const int Nleds = sizeof (leds)/L;

// -----------------------------------------------------------------------------
const byte dataPin  = 11;
const byte clockPin = 12;
const byte latchPin = 8;

// -----------------------------------------------------------------------------
void output (
    int  n )
{
  digitalWrite (clockPin, LOW);

  for (int l = 0; l < L; l++)
    shiftOut (dataPin, clockPin, MSBFIRST, leds [n][l]);

  delay (300);
  digitalWrite (latchPin, HIGH);
  digitalWrite (latchPin, LOW);
  delay (100);
}

// -----------------------------------------------------------------------------
void loop () {
    for (int i = 0; i < Nleds; i++)
        output (i);
}

// -----------------------------------------------------------------------------
void setup () {
  pinMode (dataPin, OUTPUT);
  pinMode (clockPin, OUTPUT);
  pinMode (latchPin, OUTPUT);
}