From b1572c19036228177c4ce0a46d083448f0872603 Mon Sep 17 00:00:00 2001 From: cynferdd Date: Mon, 1 Oct 2018 16:02:49 +0200 Subject: [PATCH 1/2] udpated readme.md to add Cynferdd name, description, and links to twitter and github --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 71e5bcb..46752fc 100644 --- a/README.md +++ b/README.md @@ -67,6 +67,12 @@ Start adding your names here: - [![twitter-alt][twitter-img]](https://twitter.com/shubhamnishad97) [![github-alt][github-img]](https://github.com/shubhamnishad97) +### Mathieu Jolivet (Cynferdd) +- Developper as a hobby since 1996, professionaly since 2005. +- Bass player, I also love reading, photography and beer. +- [![twitter-alt][twitter-img]](https://twitter.com/cynferdd) + [![github-alt][github-img]](https://github.com/cynferdd) + ### Example Profile - I'm an example that you can copy, if you want :) - I work for... From da016b3828ea8d09942bb9a5867ad5648244bae8 Mon Sep 17 00:00:00 2001 From: cynferdd Date: Mon, 1 Oct 2018 16:09:14 +0200 Subject: [PATCH 2/2] adding fibonacci.rb a fibonacci code in ruby. --- code/fibonacci.rb | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 code/fibonacci.rb diff --git a/code/fibonacci.rb b/code/fibonacci.rb new file mode 100644 index 0000000..72c9d8c --- /dev/null +++ b/code/fibonacci.rb @@ -0,0 +1,21 @@ +##################### +# Fibonacci in Ruby # +##################### + # main fibonacci function +def CalculateFibonacci(n) + if (n == 0) + return 0 + elsif (n <= 2) + return 1 + else + return CalculateFibonacci(n - 1) + CalculateFibonacci(n - 2) + end +end + # execution with check regarding the amount of args +if(ARGV.length < 1) + puts "argument needed. term number to iterate to, with 0 as the first term number" +else + for arg in ARGV + puts arg.to_s + ": " + CalculateFibonacci(arg).to_s + end +end