comparison clojure/com/aurellem/run/bootstrap_0.clj @ 291:c8b0db518de3

script: creating header for initial bootstrap program.
author Robert McIntyre <rlm@mit.edu>
date Thu, 29 Mar 2012 18:23:20 -0500
parents dc9a0060e7cb
children 4a0dbaed7078
comparison
equal deleted inserted replaced
290:dc9a0060e7cb 291:c8b0db518de3
695 → ↓ ↓]) 695 → ↓ ↓])
696 (walk [← ← ← ← 696 (walk [← ← ← ←
697 ↓ ↓ ↓ ↓ ↓ ↓ 697 ↓ ↓ ↓ ↓ ↓ ↓
698 ← ← ← ↑])))) 698 ← ← ← ↑]))))
699 699
700 (defn to-poke-center-computer 700 (defn-memo to-poke-center-computer
701 ([] (to-poke-center-computer 701 ([] (to-poke-center-computer
702 (viridian-store->viridian-poke-center))) 702 (viridian-store->viridian-poke-center)))
703 ([script] 703 ([script]
704 (->> script 704 (->> script
705 (walk [→ → 705 (walk [→ →
706 ↑ ↑ ↑ 706 ↑ ↑ ↑
707 → → → → → → → → → ↑]) 707 → → → → → → → → → ↑])
708 (do-nothing 1)))) 708 (do-nothing 1))))
709 709
710 (defn-memo begin-deposits
711 ([] (begin-deposits
712 (to-poke-center-computer)))
713 ([script]
714 (->> script
715 ;; access PC
716 (scroll-text 2)
717
718 ;; access item storage
719 (menu [[:a] [:d] [:a]])
720 (scroll-text 2)
721
722 ;; begin deposit
723 (menu [[:d] [:a]])
724 (do-nothing 40))))
725
726 (defn deposit-one-item
727 [script]
728 (->> script
729 (do-nothing 100)
730 (play-moves [[:a]])
731 (do-nothing 80)
732 (play-moves [[:a]])
733 (scroll-text)
734 ))
735
736 (defn multiple-times
737 ([n command args script]
738 (reduce (fn [script _]
739 (apply command (concat args [script])))
740 script
741 (range n)))
742 ([n command script]
743 (multiple-times n command [] script)))
744
745 (defn create-header
746 ([] (create-header (begin-deposits)))
747 ([script]
748 (->> script
749 (multiple-times 34 deposit-one-item)
750 ;;(deposit-one-item)
751 ;;(deposit-one-item)
752 (do-nothing 1))))
753
754
755