comparison clojure/com/aurellem/run/bootstrap_1.clj @ 595:96ee9d72aeb9

saving progress.... sleepy time :)
author Robert McIntyre <rlm@mit.edu>
date Sat, 01 Sep 2012 13:32:19 -0500
parents ea448eecb615
children 747d47d96d2f
comparison
equal deleted inserted replaced
594:ea448eecb615 595:96ee9d72aeb9
515 (defn open-held-items 515 (defn open-held-items
516 [script] 516 [script]
517 (->> script 517 (->> script
518 select-menu-entry)) 518 select-menu-entry))
519 519
520 (defn close-celadon-computer-menu
521 [script]
522 ;; this part was determined via manual binary search
523 ;; because for some reason the current-depth RAM value
524 ;; is the same for both the final menu being either on
525 ;; or off.
526 (->> script
527 (play-moves
528 (concat (repeat 4 []) [[:b]]))))
529
520 (defn to-held-items 530 (defn to-held-items
521 [script] 531 [script]
522 (->> script 532 (->> script
523 close-menu 533 close-menu
524 close-menu 534 close-menu
525 end-text;;; grr 535 close-celadon-computer-menu
526
527 activate-start-menu 536 activate-start-menu
528 open-held-items)) 537 open-held-items))
529 538
530 (defn toss-pc-item [n quantity [moves state :as script]] 539 (defn toss-pc-item [n quantity [moves state :as script]]
531 (let [total-quantity (second (nth-pc-item state n))] 540 (let [total-quantity (second (nth-pc-item state n))]
549 (deposit-held-item-named :awakening 4) 558 (deposit-held-item-named :awakening 4)
550 (deposit-held-item-named :thunderstone 98) 559 (deposit-held-item-named :thunderstone 98)
551 (deposit-held-item-named :TM09 55) 560 (deposit-held-item-named :TM09 55)
552 (deposit-held-item-named 0x00 55)))) 561 (deposit-held-item-named 0x00 55))))
553 562
554 (defn-memo hacking-2 563 (defn hacking-2
555 ([] (hacking-2 (hacking-1))) 564 ([] (hacking-2 (hacking-1)))
556 ([script] 565 ([script]
557 (->> script 566 (->> script
558 (to-held-items) 567 (to-held-items)
559 (toss-held-item 0 166) ;; discard cruft 568 (toss-held-item 0 166) ;; discard cruft
723 (= target-pattern actual-pattern))) 732 (= target-pattern actual-pattern)))
724 733
725 (defn-memo go-to-mansion-for-the-lulz 734 (defn-memo go-to-mansion-for-the-lulz
726 ([] (go-to-mansion-for-the-lulz (hacking-13))) 735 ([] (go-to-mansion-for-the-lulz (hacking-13)))
727 ([script] 736 ([script]
728 (->> script 737 (let [lulz-delay 50]
729 close-menu 738 (->> script
730 close-menu 739 close-menu
731 end-text ;;grr 740 close-menu
732 (walk [↓ ← ← ← ← ← ← ← ← ← ↓ ↓ ↓]) 741 close-celadon-computer-menu
733 (walk (repeat 17 ←)) 742 (walk [← ← ← ← ← ← ← ← ← ↓ ↓ ↓ ↓])
734 (walk [↑ → → → → ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑]) 743 (walk (repeat 17 ←))
735 (walk [↓ ← ↑]) 744 (walk [↑ → → → → ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑])
736 (walk [↓ ↓ ↓ ↓ ↓ ↓ ↓ 745 (walk [↓ ← ↑])
737 ← ← ← ← ↑ ↑ ↑ ← ↑]) 746 (walk [↓ ↓ ↓ ↓ ↓ ↓ ↓
738 (talk) 747 ← ← ← ← ↑ ↑ ↑ ← ↑])
739 (scroll-text 2) 748 (talk)
740 (do-nothing 100) 749 (do-nothing lulz-delay)
741 close-menu))) 750 (play-moves [[:a]])
751 (do-nothing lulz-delay)
752 (play-moves [[:a]])
753 close-menu))))
742 754
743 (defn-memo launch-bootstrap-program 755 (defn-memo launch-bootstrap-program
744 ([] (launch-bootstrap-program 756 ([] (launch-bootstrap-program
745 (go-to-mansion-for-the-lulz))) 757 (go-to-mansion-for-the-lulz)))
746 ([script] 758 ([script]
788 0xD162 (+ 0xD162 (count pattern))) 800 0xD162 (+ 0xD162 (count pattern)))
789 pattern)))) 801 pattern))))
790 802
791 (defn-memo launch-main-bootstrap-program 803 (defn-memo launch-main-bootstrap-program
792 ([] (launch-main-bootstrap-program 804 ([] (launch-main-bootstrap-program
793 (control-checkpoint) 805 ;;(control-checkpoint)
794 ;;(launch-bootstrap-program) 806 (launch-bootstrap-program)
795 )) 807 ))
796 ([script] 808 ([script]
797 (->> script 809 (->> script
798 (play-moves 810 (play-moves
799 (bootstrap-pattern (main-bootstrap-program))) 811 (bootstrap-pattern (main-bootstrap-program)))