Skip to content

Commit 3cad67c

Browse files
DavidBuchanan314AileenLumina
authored andcommitted
tabs -> spaces
1 parent ef81560 commit 3cad67c

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

examples/_nx/mandelbrot.py

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,25 +10,25 @@
1010
palette_b = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 24, 45, 70, 97, 128, 136, 144, 152, 160, 168, 176, 184, 192, 200, 208, 202, 168, 130, 90, 46]
1111

1212
def mandel(x0, y0):
13-
x, y = (0.0, 0.0)
14-
for i in range(MAX_ITER):
15-
x, y = ( (x*x - y*y + x0), (2*x*y + y0) )
16-
if (x*x + y*y) >= 4:
17-
return i
18-
return 0
13+
x, y = (0.0, 0.0)
14+
for i in range(MAX_ITER):
15+
x, y = ( (x*x - y*y + x0), (2*x*y + y0) )
16+
if (x*x + y*y) >= 4:
17+
return i
18+
return 0
1919

2020
_nx.gfx_set_mode(GfxMode_LinearDouble)
2121

2222
fb = bytearray([0]*WIDTH*HEIGHT*4) # RGBA8888
2323

2424
for y in range(HEIGHT):
25-
y0 = (y/HEIGHT*2)-1
26-
for x in range(WIDTH):
27-
x0 = (x/HEIGHT*2)-2.5
28-
iterations = mandel(x0, y0)
29-
fb[(y*WIDTH+x)*4] = palette_r[iterations]
30-
fb[(y*WIDTH+x)*4+1] = palette_g[iterations]
31-
fb[(y*WIDTH+x)*4+2] = palette_b[iterations]
32-
33-
_nx.gfx_set_framebuffer(fb)
34-
_nx.gfx_flush_and_sync()
25+
y0 = (y/HEIGHT*2)-1
26+
for x in range(WIDTH):
27+
x0 = (x/HEIGHT*2)-2.5
28+
iterations = mandel(x0, y0)
29+
fb[(y*WIDTH+x)*4] = palette_r[iterations]
30+
fb[(y*WIDTH+x)*4+1] = palette_g[iterations]
31+
fb[(y*WIDTH+x)*4+2] = palette_b[iterations]
32+
33+
_nx.gfx_set_framebuffer(fb)
34+
_nx.gfx_flush_and_sync()

0 commit comments

Comments
 (0)