Tuesday, February 12, 2013

Weekly Log4

What I learned last week:
Last week I learned something new to mess with pictures in DrRacket. First one is "list". Obviously, "list" function can list strings, pictures and numbers.For example,if we define "menagerie" as "list" several pictures, we can get the first picture of the list by inputting "first menagerie". We can the rest of the list by inputting "rest menagerie". Similarly, "reverse menagerie" gives the reverse version of the list. 

Also, "struct" is like a customized combination which can include numbers, strings, pictures, and so on. We can define-struct something as a combination of picture, name and number of feet(place holders).For example, define-struct "venus" name pic feet.Then define specific things by "make-venus" and tells DrRacket the exact name, picture and number of feet.(define venusA (make-venus "elephant" jumbo 4)). We can get particular elements, such as the number of feet, by saying (venus-feet venusA), DrRacket should give us "4" back.

We can also see the whole list of colors of a picture by inputting "(define pingu-list (image->color-list pingu))". DrRacket will give us a long list. The first number is the red color, second is the green, third is the blue and the last is the level of opacity.

What I am confused about:
How many arguments can "define-struct" contain? What is the maximum? How does DrRacket list all the colors? Through which order? From Top right to bottom left?

Feedback of the Test:
I studied for the test with a friend and we talked about things we were confused about and exchanged notes. This helps both of us and we both think the test is not as hard as we expected it to be. Here is one thing we need to improve that we should focus on memorizing instead of understanding stuffs. it is more efficient to try out new functions in DrRacket.




No comments:

Post a Comment