The Fibonacci Sequence or Golden Ratio. I didn't sleep well last night so got up and tried to recall how I got the computer to create a Fabonacci sequence. I've done it before but I must admit I struggled over something so simple that I got tired and fell asleep. It did the job.
(a) is the number you want it to iterate to.
the x, y bit and visa versa is Pythonese for making it use the last value when it starts a new iteration. I think. Ignore the left hand window, that just shows that x + y gives x for each iteration.
The above is it doing my birthday.
It's a beautiful day here. I went into Cupar first thing and despite slip sliding survived intact. The back roads are pretty grim with frozen melt water and hard rutted snow. Not to worry it livens up a dull drive.
No wind damage here and I hope you faired the same.
I gave up computer programming after GFA Basic and BBC Basic. Tried to come to terms with C++ some years ago but failed. Just the occasional dabble with Arduino these days. Python looks interesting.
ReplyDeletePlenty of very gusty wind yesterday. We have had our normal February snow - a couple of hours of large soft flakes which melted after a short while.
I find it a touch difficult, I do have a massive course folder from Glasgow University all about Python. It doesn't stop me missing spaces, indents, commas or other such idiocy. I usually just copy and paste.
ReplyDeleteI can do G-Code for machines but am very slow at it.
Heavy rain overnight and it's still doing it. Dread to think what the roads are like.