Code: Alles auswählen
elif ((Bild.getpixel((((x-1),y))) == weiss)) and (Bild.getpixel(((x,(y+1))) == weiss)) and (Bild.getpixel(((x,(y-1))) == weiss)) and (Bild.getpixel((((x-1),(y-1))) == grun)):
x = x - 1
y = y + 1
elif ((Bild.getpixel((((x+1),y))) == weiss)) and (Bild.getpixel(((x,(y+1))) == weiss)) and (Bild.getpixel(((x,(y-1))) == weiss)) and (Bild.getpixel((((x+1),(y-1))) == grun)):
x = x + 1
y = y + 1
elif ((Bild.getpixel((((x-1),y))) == weiss)) and (Bild.getpixel(((x,(y+1))) == weiss)) and (Bild.getpixel(((x,(y-1))) == weiss)) and (Bild.getpixel((((x-1),(y+1))) == grun)):
x = x - 1
y = y - 1
elif ((Bild.getpixel((((x+1),y))) == weiss)) and (Bild.getpixel(((x,(y+1))) == weiss)) and (Bild.getpixel(((x,(y-1))) == weiss)) and (Bild.getpixel((((x+1),(y+1))) == grun)):
x = x + 1
y = y - 1
elif ((Bild.getpixel(((x,(y-1))) == weiss)) and (Bild.getpixel((((x+1),y)) == weiss)) and (Bild.getpixel((((x-1),y)) == weiss)) and (Bild.getpixel((((x-1),(y-1))) == grun))):
x = x + 1
y = y - 1
elif ((Bild.getpixel(((x,(y+1))) == weiss)) and (Bild.getpixel((((x+1),y)) == weiss)) and (Bild.getpixel((((x-1),y)) == weiss)) and (Bild.getpixel((((x+1),(y-1))) == grun))):
x = x + 1
y = y + 1
elif ((Bild.getpixel(((x,(y-1))) == weiss)) and (Bild.getpixel((((x+1),y)) == weiss)) and (Bild.getpixel((((x-1),y)) == weiss)) and (Bild.getpixel((((x-1),(y+1))) == grun))):
x = x - 1
y = y - 1
elif ((Bild.getpixel(((x,(y+1))) == weiss)) and (Bild.getpixel((((x+1),y)) == weiss)) and (Bild.getpixel((((x-1),y)) == weiss)) and (Bild.getpixel((((x+1),(y+1))) == grun))):
x = x - 1
y = y + 1