27.1.13

Jan 21-25

I think many of the students in CSC104 have to admit that what we learnt this week is really kind of hard to beginners. I feel like we suddenly jumped to another level of programming which is much higher than where we were last week.

The paper folding problem has always been confusing us for the last few weeks and this week we had a noticeable progress which is we finally found the basic rules of how the pattern behaves. As Professor Heap showed to us, if we divide the piece of paper into 2 sections, the creases on the right section is just the same as what it was before its last folding,that is :

1 fold                D
2 folds             U D D
3 folds         U U D D U D D   
                   .......
We can see from the diagram above, the right section after the second fold is "D", which is the same as what the paper looked like after the first fold and after the third fold, the underlined part "U D D" is just what we get after the second fold. On the analogy of this discovery, we then can will be able to find what the paper looks like after any given times of folds with the help of computer software, and the only thing left now is to turn our discovery into a programming language.

The second important thing we learnt this week is how to build definitions in Dr. Racket. A simple definition is easy to understand, but if we compose an output as an input again and again, the definition can be more and more complex. I tried several definitions in the Dr. Racket by myself and found it's funny, and trying to understand a complex definition is a good way of training logic as well.

According to the calendar, I saw that there is an assignment due next week, hope it will not be too hard. 


2 comments:

  1. OMG I think I just understand the paper folding program by reading your blog... Thanks a lots!!!!!!

    ReplyDelete
  2. Impressive: your blog has given another student an AHA! moment.

    Also, experimenting in DrRacket is a great way to strengthen your understanding of a programmer's approach to problem-solving.

    ReplyDelete