Saturday, February 8, 2014

Week 5: Tower of Hanoi and some recursions

This week, I put a lot of effort to assignment 1. Tower of Hanoi is an interesting question, and I am surprised that computer can help us to solve it in such a clever way (if you told the computer to do the right thing).

Our job is to program a game with four stools. The most challenging part is to find the least moves, which will involve recursion. In Monday's lecture, we got some idea of three tools recursion.  In Wednesday's lecture, we learnt some thing about global and local values. If a function is inside anther function, then the values it produces will probably be local without using "global". It might be useful in assignment 1 I guess.

Labs are about tracing recursions. I think tracing is easier than actually writing the code. Because, to me, tracing is the first step of writing codes. Before writing codes, I prefer to write some examples, which is exactly what tracing will be.

Although the course is getting harder, I found it really interesting.

No comments:

Post a Comment