# HG changeset patch # User Robert McIntyre # Date 1333149328 18000 # Node ID 9f466a332448c2effd98c62b31bd23a57e3cf0ee # Parent 4a0dbaed7078983029622c94ad56c1694d23935f# Parent c31cb30430878d611230a5efcbf8f7eee96651c7 merge diff -r c31cb3043087 -r 9f466a332448 clojure/com/aurellem/exp/notes.txt --- a/clojure/com/aurellem/exp/notes.txt Fri Mar 30 05:57:12 2012 -0500 +++ b/clojure/com/aurellem/exp/notes.txt Fri Mar 30 18:15:28 2012 -0500 @@ -73,6 +73,42 @@ +[repeat 35 times] +0xFF +0x01 +[end repeat] + + +;;; program to swap item ID and quantity at fixed address. +;; here target is equal to rival's thrid and fourth character + + +0x00 +0x21 ;; load target into HL + +third rival's name character +xD5 -- target item address + +0x00 +0x2A ;; save (HL)=(target) to A, increment HL + +0x00 +0x78 ;; save A to B + +0x00 +0x3A ;; save (target+1) to A, decrement HL + +0x00 +0x22 ;; save A to target, increment HL [(target+1) -> target] + +0x00 +0x78 ;; load B to A + +0x00 +0x77 ;; load A into target+1 [(target) -> target+1] + + + @@ -84,8 +120,3 @@ 0xD31D - 0xD41B --OR-- 0xD53A - 0XD59C - - - - - diff -r c31cb3043087 -r 9f466a332448 clojure/com/aurellem/run/bootstrap_0.clj --- a/clojure/com/aurellem/run/bootstrap_0.clj Fri Mar 30 05:57:12 2012 -0500 +++ b/clojure/com/aurellem/run/bootstrap_0.clj Fri Mar 30 18:15:28 2012 -0500 @@ -723,15 +723,6 @@ (menu [[:d] [:a]]) (do-nothing 40)))) -(defn deposit-one-item - [script] - (->> script - (do-nothing 100) - (play-moves [[:a]]) - (do-nothing 80) - (play-moves [[:a]]) - (scroll-text) - )) (defn multiple-times ([n command args script] @@ -742,13 +733,27 @@ ([n command script] (multiple-times n command [] script))) -(defn create-header +(defn deposit-n-items + [n script] + (->> script + (do-nothing 100) + (play-moves [[:a]]) + (do-nothing 80) + (multiple-times + (dec n) + (fn [script] + (->> script + (play-moves [[:u]]) + (do-nothing 1)))) + (play-moves [[:a]]) + (scroll-text))) + + +(defn-memo create-header ([] (create-header (begin-deposits))) ([script] (->> script - (multiple-times 34 deposit-one-item) - ;;(deposit-one-item) - ;;(deposit-one-item) + (multiple-times 33 deposit-one-item) (do-nothing 1))))