PDA

View Full Version : Test if number is Fibonacci


aeroworks
10-30-2011, 12:54 PM
I just finished an assignment for my class at Owens, and thought i would share wit the community.

Objectives:
Create and Alice world with a Count penguin and a Fibonacci penguin. Count penguin will simply start counting slowly when the world starts. The Fibonacci penguin will jump up and down and flap its wings while saying "Fibonacci, Fibonacci, (n) is Fibonacci!" When Count penguin says a number that is part of the Fibonacci sequence. the Fibonacci penguin should say the actual number in place of (n). (p.211 "An introduction to programming Using Alice 2.2" Charles W. Herbert 2nd edition)

I am not sure if theirs a better way to do this, however this is my attempt. And it works quite well. Can anybody offer any improvements to my method?
-John

x2495iiii
10-30-2011, 02:05 PM
Cool. I'm going to Owens too. Who was your teacher?

aeroworks
10-30-2011, 02:27 PM
Mrs. Buser

x2495iiii
10-30-2011, 04:38 PM
Yup. Same here.

aeroworks
10-30-2011, 04:39 PM
Your in her class now? or have had her in the past?

x2495iiii
10-30-2011, 09:39 PM
Past.

She was the teacher who didn't like it when I was going above and beyond in my worlds. She thought it was wasting time.

Then again, I didn't work nearly as hard as I should've in her other class.

I guess it evens out.

Oh well. Great world man. A nice bit of logic there.