;; more_concurrency.txt ;; ;; David Kauchak ;; ;; Some applied examples of using concurrency menu 1 [fancy-ping-pong] menu 2 [too-much-concurrency] to fancy-ping-pong loop[ ;; go forward ab, on thisway waituntil front-bumper? ;; go backward ab, on thatway every 5 [beep] ;; make backup noises waituntil back-bumper? stoprules ;; stop the backup noises ] end to too-much-concurrency loop[ when [switch 7] [beep] ] end to eight-ball-challenge launch [fancy-ping-pong] when sense-ball? [grab-ball] when [front-bumper?] [ditch-ball] end to grab-ball beep ;; then grab it! end to ditch-ball beep ;; then throw the ball over the wall end to sense-ball? output (sensor 0) < 10 end ;; helper procedures to front-bumper? output switch 7 end to back-bumper? output switch 8 end