Wednesday, October 3, 2012

Making Programming Useful!

I'm really enjoying the things that we have been learning in the course so far. After the third lecture, we created a "clock". For the first time I can actually see how you would put the things we are learning to use in a game or on a website for example. At the beginning, I didn't really know why we would need to create a red circle in the program when we can also just copy and paste in images. But now that we can make things take action at certain times, and after the press of certain buttons, things are coming together.

I've just completed the tutorial exercise where we play around with big-bang, and making an action occur on the "tick". In lecture we didn't learn how to change the time interval that each tick represented. It was kind of fun to discover how to do this on my own. There were some things represented in the text (Picturing Programs) that were performed in a different way than we learned in lecture. The text makes an image rotate clockwise like this:
(on-tick rotate-cw)
In lecture we would change the rotation degree to a negative in order to make it rotate clockwise. While discrepancies like this were originally confusing, upon examining them further it was fairly enlightening to see that there are multiple ways to do the same thing. So far my impression of the programming world is that it is fairly strict, so seeing some flexibility here was refreshing.

The most difficult task presented to me in the exercises for tutorial 3 came when we had to alter the window size by adding additional arguments to (on-draw) rather than overlaying the image on a second image. This hadn't been discussed in lecture, so I searched the help desk for "on-draw" and it provided me with the following information:

(to-draw render-expr width-expr height-expr)

I wasn't really sure what "render" or "expr" meant, but I tried using this formula:

(on-draw render-expr width-100 height-100)

Eventually I figured out that "show-it" that we used previously may represent "render-expr" and that "width/height-expr" may represent numbers. So I tried one more time with:

(on-draw show-it 100 100)

I was finally successful! I'm pleased that I am slowly being able to problem solve my way through the world of programming. Part way through this exercise I was prepared to take this issue to my TA, so I am really happy that I was able to figure it out on my own. 

Things are starting to seem pretty complicated, and I am not sure how well I am going to retain the information. I'm very comfortable playing around with DrRacket and correcting things when I get an error message, but I am concerned about my ability to recall the things that I have been doing when it comes to the first test. That being said, there have only been three tutorials so far and since the test is next week, I feel confident that with enough practice I will do just fine!


No comments:

Post a Comment