Skip to content

Commit 8bb59c2

Browse files
committed
add fibonacci exercise
1 parent 3698399 commit 8bb59c2

File tree

3 files changed

+61
-0
lines changed

3 files changed

+61
-0
lines changed
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
{
2+
"exercise": "fibonacci-suite",
3+
"cases": [
4+
{
5+
"uuid": "17146bd5-2e80-4557-ab4c-05632b6b0d01",
6+
"description": "Starting point 0",
7+
"property": "",
8+
"input": {
9+
"number": 0
10+
},
11+
"expected": 0
12+
},
13+
{
14+
"uuid": "5a02fd08-d336-4607-8006-246fe6fa9fb1",
15+
"description": "starting point 1",
16+
"property": "",
17+
"input": {
18+
"number": 1
19+
},
20+
"expected": [1]
21+
},
22+
{
23+
"uuid": "5a02fd08-d336-4607-8006-246fe6fa9fb3",
24+
"description": "number 3",
25+
"property": "",
26+
"input": {
27+
"number": 3
28+
},
29+
"expected": [2]
30+
},
31+
{
32+
"uuid": "5a02fd08-d336-4607-8006-246fe6fa9fb5",
33+
"description": "number 5",
34+
"property": "",
35+
"input": {
36+
"number": 5
37+
},
38+
"expected": [5]
39+
},
40+
{
41+
"uuid": "5a02fd08-d336-4607-8006-246fe6fa9fb2",
42+
"description": "number 20",
43+
"property": "",
44+
"input": {
45+
"number": 20
46+
},
47+
"expected": [6765]
48+
}
49+
50+
]
51+
}

exercises/fibonacci/description.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Description
2+
3+
Write a function to get the n'th Fibonacci number, The first number of the pattern is 0, the second number is 1, and each number after that is equal to adding the two numbers right before it together.
4+
F0 =0, F1 =1, F2 =1, F3 = 2...
5+
(https://simple.wikipedia.org/wiki/Fibonacci_number)
6+
Hint: Think recursively!

exercises/fibonacci/metadata.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
title = "Fibonacci suite"
2+
blurb = "Fibonacci suite is based on the sum of the previos two Fibonacci numbers"
3+
source = "Inspired by the exercise in scala red book"
4+
source_url = "https://simple.wikipedia.org/wiki/Fibonacci_number"

0 commit comments

Comments
 (0)