# Simple Fibonacci genertor

## Recommended Posts

; Fibonacci number generator, first 50 only

#include <array.au3>

Dim \$fib1 = 1, \$fib2 = 2, \$fib3, \$results[51], \$temp

\$results[1] = \$fib1

\$results[2] = \$fib2

For \$temp = 3 To 50

\$fib3 = \$fib1 + \$fib2

\$results[\$temp] = \$fib3

swap(\$fib1, \$fib2, \$fib3)

Next

_ArrayDisplay(\$results, "50 Fibonacci Numbers")

Func swap(ByRef \$a, ByRef \$b, ByRef \$c)

\$a = \$b

\$b = \$c

EndFunc ;==>swap

##### Share on other sites

Nice script.

Keep it up!

peethebee

vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvGerman Forums: http://www.autoit.deGerman Help File: http://autoit.de/hilfe vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv

##### Share on other sites

I have made something like that before, using an algorithm like this:

```\$a = 1
\$b = 1
While 1
\$c = \$a + \$b
\$b = \$c + \$a
\$a = \$b + \$c
Wend```
```1 + 1 = 2
2 + 1 = 3
3 + 2 = 5
5 + 3 = 8
8 + 5 = 13
...```
Very nice work though! I never thought about using arrays...

##### Share on other sites

I really don't want to seem rude but what exactly is the fibboncci (did I spell that right?) sequence good for ? I have heard about it several times but am not sure what it couldbe used for. Any idea or explanation will be appreciated, ty .

[center][/center]Working on the next big thing.Currently Playing: Halo 4, League of LegendsXBL GT: iRememberYhslaw

##### Share on other sites

I really don't want to seem rude but what exactly is the fibboncci (did I spell that right?) sequence good for ? I have heard about it several times but am not sure what it couldbe used for. Any idea or explanation will be appreciated, ty .

<{POST_SNAPBACK}>

No, excellent question...

I've seen this in fractint (program to make fractal imagery) but I still don't know exactly what it is for ...

Hey anyone enough to make a fractal generator in AutoIt3? That WOULD be cool! Oh it needs to spin in 3d too (just kidding)

I am endeavoring, ma'am, to construct a mnemonic circuit using stone knives and bearskins.SpockMy UDFs:Deleted - they were old and I'm lazy ... :)My utilities:Comment stripperPolicy lister 1.07AutoIT Speed Tester (new!)

##### Share on other sites

Ok here's something like 200 pages worth of information on Fibonacci numbers ...

Fibonacci Numbers and the Golden Section

Can you believe it all started with someone observing rabbits?

And here's that program I lost so much time on trying different formulas and combinations ... WELCOME to the Fractint WWW pages

Really an awesome program. Look ma, no drugs

I am endeavoring, ma'am, to construct a mnemonic circuit using stone knives and bearskins.SpockMy UDFs:Deleted - they were old and I'm lazy ... :)My utilities:Comment stripperPolicy lister 1.07AutoIT Speed Tester (new!)

## Create an account

Register a new account

×

• Wiki

• Back

• Git