summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ps07_amb/bnewbold_ps07_work.scm36
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