Wednesday, 2 December 2015

Mistakes in Term Test 2

I did not do to badly on the first question however I spent too much time on it during the test. What confused me was what combination of the numbers in the list (range 0 256 1) make black and which make white.  The last part of question 1 as well was one which troubled me. I guess I have to practice the functions color-list->bitmap and image->color-list more before the final exam. I will take random pictures and apply these functions to them on Racket and will keep on altering the parameters of these functions, so that I can differentiate between the outputs of each of them. The other mistake I made was in the last part of question 4. The function was :
(define (q a-list)
 (cond [(= (length a-list) 1) (first a-list)]
  [else (above (beside (q (rest a-list))
               (q (rest a-list)))
               (first a-list))]))
and we had to show the result of :
(q (list (triangle 10 "solid" "black")
         (circle 5 "solid" "black")
         (square 10 "solid" "black"))).
The reason why I got this question wrong was because I did not write down the two main intermediate steps which would have helped me draw the final result. I tried to draw the image by just looking at the input of the function. The final answer was, two solid black squares of size 10 beside each other above a solid black circle of size 5, beside this the same image again and this whole image was above a solid black triangle of size 10. The intermediate steps I should have written should have been:
1.) (above (beside (q (list (circle 5 "solid" "black")
         (square 10 "solid" "black"))) (q (list (circle 5 "solid" "black")
         (square 10 "solid" "black")))) (triangle 10 "solid" "black"))

2.) (q (list (circle 5 "solid" "black")
         (square 10 "solid" "black")))

The second intermediate step would have helped me to get the result in 1.) I will make sure now that in the final exam I write down all important intermediate steps so that I do not make these kind of mistakes again.