Friday, October 31, 2008

PS6

i detest ps6 (problem set 6)

can't do, dunno what to do, confused about what to add and lastly, it doesn't work

java is getting confusing

i hate confusing stuff

why is biz mod so easy and comp mod so hard?

i just failed another comp test

i have another test next wed

i'm going to get kicked out of comp

biz mod require mugging

mugging have not start due to time required by comp mod

screw it

coding:

(define (make-annette name birthplace threshold)
(let ((mobile-obj (make-mobile-obj name birthplace threshold))) ; annette is a mobile object
(lambda (msg)
(case msg
((do) ; define an action 'do'
(lambda (self)
(let ((worktodo (filter (lambda (x) (is-a x 'ps6)) (ask self 'things)))) ; ask annette whether the things she has to do is ps6
(if (null? worktodo)
(display"PS6 done!")
(display "DO YOUR PS6 LAH!!"))))))
((lost) ; define an action 'lost'
(lambda (self)
(let ((not-lost (ask self 'know-how-to-do?)) ; ask annette if she knows how to do
(if (not-lost)
(display "Good for you (:" )
(display "Give up ba...")))))
((know-how-to-do?) ; define an action 'know how to do?'
(lambda (self)
#f)) ; always false which means always dunno
(else (get-method mobile-obj msg))))))))

(define annette (make-annette annette nus 1)) ; to create avatar annette

conclusion: annette always dunno how to do ps6 and msg return is "give up ba..."
further conclusion: this is a sign that annette has been driven mad byy ps6
further conclusion x2: her good and zai fren has said that there is hardly any syntax error
further conclusion x3: annette has grasped simple OOP
further conclusion x4: ps6 is not simple OOP

*[[ And they lived happily ever after... ]]*
|3:17 PM|


blog
child
friends
others
Get awesome blog templates like this one from BlogSkins.comGet awesome blog templates like this one from BlogSkins.com