comparison clojure/com/aurellem/run/bootstrap_1.clj @ 358:016c2bcca08f

got guard spec & x-accuracy; floor five complete.
author Robert McIntyre <rlm@mit.edu>
date Mon, 09 Apr 2012 07:30:44 -0500
parents f8b374397426
children 8c474d1d6956
comparison
equal deleted inserted replaced
357:f8b374397426 358:016c2bcca08f
483 (buy-item 2 98) ;; Thunder Stone 483 (buy-item 2 98) ;; Thunder Stone
484 (buy-item 3 29) ;; Water Stone 484 (buy-item 3 29) ;; Water Stone
485 close-menu 485 close-menu
486 end-shop-conversation))) 486 end-shop-conversation)))
487 487
488 (defn go-to-floor-five 488 (defn-memo go-to-floor-five
489 []) 489 ([] (go-to-floor-five (floor-four-items)))
490 490 ([script]
491 (defn floor-five-items 491 (->> script
492 []) 492 (walk [→ → → → → →
493 ↑ ↑ ↑
494 → → → → → ↑ ;; leave floor four
495 ↓ ← ← ← ← ← ← ← ←
496 ↓ ↓ ↓ ← ← ← ;; go to five's clerk
497 ])
498 (turn ↑))))
499
500 (defn-memo floor-five-items
501 ([] (floor-five-items (go-to-floor-five)))
502 ([script]
503 (->> script
504 talk
505 select-menu-entry
506 (buy-item 0 58) ;; X-Accuracy
507 (buy-item 1 99) ;; Guard Spec.
508 (buy-item 1 24) ;; Guard Spec.
509 close-menu
510 end-shop-conversation)))
493 511
494 (defn go-to-roof 512 (defn go-to-roof
495 []) 513 [])
496 514
497 (defn roof-drinks 515 (defn roof-drinks