labyrinth - To make a labyrinth underneath sproul-plaza...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
;;; To make a labyrinth underneath sproul-plaza, say ;;; (instantiate labyrinth sproul-plaza) ;;; now go down from sproul to enter ;;; You might also want your character to maintain a list of rooms visited on ;;; its property list so you can find your way back to the earth's surface. (define-class (labyrinth connect-place) (instance-vars (places (make-populated-places 100 60 4 'underground-room))) (initialize (can-go connect-place 'down (car places)) (can-go (car places) 'up connect-place) (connect-places places) 'okay)) ;;; You may find this helpful for moving around ;;; You may want to modify it so that you can look around ;;; in nearby rooms before entering so that you can avoid thieves. (define (fancy-move-loop who) (newline) (let ((things (ask who 'look-around))) (if things (begin (print "You see") (for-each (lambda (thing) (display thing) (display " ")) things)))) (newline) (print (ask who 'exits)) (display "? > ") (let ((dir (read))) (if (equal? dir 'stop) (newline)
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 11/30/2010 for the course EECS 21281 taught by Professor Harvey during the Spring '10 term at Berkeley.

Page1 / 2

labyrinth - To make a labyrinth underneath sproul-plaza...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online