Skip to content

Commit

Permalink
Add fibonacci test
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisLane committed Nov 25, 2016
1 parent a922042 commit 8fc760f
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/compile/success/fibonacci.src
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// This test will evaluate to print fibonacci numbers less than 50.
main () {
var x = 50;
var a = 0;
var b = 1;

print $a;
var temp = 0;
while ($b <= ($x-1)) {
print $b;
temp = $a + $b;
a = $b;
b = $temp;
};
}
10 changes: 10 additions & 0 deletions tests/compile/success/output/fibonacci.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
0
1
1
2
3
5
8
13
21
34

0 comments on commit 8fc760f

Please sign in to comment.