Advertisement
Guest User

Untitled

a guest
Dec 10th, 2019
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.64 KB | None | 0 0
  1.                     //over diagonally
  2.                    
  3.                     if (col != 0) {
  4.                        
  5.                         int up = col-1;
  6.                        
  7.                         for (up = col-1; up >= 0; up--) {
  8.                    
  9.                             // back
  10.                             if (row != 0) {
  11.                                
  12.                                 for (int back = col - 1; back >= 0; back--) {
  13.                                    
  14.                                     if (lines.get(up).charAt(back) == '#') {
  15.                                        
  16.                                         int offsetX = col - back;
  17.                                         int offsetY = row - up;
  18.  
  19.                                         int x = back - offsetX;
  20.                                         int y = up - offsetY;
  21.  
  22.                                         while (x >= 0 && y >= 0)
  23.                                         {
  24.                                             temp[y][x] = '.';
  25.                                             x -= offsetX;
  26.                                             y -= offsetY;
  27.  
  28.                                         }
  29.                                     }
  30.                                 }
  31.                             }
  32.                         }
  33.                     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement