Skip to content

Commit 42768b2

Browse files
committed
Small demo improvements
1 parent aede03c commit 42768b2

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

wasm/demo/snippets/mandelbrot.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
h = 50.0
33

44
def mandel():
5-
"""Print a mandelbrot fractal to the console, yielding after each character
6-
is printed"""
5+
"""Print a mandelbrot fractal to the console, yielding after each character is printed"""
76
y = 0.0
87
while y < h:
98
x = 0.0
@@ -32,12 +31,14 @@ def mandel():
3231
y += 1
3332
yield
3433

34+
# run the mandelbrot
35+
3536
try: from browser import request_animation_frame
3637
except: request_animation_frame = None
3738

3839
gen = mandel()
3940
def gen_cb(_time=None):
40-
gen.__next__()
41+
for _ in range(4): gen.__next__()
4142
request_animation_frame(gen_cb)
4243
if request_animation_frame: gen_cb()
43-
else: list(gen)
44+
else: any(gen)

wasm/demo/src/style.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
textarea {
22
font-family: monospace;
3-
resize: none;
3+
resize: vertical;
44
}
55

66
#code,

0 commit comments

Comments
 (0)