diff --git a/archive/r/red/fibonacci.red b/archive/r/red/fibonacci.red new file mode 100644 index 000000000..9d574d7c3 --- /dev/null +++ b/archive/r/red/fibonacci.red @@ -0,0 +1,24 @@ +Red [Title: "Fibonacci"] + +fibonacci: func[n] [ + +if n <= 0 [return 0] + +if n > 0 [ + a: 0 + b: 1 + i: 1 + loop n [ + c: a + b + a: b + b: c + print [i":" a] + i: i + 1 + ] + ] + + +;if n = "" [print "Usage: please input the count of fibonacci numbers to output"] +;if not integer? n [print "Usage: please input the count of fibonacci numbers to output"] + +] \ No newline at end of file