Wednesday, December 5, 2012

My Second CS Project

Here's  my second CS project.
Actually it was much easier than the last one,  but involved more math calculations.
Basically what were required was to write some check-expects in onder to make all the tests pass.
I found something interesting while working on the project.
When I was required to write two check-expect expressions for interpolate-image, one  for when n = DENOM, the other for whem n = NUMER, I tried two kinds of check-expects and they all worked.

Firstly I tried

(check-expect (interpolate-image pic:calendar (flip-horizontal pic:calendar) 30)
              (flip-horizontal pic:calendar))
(check-expect (interpolate-image pic:hacker (flip-horizontal pic:hacker) 30)
              (flip-horizontal pic:hacker))

 and then I tried

(check-expect (interpolate-image pic:calendar (flip-vertical pic:calendar) 30)
              (flip-vertical pic:calendar))
(check-expect (interpolate-image pic:hacker (flip-vertical pic:hacker) 30)
              (flip-vertical pic:hacker))

The difference was that I used "flip-horizontal" in the first one but "flip-vertical" in the second one but they all worked! Yeah!

By the way, doing project really helped me prepare the test!

No comments:

Post a Comment