Sunday, February 1, 2015

On Recursion and Inheritance

I feel like after these past two-three weeks of lectures and tutorials, I have learned some of the most useful things in programming! Recursion is one of the best things that has ever happened to me in my opinion! It converts a crazy problem into only a few lines of code and I would give it a 10/10. I wanted to have some practice problems on recursion for our Midterm1(Good luck everybody) in the upcoming week but since I couldn't find any, I just started implementing code to give me the nth Fibonacci number, the sum of numbers (1^2, 2^2, ...,n^n) and these sorts of things which I suggest you to do if you want to have more practice on this matter.
what is the Fibonacci sequence ?

One more thing I am thankful for is inheritance and I know all of you who took csc108 last term agree with me! I can feel how much knowing how to implementing  sub/super classes would have helped us on out assignments!

I am currently trying to write code to play a simple Hanoi tower puzzle using stacks and it is becoming really interesting! I will show you my code probably after the midterm in the next slog entry! I encourage you to also try it and if you don't know what a Hanoi tower is, check out the following link!
Hanoi tower puzzle
happy studying everyone!

2 comments:

  1. Eagerly awaiting your code for a Hanoi tower puzzle game. I killed nearly on hour playing the game you linked.

    ReplyDelete