Good to hear its running.
Your code style might lead you to disaster one day, I'm sure there are a few slightly more informative names you could give your functions: 'Y(i+Yy,high,high,0);//turns rail on--------------------------'.
Did you try accessing the multidimensional array directly:
X(e+Xx,cr_0[i][e]);
You can simplify your code greatly by formatting your data structures better:
int y0[3]={0,1,2};
int y1[3]={3,5,6};
int y2[3]={7,8,9};
int y3[3]={10,11,12};
int y4[3]={13,14,0};
int y5[3]={1,2,3};
int Ylist[3][6]={*y0,*y1,*y2,*y3,*y4,*y5};
Can be represented as:
int YList[][3] = {
{0,1,2},
{3,5,6},
{7,8,9},
{10,11,12},
{13,14,0},
{1,2,3}
};
You almost had your usage correct in function Y, the above array is what will help you achieve this.
I have also used a switch statement to remove redundant checks.
int *YPtr = Ylist[ e ];
switch( e ){
case 4:
case 5:
left.digitalWrite( YPtr[0],blue );
left.digitalWrite( YPtr[1],green );
left.digitalWrite( YPtr[2],red );
break;
default:
right.digitalWrite( YPtr[0],blue );
right.digitalWrite( YPtr[1],green );
right.digitalWrite( YPtr[2],red );
};
There are lots of things you can do with arrays to improve your sketch.
I understand you read the links I posted above, however it still looks like you have a yet to fully grasp the array concept. Search google for other articles.