Skip to content
This repository was archived by the owner on Aug 27, 2024. It is now read-only.

Commit 642458a

Browse files
MaxGraeyrvolosatovs
authored andcommitted
simplify & reformat
Signed-off-by: Max Graey <[email protected]>
1 parent 78f72e8 commit 642458a

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

AssemblyScript/fibonacci/fibo.ts

+5-10
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,9 @@
11
import "wasi";
2-
import { Console } from "as-wasi";
32

4-
export function fibo (n: i32): i32 {
5-
if(n==1 || n==0){
6-
return n;
7-
}
8-
else{
9-
return fibo(n-1) + fibo(n-2);
10-
}
3+
export function fibo(n: i32): i32 {
4+
if (n == 0 || n == 1) return n;
5+
return fibo(n - 1) + fibo(n - 2);
116
}
127

13-
let a: i32 = fibo(7);
14-
Console.log(a.toString());
8+
let res = fibo(7);
9+
console.log(res.toString());

0 commit comments

Comments
 (0)