Page 97 - MDP2022-3
P. 97

for  (int  y  =  0;  y  <  4;  y++)  {
                                    for  (int  x  =  0;  x  <  4;  x++)  drawLine(color,3,x,3,y,x,0);
                                    flushBuffer();
                                    clearBuffer();
                                    delay(animationSpeed);
                                }
                                side  =  4;  break;
                            }
                        }
                        if  (side  ==  6)  {
                        switch(random(25,30))  {
                            case  25:
                                for  (int  y  =  0;  y  <  4;  y++)  {
                                    for  (int  z  =  0;  z  <  4;  z++)  drawLine(color,z,3,0,z,0,y);
                                    flushBuffer();
                                    clearBuffer();
                                    delay(animationSpeed);
                                }
                                for  (int  x  =  0;  x  <  4;  x++)  {
                                    for  (int  z  =  0;  z  <  4;  z++)  drawLine(color,z,3,0,z,x,3);
                                    flushBuffer();
                                    clearBuffer();
                                    delay(animationSpeed);
                                }
                                side  =  1;  break;
                            case  26:
                                for  (int  y  =  0;  y  <  4;  y++)  {
                                    for  (int  z  =  3;  z  >  -1;  z--)  drawLine(color,0,z,0,3,z,y);
                                    flushBuffer();
                                    clearBuffer();
                                    delay(animationSpeed);
                                }
                                for  (int  y  =  3;  y  >  -1;  y--)  {
                                    for  (int  z  =  0;  z  <  4;  z++)  drawLine(color,0,z,0,y,z,3);
                                    flushBuffer();
                                    clearBuffer();
                                    delay(animationSpeed);
                                }
                                side  =  2;  break;
                            case  27:
                                for  (int  y  =  0;  y  <  4;  y++)  {
                                    for  (int  z  =  0;  z  <  4;  z++)  drawLine(color,z,0,0,z,3,y);
                                    flushBuffer();
                                    clearBuffer();
                                    delay(animationSpeed);
   92   93   94   95   96   97   98   99   100   101   102