mirror of
https://github.com/RustPython/RustPython.git
synced 2026-10-28 18:59:04 +08:00
[WASM] Changed the demo to fibonacci calculation
This commit is contained in:
1 parent
3e231620cd
commit
b2aa7ac2fb
1 file changed
+12
-4
+12
-4
@@ -29,10 +29,18 @@
|
||||
<h1>RustPython Demo</h1>
|
||||
<p>RustPython is a Python interpreter writter in Rust. This demo is compiled from Rust to WebAssembly so it runs in the browser</p>
|
||||
<p>Please input your python code below and click <kbd>Run</kbd>:</p>
|
||||
<textarea id="code">x = 1
|
||||
y = 2
|
||||
print('Hello! x + y equals to ' + str(x+y))
|
||||
</textarea>
|
||||
<textarea id="code">n1 = 0
|
||||
n2 = 1
|
||||
count = 0
|
||||
until = 10
|
||||
|
||||
print("These are the first " + str(until) + " number in a Fibonacci sequence:")
|
||||
|
||||
while count < until:
|
||||
print(n1)
|
||||
n1, n2 = n2, n1 + n2
|
||||
count += 1
|
||||
</textarea>
|
||||
<button id="run-btn">Run ▷</button>
|
||||
<script src="./bootstrap.js"></script>
|
||||
<h3>Standard Output</h3>
|
||||
|
||||
Reference in new issue
Block a user