Fibonacci Sequence 🐚
Calculate the famous Fibonacci sequence
The Fibonacci sequence is a series of numbers which looks like this:
0, 1, 1, 2, 3, 5, 8, 13 ...
It starts with 0
and 1
and it continues forever. The next number is always the result of adding the two previous numbers.
0 + 1 = 1
1 + 1 = 2
1 + 2 = 3
2 + 3 = 5
...
Learn more about the Fibonacci sequence.
Can you write a scratch program that calculates the Fibonacci sequence?
Demo The Project 👇
Solution
To start we'll create two variables to represent the numbers which start the sequence.
We'll calculate the next number in the sequence when our sprite is clicked.
Next let's make our character say each number and its place in the sequence.
We can add costume changes to make our sprite move.
Finally we'll use an if
block to make sure the sprite can't be clicked before it is ready.
The project is complete. Good job!