Advertisement
Guest User

Untitled

a guest
Nov 28th, 2014
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.68 KB | None | 0 0
  1. //Nachbarüberprüfng: Wenn der Nachbar gleich dem alten Charakter ist -> Aufruf mit Nachbarkoordinaten.
  2.         //Linker Nachbar
  3.         if (x > 0 && this.getZeile(y).toCharArray()[x - 1] == alt) {
  4.             fill(x - 1, y, c);
  5.         }
  6.  
  7.         //Rechter Nachbar
  8.         if (x + 1 < this.getHeight() && this.getZeile(y).toCharArray()[x + 1] == alt) {
  9.             fill(x + 1, y, c);
  10.         }
  11.         //Unterer Nachbar
  12.         if (y > 0 && this.getZeile(y - 1).toCharArray()[x] == alt) {
  13.             fill(x, y - 1, c);
  14.         }
  15.         //Oberer Nachbar
  16.         if (y + 1 < this.getWidth() && this.getZeile(y + 1).toCharArray()[x] == alt) {
  17.             fill(x, y + 1, c);
  18.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement