Skip to content

Commit b2aa7ac

Browse files
committed
[WASM] Changed the demo to fibonacci calculation
1 parent 3e23162 commit b2aa7ac

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

wasm/app/index.html

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,18 @@
2929
<h1>RustPython Demo</h1>
3030
<p>RustPython is a Python interpreter writter in Rust. This demo is compiled from Rust to WebAssembly so it runs in the browser</p>
3131
<p>Please input your python code below and click <kbd>Run</kbd>:</p>
32-
<textarea id="code">x = 1
33-
y = 2
34-
print('Hello! x + y equals to ' + str(x+y))
35-
</textarea>
32+
<textarea id="code">n1 = 0
33+
n2 = 1
34+
count = 0
35+
until = 10
36+
37+
print("These are the first " + str(until) + " number in a Fibonacci sequence:")
38+
39+
while count < until:
40+
print(n1)
41+
n1, n2 = n2, n1 + n2
42+
count += 1
43+
</textarea>
3644
<button id="run-btn">Run &#9655;</button>
3745
<script src="./bootstrap.js"></script>
3846
<h3>Standard Output</h3>

0 commit comments

Comments
 (0)