summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authoraarne <unknown>2004-09-25 08:51:33 +0000
committeraarne <unknown>2004-09-25 08:51:33 +0000
commita6219b3a0923bd928324054611b2f65316e67978 (patch)
tree34c636e3b6a1f098ca5ff5ea66eddfb90990640e /examples
parent5a208ce3ea26726d15e814c0498680597cca45fa (diff)
more examples
Diffstat (limited to 'examples')
-rw-r--r--examples/gfcc/compiler/demo.c9
-rw-r--r--examples/gfcc/compiler/demo.gifbin0 -> 135673 bytes
-rw-r--r--examples/gfcc/compiler/factorial.c21
3 files changed, 30 insertions, 0 deletions
diff --git a/examples/gfcc/compiler/demo.c b/examples/gfcc/compiler/demo.c
new file mode 100644
index 000000000..d9a95d2b6
--- /dev/null
+++ b/examples/gfcc/compiler/demo.c
@@ -0,0 +1,9 @@
+int fact (int n) {
+ int f ;
+ f = 1 ;
+ while (1 < n) {
+ f = n * f ;
+ n = n - 1 ;
+ }
+ return f ;
+} ;
diff --git a/examples/gfcc/compiler/demo.gif b/examples/gfcc/compiler/demo.gif
new file mode 100644
index 000000000..798c09170
--- /dev/null
+++ b/examples/gfcc/compiler/demo.gif
Binary files differ
diff --git a/examples/gfcc/compiler/factorial.c b/examples/gfcc/compiler/factorial.c
new file mode 100644
index 000000000..7c8fca524
--- /dev/null
+++ b/examples/gfcc/compiler/factorial.c
@@ -0,0 +1,21 @@
+int fact (int n) {
+ int f ;
+ f = 1 ;
+ {
+ while (1 < n) {
+ f = n * f ;
+ n = n - 1 ;
+ }
+ }
+ return f ;
+} ;
+
+int main () {
+ int n ;
+ n = 1 ;
+ {
+ while (n < 11) printf(int,fact(n)) ; n = n+1 ;
+ }
+ return ;
+} ;
+