Advertisement
Guest User

Rotation

a guest
Dec 29th, 2015
576
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.56 KB | None | 0 0
  1. public static char [][] RotationDroite (char [][] grilleJeu){
  2.     char [][] grilleRotation;  
  3.     grilleRotation = new char [7][7] ;
  4.         for (int i=0; i<=6; i++) {    
  5.             for ( int j=0 ; j<=6; j++) {
  6.                 grilleRotation [i][j] = grilleJeu [6-j][i];
  7.             }
  8.         }
  9.         return grilleRotation;
  10.     }
  11.    
  12.     public static char [][] RotationGauche (char [][] grilleJeu){
  13.     char [][] grilleRotation;  
  14.     grilleRotation = new char [7][7] ;
  15.         for (int i=0; i<=6; i++) {    
  16.             for ( int j=0 ; j<=6; j++) {
  17.                 grilleRotation [i][j] = grilleJeu [j][6-i];
  18.             }
  19.         }
  20.         return grilleRotation;
  21.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement