Advertisement
guieuiuz

7.1

Feb 21st, 2017
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.69 KB | None | 0 0
  1. public void mirrorTemple()
  2.   {
  3.     int count = 0;
  4.     int mirrorPoint = 276;
  5.     Pixel leftPixel = null;
  6.     Pixel rightPixel = null;
  7.     int count = 0;
  8.     Pixel[][] pixels = this.getPixels2D();
  9.    
  10.     // loop through the rows
  11.     for (int row = 27; row < 97; row++)
  12.     {
  13.       // loop from 13 to just before the mirror point
  14.       for (int col = 13; col < mirrorPoint; col++)
  15.       {
  16.        
  17.         leftPixel = pixels[row][col];      
  18.         rightPixel = pixels[row]                      
  19.                          [mirrorPoint - col + mirrorPoint];
  20.         rightPixel.setColor(leftPixel.getColor());
  21.         count ++;
  22.       }
  23.     }
  24.  
  25.     System.out.println("Number of times: " + count);
  26.   }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement