Jun-20-2019, 02:32 PM
I found something like this:
Could You tell my, why we "check" modulo for each coordinate?
for x in range(S): for y in range(S): total = (tablica[x, (y-1)%S] + tablica[x, (y+1)%S] + tablica[(x-1)%S, y] + tablica[(x+1)%S, y] + tablica[(x-1)%S, (y-1)%S] + tablica[(x-1)%S, (y+1)%S] + tablica[(x+1)%S, (y-1)%S] + tablica[(x+1)%S, (y+1)%S])Where S-size.
Could You tell my, why we "check" modulo for each coordinate?