This article explains how to create a Fibonacci number generator.

## Contents

## What is a Fibonacci Number Sequence?

A fibonacci number sequence starts with the numbers 1 and 1. To get the next number of the sequence, add up the previous two numbers. It was first described by Leonardo of Pisa, nicknamed Fibonacci, in his book Liber abbaci.

## Creating a Fibonacci Number Generator

Use this script to create a fibonacci number generator:

when gf clicked delete (all v) of [numbers v] set [a v] to [1] set [b v] to [1] add (a) to [numbers v] add (b) to [numbers v] forever set [c v] to ((a) + (b)) add (c) to [numbers v] set [a v] to (b) set [b v] to (c) wait (1) secs // any number end

or use this and it will give the same result

when gf clicked delete (all v) of [numbers v] set [a v] to [0] set [b v] to [1] forever set [c v] to ((a) + (b)) add (c) to [numbers v] set [a v] to (b) set [b v] to (c) wait (1) secs // any number end