Test if number is Fibonacci
1 Attachment(s)
I just finished an assignment for my class at Owens, and thought i would share wit the community.
[B][I]Objectives[/I][/B]: 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, ([B]n[/B]) 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 ([B]n[/B]). (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 |
Cool. I'm going to Owens too. Who was your teacher?
|
Mrs. Buser
|
Yup. Same here.
|
Your in her class now? or have had her in the past?
|
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. |
All times are GMT -5. The time now is 02:57 PM. |
Copyright ©2024, Carnegie Mellon University
Alice 2.x © 1999-2012, Alice 3.x © 2008-2012, Carnegie Mellon University. All rights reserved.