summaryrefslogtreecommitdiff
path: root/regress/usr.bin/m4/fibo.pl
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2000-07-01 14:18:40 +0000
committerMarc Espie <espie@cvs.openbsd.org>2000-07-01 14:18:40 +0000
commita55f8147fae5d3bdf88f83dde846350d7d968138 (patch)
tree76109b620e157ac209f2060d4334eeef11057736 /regress/usr.bin/m4/fibo.pl
parent55d7285dc37b52c197b83bd8c4a938c486012a9b (diff)
Small perl script to create fibo.out.
length parameter to try to push fibo.m4 further.
Diffstat (limited to 'regress/usr.bin/m4/fibo.pl')
-rw-r--r--regress/usr.bin/m4/fibo.pl11
1 files changed, 11 insertions, 0 deletions
diff --git a/regress/usr.bin/m4/fibo.pl b/regress/usr.bin/m4/fibo.pl
new file mode 100644
index 00000000000..58d87bd5b05
--- /dev/null
+++ b/regress/usr.bin/m4/fibo.pl
@@ -0,0 +1,11 @@
+#! /usr/bin/perl
+my $n=shift;
+
+$fibo[0] = 'a';
+$fibo[1] = 'b';
+for (my $i = 2; $i <= $n; $i++) {
+ $fibo[$i] = $fibo[$i-1].$fibo[$i-2];
+}
+
+print $fibo[$n], "\n";
+