Skip to content

Commit

Permalink
[Doc] Update hello_world.md (#7337)
Browse files Browse the repository at this point in the history
close: #7335
  • Loading branch information
neozhaoliang authored Feb 10, 2023
1 parent 7fd9f82 commit 90c1940
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions docs/lang/articles/get-started/hello_world.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,12 @@ def paint(t: float):

gui = ti.GUI("Julia Set", res=(n * 2, n))

for i in range(1000000):
i = 0
while gui.running:
paint(i * 0.03)
gui.set_image(pixels)
gui.show()
i += 1
```

Save the code above to your local machine and run this program.
Expand Down Expand Up @@ -203,10 +205,12 @@ Lines 18~23 render the result on your screen using Taichi's built-in [GUI System
gui = ti.GUI("Julia Set", res=(n * 2, n))
# Sets the window title and the resolution

for i in range(1000000):
i = 0
while gui.running:
paint(i * 0.03)
gui.set_image(pixels)
gui.show()
i += 1
```

The program iterates over `pixels` 1,000,000 times, and the fractal pattern stored in `pixels` is updated accordingly. Call `gui.set_image()` to set the window and `gui.show()` to display the synchronized result on your screen.
Expand Down

0 comments on commit 90c1940

Please sign in to comment.