mirror of
https://github.com/zekexiao/pocketlang.git
synced 2025-02-06 12:46:53 +08:00
![Thakee Nathees](/assets/img/avatar_default.png)
- popping operands from the stack was too early -fixed - some temproary string objects weren't pushed to the vm's temp root -fixed - and some minor bug fixed
12 lines
218 B
Plaintext
12 lines
218 B
Plaintext
class Fib {
|
|
static get(n) {
|
|
if (n < 2) return n
|
|
return get(n - 1) + get(n - 2)
|
|
}
|
|
}
|
|
|
|
var start = System.clock
|
|
for (i in 0..10) {
|
|
System.print(Fib.get(28))
|
|
}
|
|
System.print("elapsed: %(System.clock - start)") |