Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created November 17, 2021 02:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parzibyte/30669779cffa3d0cc1d591023717f3af to your computer and use it in GitHub Desktop.
Save parzibyte/30669779cffa3d0cc1d591023717f3af to your computer and use it in GitHub Desktop.
# Vamos a recorrer una mini matriz en la caja
inicio_y = y-1
inicio_x = x-1
fin_y = y+1
fin_x = x+1
if inicio_y < 0:
inicio_y = 0
if inicio_x < 0:
inicio_x = 0
if fin_x >= ancho:
fin_x = ancho - 1
if fin_y >= alto:
fin_y = alto - 1
suma_red = 0
suma_green = 0
suma_blue = 0
conteo = 0
while inicio_y <= fin_y:
indice_x = inicio_x
while indice_x <= fin_x:
# Aquí calculamos el promedio
indice_x += 1
conteo += 1
inicio_y += 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment