summaryrefslogtreecommitdiffstats
path: root/tests/langbench/fib.py
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2016-04-19 20:35:49 (GMT)
committerdgp <dgp@users.sourceforge.net>2016-04-19 20:35:49 (GMT)
commit66032e8a327e0498b0d8970307452f66c69be25c (patch)
tree345b92b9d0c1be0f8ff45032a38884929744545e /tests/langbench/fib.py
parent0a228666ae8b3189ae92ff7624263de1455c24ff (diff)
downloadtcl-66032e8a327e0498b0d8970307452f66c69be25c.zip
tcl-66032e8a327e0498b0d8970307452f66c69be25c.tar.gz
tcl-66032e8a327e0498b0d8970307452f66c69be25c.tar.bz2
Fork of Tcl used in the "Little" project.
http://www.mcvoy.com/lm/little/index.html
Diffstat (limited to 'tests/langbench/fib.py')
-rw-r--r--tests/langbench/fib.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/langbench/fib.py b/tests/langbench/fib.py
new file mode 100644
index 0000000..f369a4c
--- /dev/null
+++ b/tests/langbench/fib.py
@@ -0,0 +1,8 @@
+def fib(n):
+ if n < 2:
+ return n
+ else:
+ return fib(n-1) + fib(n-2)
+
+for i in range(30):
+ print "n=%d => %d" % (i, fib(i))