OLD | NEW |
1 library; | 1 library; |
2 import self as self; | 2 import self as self; |
3 import "dart:core" as core; | 3 import "dart:core" as core; |
4 | 4 |
5 static method fibonacci(core::int n) → core::int { | 5 static method fibonacci(core::int n) → core::int { |
6 if(n.<(2)) | 6 if(n.<(2)) |
7 return n; | 7 return n; |
8 return self::fibonacci(n.-(1)).+(self::fibonacci(n.-(2))); | 8 return self::fibonacci(n.-(1)).+(self::fibonacci(n.-(2))); |
9 } | 9 } |
10 static method main() → dynamic { | 10 static method main() → dynamic { |
11 for (core::int i = 0; i.<(20); i = i.+(1)) { | 11 for (core::int i = 0; i.<(20); i = i.+(1)) { |
12 core::print(self::fibonacci(i)); | 12 core::print(self::fibonacci(i)); |
13 } | 13 } |
14 } | 14 } |
OLD | NEW |