fixed scrabble score test-data bugs. (might revert)

This commit is contained in:
Ryan Boldi 2022-08-14 09:36:56 -04:00
parent 6ffd3bea59
commit 239de881ce
2 changed files with 42 additions and 2 deletions

View File

@ -1,4 +1,4 @@
input1, output1 input1,output1
Ptpo|Nr<-0~K|X6)y,27 Ptpo|Nr<-0~K|X6)y,27
"H6X?"":qX}Q(",40 "H6X?"":qX}Q(",40
\O&T_ag7+qtKE,22 \O&T_ag7+qtKE,22
@ -646,7 +646,7 @@ _..^g2_\r~Ck,11
"}Guj<7\nk}\,\nK3jb",32 "}Guj<7\nk}\,\nK3jb",32
AT:c'0)bz3p`',21 AT:c'0)bz3p`',21
* .],0 * .],0
">9j4p8""S]0%\n%.7hH",21 ">9j4p8""S]0%\n%.7hH",20
.JX\nKF9\nP3W;b._DDS.(,40 .JX\nKF9\nP3W;b._DDS.(,40
" ~1\n}w!""",4 " ~1\n}w!""",4
\npnjy+{\nw,20 \npnjy+{\nw,20

1 input1 output1
2 Ptpo|Nr<-0~K|X6)y 27
3 H6X?":qX}Q( 40
4 \O&T_ag7+qtKE 22
646 }Guj<7\nk}\,\nK3jb 32
647 AT:c'0)bz3p`' 21
648 * .] 0
649 >9j4p8"S]0%\n%.7hH 21 20
650 .JX\nKF9\nP3W;b._DDS.( 40
651 ~1\n}w!" 4
652 \npnjy+{\nw 20

View File

@ -46,6 +46,46 @@
(vec (for [c visible-chars] (vec (for [c visible-chars]
(get scrabble-map (first (string/lower-case c)) 0))))) (get scrabble-map (first (string/lower-case c)) 0)))))
;; scrabble-letter-values
;; (def program '(0 :in1 :string_iterate (:integer_from_char [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 3 3 2 1 4 2 4 1 8 5 1 3 1 1 3 10 1 1 1 1 4 4 8 4 10 0 0 0 0 0 0 1 3 3 2 1 4 2 4 1 8 5 1 3 1 1 3 10 1 1 1 1 4 4 8 4 10 0 0 0 0] :vector_integer_nth :integer_add)))
;; (def inputs (map (fn [i] (get i :input1)) test-data))
;; test-data
;; (def correct-outputs (map (fn [i] (get i :output1)) test-data))
;; correct-outputs
;; inputs
;; (def outputs (map (fn [input]
;; (state/peek-stack
;; (interpreter/interpret-program
;; program
;; (assoc state/empty-state :input {:in1 input})
;; 200)
;; :integer))
;; inputs))
;; outputs
;; correct-outputs
;; (def errors (map (fn [correct-output output]
;; (if (= output :no-stack-item)
;; 1000000
;; (math/abs (- correct-output output))))
;; correct-outputs
;; outputs))
;; (apply + errors)
;; (defn index-of [item coll]
;; (count (take-while (partial not= item) coll)))
;; (index-of 1 errors)
;; (nth inputs 647)
;; (nth outputs 647)
;; (nth correct-outputs 647)
(def instructions (def instructions
(utils/not-lazy (utils/not-lazy
(concat (concat