(define s0 '( (w w w) (w 0 w) (w w w) ) ) (define t0 '( (w w w) (w 0 w) (w w w) ) ) (define s1 '( (w w w) (w 1 w) (w 0 w) (w w w) ) ) (define t1 '( (w w w) (w 1 w) (w 0 w) (w w w) ) ) (define s2 '( (w w w w w w w w) (w 0 0 1 1 w w w) (w w 0 0 0 1 w w) (w w 0 0 0 1 w w) (w w w 0 0 1 0 w) (w w w 0 1 0 1 w) (w w w w w w w w) ) ) (define t2 '( (w w w w w w w w) (w 0 0 1 1 w w w) (w w 0 0 0 1 w w) (w w 0 0 0 1 w w) (w w w 0 0 1 0 w) (w w w 0 1 0 1 w) (w w w w w w w w) ) ) (define s3 '( (w w w w w w w w w w w) (w 0 0 0 0 0 0 0 0 0 w) (w w w w w 0 w w w 0 w) (w w w w w 0 w w w 0 w) (w 0 0 0 0 0 0 0 w 0 w) (w 0 0 0 0 0 w 0 w 0 w) (w w 0 w w 0 w 0 w 0 w) (w w 0 w 0 0 w 0 w 0 w) (w w 0 w w w w 0 w 0 w) (w w 0 0 0 0 0 0 w 0 w) (w w w w w w w w w 0 w) (w w w w w w w w w 0 w) (w w w w w w w w w 0 w) (w w w w w w w w w 0 w) (w 0 0 0 0 0 0 0 0 0 w) (w w w w w w w w w w w) ) ) (define t3 '( (w w w w w w w w w w w) (w 0 0 0 0 0 0 0 0 0 w) (w w w w w 0 w w w 0 w) (w w w w w 0 w w w 0 w) (w 0 0 0 0 0 0 0 w 0 w) (w 0 0 0 0 0 w 0 w 0 w) (w w 0 w w 0 w 0 w 0 w) (w w 0 w 0 0 w 0 w 0 w) (w w 0 w w w w 0 w 0 w) (w w 0 0 0 0 0 0 w 0 w) (w w w w w w w w w 0 w) (w w w w w w w w w 0 w) (w w w w w w w w w 0 w) (w w w w w w w w w 0 w) (w 0 0 0 0 0 0 0 0 0 w) (w w w w w w w w w w w) ) ) (define p0 '( (procedure start (turn-left (if wall? (turn-right (if wall? (turn-right (if wall? turn-right step)) step)) step) put-mark start ) ) (procedure turn-right (turn-left turn-left turn-left turn-left turn-left)) ) ) (define p1 '( (procedure start put-mark ) ) ) (define p2 '( (procedure start (if wall? put-mark step) ) ) ) (define p7 '( (procedure start add) (procedure add (sub-one turn-180 go turn-right step turn-right turn-right add-one turn-180 go turn-left step turn-left add ) ) (procedure add-one (if mark? (get-mark (if wall? (turn-180 go turn-180) (step add-one))) (put-mark) ) ) (procedure sub-one (if mark? (get-mark) (put-mark (if wall? (turn-180 go turn-right step (if wall? turn-right (turn-right sub-one))) (step sub-one))) ) ) (procedure turn-180 (turn-left turn-left turn-left) ) (procedure turn-right (turn-left turn-left turn-left turn-left turn-left) ) (procedure go (if wall? () (step go)) ) ) ) (define p8 '( (procedure start (go-west go)) (procedure go (if wall? (turn-left go) (step go-west go) ) ) (procedure go-west (if west? () (turn-left go-west)) ) ) ) (define p9 '( (procedure start (turn-west go)) (procedure go (if wall? () (step go) ) ) (procedure turn-west (if west? () (turn-left turn-west)) ) ) ) (newline) ;(simulate `(,s3 (1 1) north) 'start p6 30 100) (evaluate `(,p0 ,p1 ,p2 ,p7 ,p8 ,p9) `(((,s0 (1 1) west) (,t0 (1 1) northwest)) ((,s1 (1 2) west) (,t1 (1 1) northwest)) ((,s2 (6 5) west) (,t2 (4 1) northwest)) ((,s3 (2 9) east) (,t3 (2 4) northwest))) `(200 80 200 150) 5)