2012年11月18日星期日

Figure out

 I did figure out how to make Drracket do it 'the long way'.  I used the recursive definitions we learned in class to make racket take the sum of the bottom layer of a pyramid then work its way up. It was pretty straight forward and looked like this
(require picturing-programs)
(define (sum n) (/ (* n (+ n 1)) 2))
(define (vol n)
 (cond
   [(equal? n 1) 1]
   [else (+ (sum n) (vol (- n 1)))]))

2012年11月11日星期日

This week

This week we learned what is posn and how to use it in a program through the ebook. Though  it was very hard and difficult.