diff options
author | bnewbold <bnewbold@eta.mit.edu> | 2009-03-29 16:58:07 -0400 |
---|---|---|
committer | bnewbold <bnewbold@eta.mit.edu> | 2009-03-29 16:58:07 -0400 |
commit | c54cc85c0f5fa98c9c675b001de5a03d5ffe5000 (patch) | |
tree | b79be48334e2673d5dc9758fb29ed1efb356001b /ps07_amb | |
parent | ab0abf13b69d0911cde46bdafedcef4d485f63f3 (diff) | |
download | 6.945-c54cc85c0f5fa98c9c675b001de5a03d5ffe5000.tar.gz 6.945-c54cc85c0f5fa98c9c675b001de5a03d5ffe5000.zip |
done (again)
Diffstat (limited to 'ps07_amb')
-rw-r--r-- | ps07_amb/bnewbold_ps07_work.scm | 36 |
1 files changed, 35 insertions, 1 deletions
diff --git a/ps07_amb/bnewbold_ps07_work.scm b/ps07_amb/bnewbold_ps07_work.scm index f134fa7..4556652 100644 --- a/ps07_amb/bnewbold_ps07_work.scm +++ b/ps07_amb/bnewbold_ps07_work.scm @@ -143,7 +143,7 @@ |# ;;;------------------------------------------------------------------------ -;;; Problem 7.4 +;;; Problem 7.5 (define (a-nice-itinerary budget) (let ((city (amb '(boston 0) @@ -287,4 +287,38 @@ (10 13 20) (etc) +(begin + (init-amb) + (with-random-alternation + (lambda () + (pp (a-nice-itinerary 600))))) + +(nyc dumpster-dive couch 5 park) +(paris dumpster-dive couch 5 park) +(boston dumpster-dive couch 5 park) +(london dumpster-dive couch 5 park) +(san-fransisco dumpster-dive couch 5 park) +(nyc foi-gras couch 5 park) +(etc) + +|# + + +;;;------------------------------------------------------------------------ +;;; Problem 7.6 + +(define moby-brain-twister-test + (lambda () + (let ((x) (y) (z)) + (set! x (amb 1 2 3)) + (pp (list x)) + (set! y (amb 'a 'b)) + (pp (list x y)) + (set! z (amb #t #f)) + (pp (list x y z)) + (amb)))) +#| +(with-breadth-first-schedule moby-brain-twister-test) +(with-depth-first-schedule moby-brain-twister-test) + |#
\ No newline at end of file |