sierp
; sierp : number -> image
; Sierpinski's triangle of depth d
(define sierp_0 15 "solid" "green")
; sierp : number -> image
; Sierpinski's triangle of depth d
(define (sierp d)
(cond
[(zero? d) sierp_0]
[(above (above (sierp (sub1 d))
(beside (sierp (sub1 d)) (sierp (sub1 d))))]
How does it work??
first, if d is zero, DrRacket produces sierp_0, which we define as a size-15 solid green triangle. If d is greater than 0 (above 0),say d = 1, we get
[(above (above (sierp (sub1 1))
(beside (sierp (sub1 1)) (sierp (sub1 1))))]
=>
[(above (above (sierp 0)
(beside (sierp 0) (sierp 0)))]
=>
now we get a sierp_0 above two sierp_0 sitting side by side together.
basically, sierp_0
sierp_0 sierp_0
Feedback on the test:
I think this test is harder than the last one because neither my friend nor I had time to check it over, compared to the last time which we got 30 minutes left. And I think I got the first question wrong because I didn't know what the question was asking about by "how is the way computer store info differ than the way viewers see the info?". Can I say viewers view a picture while computer store a bunch of bits?
Reminder for myself and my friends in this class:
The deadline for wikiproject is approaching (next Friday),please make it adjust your schedule and to-do-list! I hope this time I can ace it!!
Well, seeing how I was your partner, we did figure it out in the end : ) good time management and adjustment to your schedule!
ReplyDelete