Not as hard as I thought, but there still two things confuse me a lot
1 what is the code "map-image" really means?
2 for the check-key part,
(check-expect (check-key (make-clocktime 1 2 3 GO) "up") (make-clocktime 1 2 3 GO))
(check-expect (check-key (make-clocktime 1 2 3 GO) "down") (make-clocktime 1 2 3 STOP))
(define (check-key im k)
(cond
[(equal? k "down") STOP]
[else im]))
I just cannot find a definition which could fit the two check-expect well
I think the reason is the make-clocktime and the GO sigh are bound together, represented by im. So I don't know how to change only one part of the whole item.
And I tried to define another function to help me solve this problem another way, but all the "placeholder" I tried to use was showed "not defined"...
Anyway, doing the project is a great way for me to prepare the term test next week.
没有评论:
发表评论