mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-23 19:42:50 -06:00
compiler works on abs and fibonacci
This commit is contained in:
18
examples/gfcc/compiler/fibonacci.c
Normal file
18
examples/gfcc/compiler/fibonacci.c
Normal file
@@ -0,0 +1,18 @@
|
||||
int mx () {
|
||||
return 5000000 ;
|
||||
} ;
|
||||
|
||||
int main () {
|
||||
int lo ; int hi ;
|
||||
lo = 1 ;
|
||||
hi = lo ;
|
||||
printf(int,lo) ;
|
||||
{
|
||||
while (hi < mx()) {
|
||||
printf(int,hi) ;
|
||||
hi = lo + hi ;
|
||||
lo = hi - lo ;
|
||||
}
|
||||
}
|
||||
return ;
|
||||
} ;
|
||||
Reference in New Issue
Block a user