Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Nachbarüberprüfng: Wenn der Nachbar gleich dem alten Charakter ist -> Aufruf mit Nachbarkoordinaten.
- //Linker Nachbar
- if (x > 0 && this.getZeile(y).toCharArray()[x - 1] == alt) {
- fill(x - 1, y, c);
- }
- //Rechter Nachbar
- if (x + 1 < this.getHeight() && this.getZeile(y).toCharArray()[x + 1] == alt) {
- fill(x + 1, y, c);
- }
- //Unterer Nachbar
- if (y > 0 && this.getZeile(y - 1).toCharArray()[x] == alt) {
- fill(x, y - 1, c);
- }
- //Oberer Nachbar
- if (y + 1 < this.getWidth() && this.getZeile(y + 1).toCharArray()[x] == alt) {
- fill(x, y + 1, c);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement