(define heaven (instantiate place 'heaven)) (define hell (instantiate place 'hell)) (define-class (angel name place) (parent (person name place 'good)) (initialize (ask self 'put 'strength 2000)) (method (type) 'angel) (method (angel?) #t) (method (go direction) (usual 'go direction) (ask self 'new-place)) (method (go-directly-to place) (usual 'go-directly-to place) (ask self 'new-place)) (method (new-place) (for-each (lambda (person) (if (< (ask person 'strength) 0) (begin (print "It's time for you to die!") (for-each (lambda (T) (ask person 'drop t)) (ask person 'possessions)) (ask person 'go-directly-to (if (ask person 'good?) heaven hell))))) (ask (usual 'place) 'people)))) ;;changes in thief class (parent (person name initial-place 'bad)) ;*X ;;changes in police class (parent (person name place 'good)) ;*X ;;changes in person class (define-class (person name place good_or_bad) ;*X (parent (basic-object)) (instance-vars (possessions '()) (saying "")) (initialize (ask self 'put 'strength 100) (ask self 'put 'good? (equal? good_or_bad 'good)) ;*X (ask self 'put 'money 100) (ask place 'enter self)) ;;the new method (method (loose-strength x) ;*X (ask self 'put 'strength (- (ask self 'strength) x))) ;*X