From c54cc85c0f5fa98c9c675b001de5a03d5ffe5000 Mon Sep 17 00:00:00 2001 From: bnewbold Date: Sun, 29 Mar 2009 16:58:07 -0400 Subject: done (again) --- ps07_amb/bnewbold_ps07_work.scm | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) 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 -- cgit v1.2.3